Fix palette highlighting on tray icons. Patch by benzea, style tweaks by me.

This commit is contained in:
Marco Pesenti Gritti 2008-12-18 23:53:44 +01:00
parent 347cc9413b
commit 4b38ff298b

View File

@ -1003,23 +1003,25 @@ class WidgetInvoker(Invoker):
return True return True
def draw_rectangle(self, event, palette): def draw_rectangle(self, event, palette):
if self._widget.flags() & gtk.NO_WINDOW:
x, y = self._widget.allocation.x, self._widget.allocation.y
else:
x = y = 0
wstyle = self._widget.get_style() wstyle = self._widget.get_style()
gap = _calculate_gap(self.get_rect(), palette.get_rect()) gap = _calculate_gap(self.get_rect(), palette.get_rect())
if gap: if gap:
wstyle.paint_box_gap(event.window, gtk.STATE_PRELIGHT, wstyle.paint_box_gap(event.window, gtk.STATE_PRELIGHT,
gtk.SHADOW_IN, event.area, self._widget, gtk.SHADOW_IN, event.area, self._widget,
"palette-invoker", "palette-invoker", x, y,
self._widget.allocation.x,
self._widget.allocation.y,
self._widget.allocation.width, self._widget.allocation.width,
self._widget.allocation.height, self._widget.allocation.height,
gap[0], gap[1], gap[2]) gap[0], gap[1], gap[2])
else: else:
wstyle.paint_box(event.window, gtk.STATE_PRELIGHT, wstyle.paint_box(event.window, gtk.STATE_PRELIGHT,
gtk.SHADOW_IN, event.area, self._widget, gtk.SHADOW_IN, event.area, self._widget,
"palette-invoker", "palette-invoker", x, y,
self._widget.allocation.x,
self._widget.allocation.y,
self._widget.allocation.width, self._widget.allocation.width,
self._widget.allocation.height) self._widget.allocation.height)