Set correct background for subtoolbars - SL #3987

- remove set_app_paintable from _Box to fix the bad coloring of
  subtoolbars.  The documentation say we can't rely on it to paint the
  themed background when this is set [1].

- don't call Gtk.EventBox.do_draw in the _Box do_draw because that
  will not paint the child toolbar.  Call the child do_draw instead.

- revert 7fc29c9d which was a workaround for the most frequent usage

[1] http://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-set-app-paintable

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
This commit is contained in:
Manuel Quiñones 2012-10-31 11:44:20 -03:00
parent 8af0d49591
commit 25497c7677

View File

@ -268,10 +268,7 @@ class _Box(Gtk.EventBox):
def __init__(self, toolbar_button): def __init__(self, toolbar_button):
GObject.GObject.__init__(self) GObject.GObject.__init__(self)
self.set_app_paintable(True)
self._toolbar_button = toolbar_button self._toolbar_button = toolbar_button
self.modify_bg(Gtk.StateType.NORMAL,
style.COLOR_TOOLBAR_GREY.get_gdk_color())
def do_draw(self, cr): def do_draw(self, cr):
button_alloc = self._toolbar_button.get_allocation() button_alloc = self._toolbar_button.get_allocation()
@ -284,7 +281,7 @@ class _Box(Gtk.EventBox):
cr.line_to(self.get_allocation().width, 0) cr.line_to(self.get_allocation().width, 0)
cr.stroke() cr.stroke()
Gtk.EventBox.do_draw(self, cr) self.get_child().do_draw(self, cr)
def _setup_page(page_widget, color, hpad): def _setup_page(page_widget, color, hpad):