diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/persistenttooltip.py | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/persistenttooltip.py b/bitbake/lib/bb/ui/crumbs/persistenttooltip.py index e9cc380b0a..d065ab2c07 100644 --- a/bitbake/lib/bb/ui/crumbs/persistenttooltip.py +++ b/bitbake/lib/bb/ui/crumbs/persistenttooltip.py | |||
@@ -38,6 +38,11 @@ class PersistentTooltip(gtk.Window): | |||
38 | def __init__(self, markup): | 38 | def __init__(self, markup): |
39 | gtk.Window.__init__(self, gtk.WINDOW_POPUP) | 39 | gtk.Window.__init__(self, gtk.WINDOW_POPUP) |
40 | 40 | ||
41 | # Inherit the system theme for a tooltip | ||
42 | style = gtk.rc_get_style_by_paths(gtk.settings_get_default(), | ||
43 | 'gtk-tooltip', 'gtk-tooltip', gobject.TYPE_NONE) | ||
44 | self.set_style(style) | ||
45 | |||
41 | # The placement of the close button on the tip should reflect how the | 46 | # The placement of the close button on the tip should reflect how the |
42 | # window manager of the users system places close buttons. Try to read | 47 | # window manager of the users system places close buttons. Try to read |
43 | # the metacity gconf key to determine whether the close button is on the | 48 | # the metacity gconf key to determine whether the close button is on the |
@@ -96,17 +101,28 @@ class PersistentTooltip(gtk.Window): | |||
96 | hbox.show() | 101 | hbox.show() |
97 | vbox.pack_end(hbox, True, True, 6) | 102 | vbox.pack_end(hbox, True, True, 6) |
98 | self.label = gtk.Label() | 103 | self.label = gtk.Label() |
104 | # We want to match the colours of the normal tooltips, as dictated by | ||
105 | # the users gtk+-2.0 theme, wherever possible - on some systems this | ||
106 | # requires explicitly setting a fg_color for the label which matches the | ||
107 | # tooltip_fg_color | ||
108 | settings = gtk.settings_get_default() | ||
109 | colours = settings.get_property('gtk-color-scheme').split('\n') | ||
110 | # remove any empty lines, there's likely to be a trailing one after | ||
111 | # calling split on a dictionary-like string | ||
112 | colours = filter(None, colours) | ||
113 | for col in colours: | ||
114 | item, val = col.split(': ') | ||
115 | if item == 'tooltip_fg_color': | ||
116 | style = self.label.get_style() | ||
117 | style.fg[gtk.STATE_NORMAL] = gtk.gdk.color_parse(val) | ||
118 | self.label.set_style(style) | ||
119 | break # we only care for the tooltip_fg_color | ||
99 | self.label.set_markup(markup) | 120 | self.label.set_markup(markup) |
100 | self.label.show() | 121 | self.label.show() |
101 | hbox.pack_end(self.label, True, True, 6) | 122 | hbox.pack_end(self.label, True, True, 6) |
102 | 123 | ||
103 | self.connect("key-press-event", self._catch_esc_cb) | 124 | self.connect("key-press-event", self._catch_esc_cb) |
104 | 125 | ||
105 | # Inherit the system theme for a tooltip | ||
106 | style = gtk.rc_get_style_by_paths(gtk.settings_get_default(), | ||
107 | 'gtk-tooltip', 'gtk-tooltip', gobject.TYPE_NONE) | ||
108 | self.set_style(style) | ||
109 | |||
110 | self.add(vbox) | 126 | self.add(vbox) |
111 | 127 | ||
112 | """ | 128 | """ |