Revert "Fix the drawing of ColorToolButton, RadioToolButton and ToggleToolButton"

This reverts commit 1e6cba8474.
This commit is contained in:
Manuel Quiñones 2012-08-23 18:13:47 -03:00
parent 030ab202c8
commit 00761f3d01
3 changed files with 27 additions and 9 deletions

View File

@ -523,14 +523,20 @@ class ColorToolButton(Gtk.ToolItem):
title = GObject.property(type=str, getter=get_title, setter=set_title)
def do_draw(self, cr):
def do_expose_event(self, event):
child = self.get_child()
allocation = self.get_allocation()
if self._palette and self._palette.is_up():
invoker = self._palette.props.invoker
invoker.draw_rectangle(cr, self._palette)
invoker.draw_rectangle(event, self._palette)
elif child.state == Gtk.StateType.PRELIGHT:
child.style.paint_box(event.window, Gtk.StateType.PRELIGHT,
Gtk.ShadowType.NONE, event.area,
child, 'toolbutton-prelight',
allocation.x, allocation.y,
allocation.width, allocation.height)
Gtk.ToolButton.do_draw(self, cr)
Gtk.ToolButton.do_expose_event(self, event)
def __notify_change(self, widget, pspec):
self.notify(pspec.name)

View File

@ -165,12 +165,18 @@ class RadioToolButton(Gtk.RadioToolButton):
palette_invoker = GObject.property(
type=object, setter=set_palette_invoker, getter=get_palette_invoker)
def do_draw(self, cr):
def do_expose_event(self, event):
child = self.get_child()
allocation = self.get_allocation()
if self.palette and self.palette.is_up():
invoker = self.palette.props.invoker
invoker.draw_rectangle(cr, self.palette)
invoker.draw_rectangle(event, self.palette)
elif child.state == Gtk.StateType.PRELIGHT:
child.style.paint_box(event.window, Gtk.StateType.PRELIGHT,
Gtk.ShadowType.NONE, event.area,
child, 'toolbutton-prelight',
allocation.x, allocation.y,
allocation.width, allocation.height)
Gtk.RadioToolButton.do_draw(self, cr)
Gtk.RadioToolButton.do_expose_event(self, event)

View File

@ -113,14 +113,20 @@ class ToggleToolButton(Gtk.ToggleToolButton):
accelerator = GObject.property(type=str, setter=set_accelerator,
getter=get_accelerator)
def do_draw(self, cr):
def do_expose_event(self, event):
allocation = self.get_allocation()
child = self.get_child()
if self.palette and self.palette.is_up():
invoker = self.palette.props.invoker
invoker.draw_rectangle(cr, self.palette)
invoker.draw_rectangle(event, self.palette)
elif child.state == Gtk.StateType.PRELIGHT:
child.style.paint_box(event.window, Gtk.StateType.PRELIGHT,
Gtk.ShadowType.NONE, event.area,
child, 'toolbutton-prelight',
allocation.x, allocation.y,
allocation.width, allocation.height)
Gtk.ToggleToolButton.do_draw(self, cr)
Gtk.ToggleToolButton.do_expose_event(self, event)
palette = property(get_palette, set_palette)