Let the button/theme deal with prelight. I don't think
it fits inside palette drawing.
This commit is contained in:
parent
3bb86e0cbb
commit
d7d1e172a3
@ -577,29 +577,19 @@ class WidgetInvoker(Invoker):
|
||||
|
||||
def draw_invoker_rect(self, event, palette):
|
||||
style = self._widget.style
|
||||
if palette.is_up():
|
||||
gap = _calculate_gap(self.get_rect(), palette.get_rect())
|
||||
|
||||
if gap:
|
||||
style.paint_box_gap(event.window, gtk.STATE_PRELIGHT,
|
||||
gtk.SHADOW_IN, event.area, self._widget,
|
||||
"palette-invoker",
|
||||
self._widget.allocation.x,
|
||||
self._widget.allocation.y,
|
||||
self._widget.allocation.width,
|
||||
self._widget.allocation.height,
|
||||
gap[0], gap[1], gap[2])
|
||||
else:
|
||||
style.paint_box(event.window, gtk.STATE_PRELIGHT,
|
||||
gap = _calculate_gap(self.get_rect(), palette.get_rect())
|
||||
if gap:
|
||||
style.paint_box_gap(event.window, gtk.STATE_PRELIGHT,
|
||||
gtk.SHADOW_IN, event.area, self._widget,
|
||||
"palette-invoker",
|
||||
self._widget.allocation.x,
|
||||
self._widget.allocation.y,
|
||||
self._widget.allocation.width,
|
||||
self._widget.allocation.height)
|
||||
self._widget.allocation.height,
|
||||
gap[0], gap[1], gap[2])
|
||||
else:
|
||||
style.paint_box(event.window, gtk.STATE_PRELIGHT,
|
||||
gtk.SHADOW_NONE, event.area, self._widget,
|
||||
gtk.SHADOW_IN, event.area, self._widget,
|
||||
"palette-invoker",
|
||||
self._widget.allocation.x,
|
||||
self._widget.allocation.y,
|
||||
|
@ -47,10 +47,9 @@ class RadioToolButton(gtk.RadioToolButton):
|
||||
self._palette.props.invoker = WidgetInvoker(self.child)
|
||||
|
||||
def do_expose_event(self, event):
|
||||
if self._palette and self._palette.props.draw_gap:
|
||||
if self._palette.is_up() or self.child.state == gtk.STATE_PRELIGHT:
|
||||
invoker = self._palette.props.invoker
|
||||
invoker.draw_invoker_rect(event, self._palette)
|
||||
if self._palette and self._palette.is_up():
|
||||
invoker = self._palette.props.invoker
|
||||
invoker.draw_invoker_rect(event, self._palette)
|
||||
|
||||
gtk.RadioToolButton.do_expose_event(self, event)
|
||||
|
||||
|
@ -46,10 +46,9 @@ class ToggleToolButton(gtk.ToggleToolButton):
|
||||
self._palette.props.invoker = WidgetInvoker(self.child)
|
||||
|
||||
def do_expose_event(self, event):
|
||||
if self._palette and self._palette.props.draw_gap:
|
||||
if self._palette.is_up() or self.child.state == gtk.STATE_PRELIGHT:
|
||||
invoker = self._palette.props.invoker
|
||||
invoker.draw_invoker_rect(event, self._palette)
|
||||
if self._palette and self._palette.is_up():
|
||||
invoker = self._palette.props.invoker
|
||||
invoker.draw_invoker_rect(event, self._palette)
|
||||
|
||||
gtk.ToggleToolButton.do_expose_event(self, event)
|
||||
|
||||
|
@ -48,10 +48,9 @@ class ToolButton(gtk.ToolButton):
|
||||
self.set_palette(Palette(text))
|
||||
|
||||
def do_expose_event(self, event):
|
||||
if self._palette and self._palette.props.draw_gap:
|
||||
if self._palette.is_up() or self.child.state == gtk.STATE_PRELIGHT:
|
||||
invoker = self._palette.props.invoker
|
||||
invoker.draw_invoker_rect(event, self._palette)
|
||||
if self._palette and self._palette.is_up():
|
||||
invoker = self._palette.props.invoker
|
||||
invoker.draw_invoker_rect(event, self._palette)
|
||||
|
||||
gtk.ToolButton.do_expose_event(self, event)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user