Put toolbars into event boxes. This means that they will be filled with

the background color by X which makes the frame animations nicer.
This commit is contained in:
Benjamin Berg 2007-10-09 23:54:47 +02:00
parent a0bd80bb4e
commit 7634b8f915
2 changed files with 13 additions and 16 deletions

2
NEWS
View File

@ -1,3 +1,5 @@
* Put toolbars into event boxes so X fills the background correctly (benzea)
Snapshot 6c7c6a503b
* Activity launching refactoring. (marco)

View File

@ -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()
self._notebook.append_page(toolbar_box, label)
toolbar_box.show()
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(event_box, label)
if self._notebook.get_n_pages() > 1:
self._notebook.set_show_tabs(True)