diff options
author | Joshua Lock <josh@linux.intel.com> | 2012-03-22 16:00:29 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-23 16:10:23 +0000 |
commit | bad0a86f98dd0398fcd58eb7e07f2c0292526d7d (patch) | |
tree | bb5335644417c51c100dcd01b96803cb2c3fc6f3 /bitbake | |
parent | d4a087fd39d034f8b5e4c5bc59b64d74c3442dbc (diff) | |
download | poky-bad0a86f98dd0398fcd58eb7e07f2c0292526d7d.tar.gz |
lib/bb/ui/crumbs/hig: tweak 'Add Layer' button per visual design
Use a separate, pre-lit, icon when the button has the cursor over it.
(Bitbake rev: 535d23921dfb7310022099d39b1092edfee51c1a)
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py index 652226c13f..1db93eac17 100644 --- a/bitbake/lib/bb/ui/crumbs/hig.py +++ b/bitbake/lib/bb/ui/crumbs/hig.py | |||
@@ -28,7 +28,7 @@ import re | |||
28 | import subprocess | 28 | import subprocess |
29 | import shlex | 29 | import shlex |
30 | from bb.ui.crumbs.hobcolor import HobColors | 30 | from bb.ui.crumbs.hobcolor import HobColors |
31 | from bb.ui.crumbs.hobwidget import hcc, hic, HobViewTable, HobInfoButton, HobAltButton | 31 | from bb.ui.crumbs.hobwidget import hcc, hic, HobViewTable, HobInfoButton |
32 | from bb.ui.crumbs.progressbar import HobProgressBar | 32 | from bb.ui.crumbs.progressbar import HobProgressBar |
33 | 33 | ||
34 | """ | 34 | """ |
@@ -815,23 +815,22 @@ class LayerSelectionDialog (CrumbsDialog): | |||
815 | col1.pack_start(cell1, True) | 815 | col1.pack_start(cell1, True) |
816 | col1.set_cell_data_func(cell1, self.draw_delete_button_cb, layer_tv) | 816 | col1.set_cell_data_func(cell1, self.draw_delete_button_cb, layer_tv) |
817 | 817 | ||
818 | add_button = HobAltButton() | 818 | add_button = gtk.Button() |
819 | add_button.set_relief(gtk.RELIEF_NONE) | ||
819 | box = gtk.HBox(False, 6) | 820 | box = gtk.HBox(False, 6) |
820 | box.show() | 821 | box.show() |
821 | add_button.add(box) | 822 | add_button.add(box) |
822 | im = gtk.Image() | 823 | add_button.connect("enter-notify-event", self.add_hover_cb) |
823 | im.set_from_file(hic.ICON_INDI_ADD) | 824 | add_button.connect("leave-notify-event", self.add_leave_cb) |
824 | im.show() | 825 | self.im = gtk.Image() |
825 | box.pack_start(im, expand=False, fill=False, padding=6) | 826 | self.im.set_from_file(hic.ICON_INDI_ADD_FILE) |
827 | self.im.show() | ||
828 | box.pack_start(self.im, expand=False, fill=False, padding=6) | ||
826 | lbl = gtk.Label("Add layer") | 829 | lbl = gtk.Label("Add layer") |
827 | lbl.set_alignment(0.0, 0.5) | 830 | lbl.set_alignment(0.0, 0.5) |
828 | lbl.show() | 831 | lbl.show() |
829 | box.pack_start(lbl, expand=True, fill=True, padding=6) | 832 | box.pack_start(lbl, expand=True, fill=True, padding=6) |
830 | add_button.connect("clicked", self.layer_widget_add_clicked_cb, layer_store, window) | 833 | add_button.connect("clicked", self.layer_widget_add_clicked_cb, layer_store, window) |
831 | add_button.set_can_default(True) | ||
832 | add_button.grab_default() | ||
833 | add_button.set_can_focus(True) | ||
834 | add_button.grab_focus() | ||
835 | table_layer.attach(add_button, 0, 10, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 6) | 834 | table_layer.attach(add_button, 0, 10, 1, 2, gtk.EXPAND | gtk.FILL, 0, 0, 6) |
836 | layer_tv.set_model(layer_store) | 835 | layer_tv.set_model(layer_store) |
837 | 836 | ||
@@ -839,6 +838,12 @@ class LayerSelectionDialog (CrumbsDialog): | |||
839 | 838 | ||
840 | return hbox, layer_store | 839 | return hbox, layer_store |
841 | 840 | ||
841 | def add_hover_cb(self, button, event): | ||
842 | self.im.set_from_file(hic.ICON_INDI_ADD_HOVER_FILE) | ||
843 | |||
844 | def add_leave_cb(self, button, event): | ||
845 | self.im.set_from_file(hic.ICON_INDI_ADD_FILE) | ||
846 | |||
842 | def __init__(self, title, layers, all_layers, parent, flags, buttons): | 847 | def __init__(self, title, layers, all_layers, parent, flags, buttons): |
843 | super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons) | 848 | super(LayerSelectionDialog, self).__init__(title, parent, flags, buttons) |
844 | 849 | ||
@@ -849,7 +854,7 @@ class LayerSelectionDialog (CrumbsDialog): | |||
849 | 854 | ||
850 | # icon for remove button in TreeView | 855 | # icon for remove button in TreeView |
851 | im = gtk.Image() | 856 | im = gtk.Image() |
852 | im.set_from_file(hic.ICON_INDI_REMOVE) | 857 | im.set_from_file(hic.ICON_INDI_REMOVE_FILE) |
853 | self.rem_icon = im.get_pixbuf() | 858 | self.rem_icon = im.get_pixbuf() |
854 | 859 | ||
855 | # class members for internal use | 860 | # class members for internal use |