diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/persistenttooltip.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/persistenttooltip.py b/bitbake/lib/bb/ui/crumbs/persistenttooltip.py index 0167363380..bae697e0d7 100644 --- a/bitbake/lib/bb/ui/crumbs/persistenttooltip.py +++ b/bitbake/lib/bb/ui/crumbs/persistenttooltip.py | |||
@@ -20,6 +20,10 @@ | |||
20 | 20 | ||
21 | import gobject | 21 | import gobject |
22 | import gtk | 22 | import gtk |
23 | try: | ||
24 | import gconf | ||
25 | except: | ||
26 | pass | ||
23 | 27 | ||
24 | class PersistentTooltip(gtk.Window): | 28 | class PersistentTooltip(gtk.Window): |
25 | """ | 29 | """ |
@@ -34,6 +38,21 @@ class PersistentTooltip(gtk.Window): | |||
34 | def __init__(self, markup): | 38 | def __init__(self, markup): |
35 | gtk.Window.__init__(self, gtk.WINDOW_POPUP) | 39 | gtk.Window.__init__(self, gtk.WINDOW_POPUP) |
36 | 40 | ||
41 | # 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 | ||
43 | # the metacity gconf key to determine whether the close button is on the | ||
44 | # left or the right. | ||
45 | # In the case that we can't determine the users configuration we default | ||
46 | # to close buttons being on the right. | ||
47 | __button_right = True | ||
48 | try: | ||
49 | client = gconf.client_get_default() | ||
50 | order = client.get_string("/apps/metacity/general/button_layout") | ||
51 | if order and order.endswith(":"): | ||
52 | __button_right = False | ||
53 | except NameError: | ||
54 | pass | ||
55 | |||
37 | # We need to ensure we're only shown once | 56 | # We need to ensure we're only shown once |
38 | self.shown = False | 57 | self.shown = False |
39 | 58 | ||
@@ -65,7 +84,10 @@ class PersistentTooltip(gtk.Window): | |||
65 | self.button.set_can_default(True) | 84 | self.button.set_can_default(True) |
66 | self.button.grab_focus() | 85 | self.button.grab_focus() |
67 | self.button.show() | 86 | self.button.show() |
68 | hbox.pack_end(self.button, False, False, 0) | 87 | if __button_right: |
88 | hbox.pack_end(self.button, False, False, 0) | ||
89 | else: | ||
90 | hbox.pack_start(self.button, False, False, 0) | ||
69 | 91 | ||
70 | self.set_default(self.button) | 92 | self.set_default(self.button) |
71 | 93 | ||