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:
parent
a0bd80bb4e
commit
7634b8f915
2
NEWS
2
NEWS
@ -1,3 +1,5 @@
|
|||||||
|
* Put toolbars into event boxes so X fills the background correctly (benzea)
|
||||||
|
|
||||||
Snapshot 6c7c6a503b
|
Snapshot 6c7c6a503b
|
||||||
|
|
||||||
* Activity launching refactoring. (marco)
|
* Activity launching refactoring. (marco)
|
||||||
|
@ -58,28 +58,23 @@ class Toolbox(gtk.VBox):
|
|||||||
def _notify_page_cb(self, notebook, pspec):
|
def _notify_page_cb(self, notebook, pspec):
|
||||||
self.emit('current-toolbar-changed', notebook.props.page)
|
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):
|
def add_toolbar(self, name, toolbar):
|
||||||
label = gtk.Label(name)
|
label = gtk.Label(name)
|
||||||
label.set_size_request(style.TOOLBOX_TAB_LABEL_WIDTH, -1)
|
label.set_size_request(style.TOOLBOX_TAB_LABEL_WIDTH, -1)
|
||||||
label.set_alignment(0.0, 0.5)
|
label.set_alignment(0.0, 0.5)
|
||||||
|
|
||||||
toolbar_box = gtk.HBox()
|
event_box = gtk.EventBox()
|
||||||
toolbar_box.pack_start(toolbar, True, True,
|
|
||||||
style.TOOLBOX_HORIZONTAL_PADDING)
|
|
||||||
toolbar_box.connect('expose-event', self._toolbar_box_expose_cb)
|
|
||||||
|
|
||||||
self._notebook.append_page(toolbar_box, label)
|
alignment = gtk.Alignment(0.0, 0.0, 1.0, 1.0)
|
||||||
toolbar_box.show()
|
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:
|
if self._notebook.get_n_pages() > 1:
|
||||||
self._notebook.set_show_tabs(True)
|
self._notebook.set_show_tabs(True)
|
||||||
|
Loading…
Reference in New Issue
Block a user