From 7634b8f91529ca77eacd8a1f02d9fe79e87bc9c7 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 09 Oct 2007 21:54:47 +0000 Subject: Put toolbars into event boxes. This means that they will be filled with the background color by X which makes the frame animations nicer. --- diff --git a/NEWS b/NEWS index 332216f..08ed370 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +* Put toolbars into event boxes so X fills the background correctly (benzea) + Snapshot 6c7c6a503b * Activity launching refactoring. (marco) diff --git a/sugar/graphics/toolbox.py b/sugar/graphics/toolbox.py index f394e2b..e4e831a 100644 --- a/sugar/graphics/toolbox.py +++ b/sugar/graphics/toolbox.py @@ -58,28 +58,23 @@ class Toolbox(gtk.VBox): def _notify_page_cb(self, notebook, pspec): self.emit('current-toolbar-changed', notebook.props.page) - def _toolbar_box_expose_cb(self, widget, event): - widget.style.paint_flat_box(widget.window, - gtk.STATE_NORMAL, gtk.SHADOW_NONE, - event.area, widget, 'toolbox', - widget.allocation.x, - widget.allocation.y, - widget.allocation.width, - widget.allocation.height) - return False - def add_toolbar(self, name, toolbar): label = gtk.Label(name) label.set_size_request(style.TOOLBOX_TAB_LABEL_WIDTH, -1) label.set_alignment(0.0, 0.5) - toolbar_box = gtk.HBox() - toolbar_box.pack_start(toolbar, True, True, - style.TOOLBOX_HORIZONTAL_PADDING) - toolbar_box.connect('expose-event', self._toolbar_box_expose_cb) + event_box = gtk.EventBox() + + alignment = gtk.Alignment(0.0, 0.0, 1.0, 1.0) + alignment.set_padding(0, 0, style.TOOLBOX_HORIZONTAL_PADDING, + style.TOOLBOX_HORIZONTAL_PADDING) + + alignment.add(toolbar) + event_box.add(alignment) + alignment.show() + event_box.show() - self._notebook.append_page(toolbar_box, label) - toolbar_box.show() + self._notebook.append_page(event_box, label) if self._notebook.get_n_pages() > 1: self._notebook.set_show_tabs(True) -- cgit v0.9.1