diff options
author | Simon Schampijer <simon@schampijer.de> | 2012-03-16 09:18:10 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2012-03-16 16:05:02 (GMT) |
commit | 1ac82f4471a6077a8fd3ae0d302a53eb89c3abf9 (patch) | |
tree | a5f9cafd83ab2cefd4720ff025bcf8e26783d25e | |
parent | 8595e2efe48c9163c179a6533e64ead330ce6680 (diff) |
Make the LinkInfo that is displayed at the bottom left themable
Add a gtype_name to make it easily accessible from the theme. We have
to do the same for the overlay as well in order to be able to
set the 'background-color' of the label. Labels don't create their own
window to render themselves into. Instead, they draw themselves
directly onto their parents window, so we have to set the background-color
of the parent in order to set the labels' background color [1].
The patch does adjust the gtype_names to be consistent.
[1] http://developer.gnome.org/gtk-faq/stable/x810.html
Signed-off-by: Simon Schampijer <simon@schampijer.de>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r-- | browser.py | 17 | ||||
-rw-r--r-- | widgets.py | 4 |
2 files changed, 15 insertions, 6 deletions
@@ -286,7 +286,18 @@ Gtk.rc_parse_string(''' widget "*browse-tab-close" style "browse-tab-close"''') +class LinkInfo(Gtk.Label): + __gtype_name__ = 'BrowseLinkInfo' + + def __init__(self): + GObject.GObject.__init__(self) + self.set_halign(Gtk.Align.START) + self.set_valign(Gtk.Align.END) + + class TabPage(Gtk.Overlay): + __gtype_name__ = 'BrowseTabPage' + def __init__(self, browser): GObject.GObject.__init__(self) @@ -294,9 +305,7 @@ class TabPage(Gtk.Overlay): self._showing_load_status = False self._requested_uri = None - link_info = Gtk.Label() - link_info.set_halign(Gtk.Align.START) - link_info.set_valign(Gtk.Align.END) + link_info = LinkInfo() self.add_overlay(link_info) link_info.show() @@ -351,7 +360,7 @@ class TabPage(Gtk.Overlay): class TabLabel(Gtk.HBox): - __gtype_name__ = 'TabLabel' + __gtype_name__ = 'BrowseTabLabel' __gsignals__ = { 'tab-close': (GObject.SignalFlags.RUN_FIRST, @@ -23,7 +23,7 @@ from sugar3.graphics.icon import Icon class TabAdd(Gtk.HBox): - __gtype_name__ = 'TabAdd' + __gtype_name__ = 'BrowseTabAdd' __gsignals__ = { 'tab-added': (GObject.SignalFlags.RUN_FIRST, @@ -53,7 +53,7 @@ class TabAdd(Gtk.HBox): class BrowserNotebook(Gtk.Notebook): - __gtype_name__ = 'BrowserNotebook' + __gtype_name__ = 'BrowseNotebook' """Handle an extra tab at the end with an Add Tab button.""" |