Hob GUI add persistent tooltips and use custom info icon consistently
cover Hob GUI add persistent tooltips and use custom info icon consistently
asldlasjd
The following changes since commit 4a480a052f450c4ee061ab0e60a495a45f140cf9:
stderr would previously be appended to stdout, corrupting the result when something was outputed to stderr but exit code was still 0 (non-fatal warning messages). This commit makes the code parse only stdout, but output stderr if an error happened. (2012-03-02 16:17:43 +0000)
are available in the git repository at:
git://github.com/incandescant/bitbake josh/hob
https://github.com/incandescant/bitbake/tree/josh/hob
and as a poky repository at:
git://git.yoctoproject.org/poky-contrib josh/hob
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=josh/hob
Joshua Lock (6):
crumbs/persistenttooltip: a new Gtk+ widget for use in Hob ui/icons: crop the info icons
ui/crumbs/hobwidget: implement HobInfoButton per Hob interaction
design
ui/crumbs/imageconfigurationpage: make use of the HobInfoButton ui/crumbs/hig: use HobInfoButton in place of gtk.Image with tooltip ui/crumbs/hig: special case stock info icons in CrumbsMesssageDialog
lib/bb/ui/crumbs/hig.py | 52 +++++------- lib/bb/ui/crumbs/hobwidget.py | 49 +++++++++++ lib/bb/ui/crumbs/imageconfigurationpage.py | 12 +-- lib/bb/ui/crumbs/persistenttooltip.py | 127 ++++++++++++++++++++++++++++ lib/bb/ui/icons/info/info_display.png | Bin 4760 -> 4558 bytes lib/bb/ui/icons/info/info_hover.png | Bin 4847 -> 4650 bytes 6 files changed, 200 insertions(+), 40 deletions(-) create mode 100644 lib/bb/ui/crumbs/persistenttooltip.py
Signature · 1 line
1.7.7.6
PATCH 1/6 crumbs/persistenttooltip: a new Gtk+ widget for use in Hob
The Hob interaction design calls for a top level widget which shows a persistent tooltip. This tooltip will not disappear until the user explicitly closes it.
This allows us to provide clickable hyperlinks, longer instructions and deeper information in the tooltips.
Note: by design the tooltip should dismiss when the user clicks off it, this implementation does include that functionality. It's a to do item.
--- lib/bb/ui/crumbs/persistenttooltip.py | 127 +++++++++++++++++++++++++++++++++ 1 files changed, 127 insertions(+), 0 deletions(-) create mode 100644 lib/bb/ui/crumbs/persistenttooltip.py
lib/bb/ui/crumbs/persistenttooltip.py new file +127 -0
@@ -0,0 +1,127 @@ +# +# BitBake Graphical GTK User Interface +# +# Copyright (C) 2012 Intel Corporation +# +# Authored by Joshua Lock <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import gobject +import gtk + +class PersistentTooltip(gtk.Window): + """ + A tooltip which persists once shown until the user dismisses it with the Esc + key or by clicking the close button. + + # FIXME: the PersistentTooltip should be disabled when the user clicks anywhere off + # it. We can't do this with focus-out-event becuase modal ensures we have focus? + + markup: some Pango text markup to display in the tooltip + """ + def __init__(self, markup): + gtk.Window.__init__(self, gtk.WINDOW_POPUP) + + # We need to ensure we're only shown once + self.shown = False + + # We don't want any WM decorations + self.set_decorated(False) + # We don't want to show in the taskbar or window switcher + self.set_skip_pager_hint(True) + self.set_skip_taskbar_hint(True) + # We must be modal to ensure we grab focus when presented from a gtk.Dialog + self.set_modal(True) + + self.set_border_width(6) + self.set_position(gtk.WIN_POS_MOUSE) + self.set_opacity(0.95) + + # Draw our label and close buttons + hbox = gtk.HBox(False, 0) + hbox.show() + vbox = gtk.VBox(False, 0) + vbox.show() + vbox.pack_start(hbox, True, True, 0) + + img = gtk.Image() + img.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_BUTTON) + + self.button = gtk.Button() + self.button.set_image(img) + self.button.connect("clicked", self._dismiss_cb) + self.button.set_can_default(True) + self.button.grab_focus() + self.button.show() + hbox.pack_end(self.button, False, False, 0) + + self.set_default(self.button) + + self.label = gtk.Label() + self.label.set_markup(markup) + self.label.show() + vbox.pack_end(self.label, True, True, 6) + + self.connect("key-press-event", self._catch_esc_cb) + + # Inherit the system theme for a tooltip + style = gtk.rc_get_style_by_paths(gtk.settings_get_default(), + 'gtk-tooltip', 'gtk-tooltip', gobject.TYPE_NONE) + self.set_style(style) + + self.add(vbox) + + """ + Modify the displayed message once the PersistentTooltip has been created. + + markup: the Pango Markup of the new message + """ + def set_tooltip(self, markup): + self.label.set_markup(markup) + + + """ + Callback when the PersistentTooltip's close button is clicked. + Hides the PersistentTooltip. + """ + def _dismiss_cb(self, button): + self.hide() + return True + + """ + Callback when the Esc key is detected. Hides the PersistentTooltip. + """ + def _catch_esc_cb(self, widget, event): + keyname = gtk.gdk.keyval_name(event.keyval) + if keyname == "Escape": + self.hide() + return True + + """ + Called to present the PersistentTooltip. + Overrides the superclasses show() method to include state tracking. + """ + def show(self): + if not self.shown: + self.shown = True + gtk.Window.show(self) + + """ + Called to hide the PersistentTooltip. + Overrides the superclasses hide() method to include state tracking. + """ + def hide(self): + self.shown = False + gtk.Window.hide(self)
Signature · 1 line
1.7.7.6
PATCH 2/6 ui/icons: crop the info icons
In reply to Joshua LockThe info icons include large, transparent borders. Crop this out so that we can use the icon without using too much space in the GUI.
--- lib/bb/ui/icons/info/info_display.png | Bin 4760 -> 4558 bytes lib/bb/ui/icons/info/info_hover.png | Bin 4847 -> 4650 bytes 2 files changed, 0 insertions(+), 0 deletions(-)
lib/bb/ui/icons/info/info_display.png binary +0 -0
lib/bb/ui/icons/info/info_hover.png binary +0 -0
Signature · 1 line
1.7.7.6
PATCH 3/6 ui/crumbs/hobwidget: implement HobInfoButton per Hob interaction design
In reply to Joshua LockThis button-like widget will display a persistent tooltip with the supplied Pango Markup when it is clicked by the user. This widget features prominently in the interaction design to offer help in a more prominent manner.
--- lib/bb/ui/crumbs/hobwidget.py | 49 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/hobwidget.py +49 -0
@@ -23,6 +23,7 @@ import gobject import os import os.path from bb.ui.crumbs.hobcolor import HobColors +from bb.ui.crumbs.persistenttooltip import PersistentTooltip class hwc:
@@ -311,3 +312,51 @@ class HobXpmLabelButtonBox(gtk.EventBox): """ Hide items - first time """ pass +class HobInfoButton(gtk.EventBox): + """ + This class implements a button-like widget per the Hob visual and UX designs + which will display a persistent tooltip, with the contents of tip_markup, when + clicked. + + tip_markup: the Pango Markup to be displayed in the persistent tooltip + """ + def __init__(self, tip_markup, parent=None): + gtk.EventBox.__init__(self) + self.image = gtk.Image() + self.image.set_from_file(hic.ICON_INFO_DISPLAY_FILE) + self.image.show() + self.add(self.image) + + self.set_events(gtk.gdk.BUTTON_RELEASE | + gtk.gdk.ENTER_NOTIFY_MASK | + gtk.gdk.LEAVE_NOTIFY_MASK) + + self.ptip = PersistentTooltip(tip_markup) + + if parent: + self.ptip.set_parent(parent) + self.ptip.set_transient_for(parent) + self.ptip.set_destroy_with_parent(True) + + self.connect("button-release-event", self.button_release_cb) + self.connect("enter-notify-event", self.mouse_in_cb) + self.connect("leave-notify-event", self.mouse_out_cb) + + """ + When the mouse click is released emulate a button-click and show the associated + PersistentTooltip + """ + def button_release_cb(self, widget, event): + self.ptip.show() + + """ + Change to the prelight image when the mouse enters the widget + """ + def mouse_in_cb(self, widget, event): + self.image.set_from_file(hic.ICON_INFO_HOVER_FILE) + + """ + Change to the stock image when the mouse enters the widget + """ + def mouse_out_cb(self, widget, event): + self.image.set_from_file(hic.ICON_INFO_DISPLAY_FILE)
Signature · 1 line
1.7.7.6
PATCH 4/6 ui/crumbs/imageconfigurationpage: make use of the HobInfoButton
In reply to Joshua LockUse the new HobInfoButton widget in place of the existing gtk.Image with tooltip.
Modify the markup of the tooltip so that the link to the reference manual is a clickable hyperlink.
--- lib/bb/ui/crumbs/imageconfigurationpage.py | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-)
lib/bb/ui/crumbs/imageconfigurationpage.py +4 -8
@@ -24,7 +24,7 @@ import gtk import glib from bb.ui.crumbs.progressbar import HobProgressBar from bb.ui.crumbs.hobcolor import HobColors -from bb.ui.crumbs.hobwidget import hic, HobXpmLabelButtonBox +from bb.ui.crumbs.hobwidget import hic, HobXpmLabelButtonBox, HobInfoButton from bb.ui.crumbs.hoblistmodel import RecipeListModel from bb.ui.crumbs.hobpages import HobPage
@@ -137,16 +137,12 @@ class ImageConfigurationPage (HobPage): "Layers", "Add support for machines, software, etc") self.layer_button.connect("button-release-event", self.layer_button_clicked_cb) - icon_file = hic.ICON_INFO_DISPLAY_FILE - self.layer_info_icon = gtk.Image() - pix_buffer = gtk.gdk.pixbuf_new_from_file(icon_file) - self.layer_info_icon.set_from_pixbuf(pix_buffer) markup = "Layers are a powerful mechanism to extend the Yocto Project " markup += "with your own functionality.\n" - markup += "For more on layers, check:\n" + markup += "For more on layers, check the <a href=\"" markup += "http://www.yoctoproject.org/docs/current/poky-ref-manual/" - markup += "poky-ref-manual.html#usingpoky-changes-layers." - self.layer_info_icon.set_tooltip_markup(markup) + markup += "poky-ref-manual.html#usingpoky-changes-layers\">reference manual</a>." + self.layer_info_icon = HobInfoButton(markup, self.get_parent()) self.progress_bar = HobProgressBar() self.machine_separator = gtk.HSeparator()
Signature · 1 line
1.7.7.6
PATCH 5/6 ui/crumbs/hig: use HobInfoButton in place of gtk.Image with tooltip
In reply to Joshua LockReplace all instances of the stock info icon with an attached tooltip with the new HobInfoButton with associated PersistentTooltip.
--- lib/bb/ui/crumbs/hig.py | 46 +++++++++++++++------------------------------- 1 files changed, 15 insertions(+), 31 deletions(-)
lib/bb/ui/crumbs/hig.py +15 -31
@@ -28,7 +28,7 @@ import re import subprocess import shlex from bb.ui.crumbs.hobcolor import HobColors -from bb.ui.crumbs.hobwidget import hcc, HobViewTable +from bb.ui.crumbs.hobwidget import hcc, hic, HobViewTable, HobInfoButton from bb.ui.crumbs.progressbar import HobProgressBar """
@@ -130,10 +130,8 @@ class AdvancedSettingDialog (CrumbsDialog): spinner.set_value(content) hbox.pack_start(spinner, expand=False, fill=False) - image = gtk.Image() - image.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_BUTTON) - image.set_tooltip_text(tooltip) - hbox.pack_start(image, expand=False, fill=False) + info = HobInfoButton(tooltip, self) + hbox.pack_start(info, expand=False, fill=False) hbox.show_all() return hbox, spinner
@@ -150,11 +148,8 @@ class AdvancedSettingDialog (CrumbsDialog): combo.set_active(index) index += 1 - image = gtk.Image() - image.show() - image.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_BUTTON) - image.set_tooltip_text(tooltip) - hbox.pack_start(image, expand=False, fill=False) + info = HobInfoButton(tooltip, self) + hbox.pack_start(info, expand=False, fill=False) hbox.show_all() return hbox, combo
@@ -189,10 +184,8 @@ class AdvancedSettingDialog (CrumbsDialog): open_button.connect("clicked", self.entry_widget_select_path_cb, parent, entry) table.attach(open_button, 9, 10, 0, 1) - image = gtk.Image() - image.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_BUTTON) - image.set_tooltip_text(tooltip) - hbox.pack_start(image, expand=False, fill=False) + info = HobInfoButton(tooltip, self) + hbox.pack_start(info, expand=False, fill=False) hbox.show_all() return hbox, entry
@@ -331,10 +324,8 @@ class AdvancedSettingDialog (CrumbsDialog): vbox.pack_start(down, False, False, 5) tree_selection.connect("changed", self.pkgfmt_widget_tree_selection_changed_cb, up, down) - image = gtk.Image() - image.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_BUTTON) - image.set_tooltip_text(tooltip) - pkgfmt_hbox.pack_start(image, expand=False, fill=False) + info = HobInfoButton(tooltip, self) + pkgfmt_hbox.pack_start(info, expand=False, fill=False) pkgfmt_hbox.show_all()
@@ -419,10 +410,8 @@ class AdvancedSettingDialog (CrumbsDialog): button.connect("clicked", self.editable_settings_remove_item_clicked, setting_tree) hbox.pack_start(button) - image = gtk.Image() - image.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_BUTTON) - image.set_tooltip_text(tooltip) - setting_hbox.pack_start(image, expand=False, fill=False) + info = HobInfoButton(tooltip, self) + setting_hbox.pack_start(info, expand=False, fill=False) return setting_hbox, setting_store
@@ -489,13 +478,10 @@ class AdvancedSettingDialog (CrumbsDialog): advanced_vbox.pack_start(table, expand=False, fill=False) tooltip = "Select image file system types that will be used." - image = gtk.Image() - image.show() - image.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_BUTTON) - image.set_tooltip_text(tooltip) + info = HobInfoButton(tooltip, self) label = self.gen_label_widget("<span weight=\"bold\">Select image types:</span>") table.attach(label, 0, 9, 0, 1) - table.attach(image, 9, 10, 0, 1) + table.attach(info, 9, 10, 0, 1) i = 1 j = 1
@@ -953,10 +939,8 @@ class LayerSelectionDialog (CrumbsDialog): hbox_top.pack_start(label, expand=False, fill=False) tooltip = "Layer is a collection of bb files and conf files" - image = gtk.Image() - image.set_from_stock(gtk.STOCK_INFO, gtk.ICON_SIZE_BUTTON) - image.set_tooltip_text(tooltip) - hbox_top.pack_end(image, expand=False, fill=False) + info = HobInfoButton(tooltip, self) + hbox_top.pack_end(info, expand=False, fill=False) layer_widget, self.layer_store = self.gen_layer_widget(self.split_model, self.layers, self.all_layers, self, None) layer_widget.set_size_request(-1, 180)
Signature · 1 line
1.7.7.6
PATCH 6/6 ui/crumbs/hig: special case stock info icons in CrumbsMesssageDialog
In reply to Joshua LockThe Hob visual design includes an info icon which should be used consistently throught the GUI. This change detects use of the stock info icon in CrumbsMessageDialog and uses the Hob info icon instead.
--- lib/bb/ui/crumbs/hig.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/hig.py +5 -1
@@ -74,7 +74,11 @@ class CrumbsMessageDialog(CrumbsDialog): self.vbox.add(first_row) self.icon = gtk.Image() - self.icon.set_from_stock(icon, gtk.ICON_SIZE_DIALOG) + # We have our own Info icon which should be used in preference of the stock icon + if icon == gtk.STOCK_INFO or icon == "gtk-dialog-info": + self.icon.set_from_file(hic.ICON_INFO_DISPLAY_FILE) + else: + self.icon.set_from_stock(icon, gtk.ICON_SIZE_DIALOG) self.icon.set_property("yalign", 0.00) self.icon.show() first_row.add(self.icon)
Signature · 1 line
1.7.7.6
Whoops. Forgot to hit save in my editor before sending... The message should be:
The following series addresses some issues I've raised with the Hob implementation.
Firstly it introduces two new widgets, a generic PersistentTooltip widget which is an implementation of a tooltip like widget that persists until the user explicitly dismisses it, this matches the Hob interaction design more closely. The second widget is a button-like widget using the info icon from the visual design which, when clicked, will display a persistent tooltip.
The series then replaces all known instances of a gtk.Image containing the stock info item plus a standard tooltip with the new HobInfoButton.
The final patch, to ensure consistency, special cases the stock info icon in the CrumbsMesssageDialog so that any dialogues which show an info icon will display the custom icon per the visual design.
I've attached a few screenshots showing the PersistentTooltip and HobInfoButton's in use.
Cheers,
Joshua
Quoted 31 lines · Joshua Lock
The following changes since commit
4a480a052f450c4ee061ab0e60a495a45f140cf9:stderr would previously be appended to stdout, corrupting the result when something was outputed to stderr but exit code was still 0 (non-fatal warning messages). This commit makes the code parse only stdout, but output stderr if an error happened. (2012-03-02 16:17:43 +0000)
are available in the git repository at:
git://github.com/incandescant/bitbakejosh/hob
https://github.com/incandescant/bitbake/tree/josh/hoband as a poky repository at:
git://git.yoctoproject.org/poky-contribjosh/hob
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=josh/hobJoshua Lock (6):
crumbs/persistenttooltip: a new Gtk+ widget for use in Hob ui/icons: crop the info icons
ui/crumbs/hobwidget: implement HobInfoButton per Hob interaction
design
ui/crumbs/imageconfigurationpage: make use of the HobInfoButton ui/crumbs/hig: use HobInfoButton in place of gtk.Image with tooltip ui/crumbs/hig: special case stock info icons in CrumbsMesssageDialoglib/bb/ui/crumbs/hig.py | 52 +++++------- lib/bb/ui/crumbs/hobwidget.py | 49 +++++++++++ lib/bb/ui/crumbs/imageconfigurationpage.py | 12 +-- lib/bb/ui/crumbs/persistenttooltip.py | 127 ++++++++++++++++++++++++++++ lib/bb/ui/icons/info/info_display.png | Bin 4760 -> 4558 bytes lib/bb/ui/icons/info/info_hover.png | Bin 4847 -> 4650 bytes 6 files changed, 200 insertions(+), 40 deletions(-)create mode 100644
lib/bb/ui/crumbs/persistenttooltip.py
Signature · 3 lines
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology CentreWhoops. Forgot to hit save in my editor before sending... The message should be:
The following series addresses some issues I've raised with the Hob implementation.
Firstly it introduces two new widgets, a generic PersistentTooltip widget which is an implementation of a tooltip like widget that persists until the user explicitly dismisses it, this matches the Hob interaction design more closely. The second widget is a button-like widget using the info icon from the visual design which, when clicked, will display a persistent tooltip.
The series then replaces all known instances of a gtk.Image containing the stock info item plus a standard tooltip with the new HobInfoButton.
The final patch, to ensure consistency, special cases the stock info icon in the CrumbsMesssageDialog so that any dialogues which show an info icon will display the custom icon per the visual design.
Cheers,
Joshua
Note: this is attempt two at sending this follow on, attempt one is stuck awaiting moderation as I tried to include screenshots....
Quoted 32 lines · Joshua Lock
asldlasjd
The following changes since commit
4a480a052f450c4ee061ab0e60a495a45f140cf9:stderr would previously be appended to stdout, corrupting the result when something was outputed to stderr but exit code was still 0 (non-fatal warning messages). This commit makes the code parse only stdout, but output stderr if an error happened. (2012-03-02 16:17:43 +0000)
are available in the git repository at:
git://github.com/incandescant/bitbakejosh/hob
https://github.com/incandescant/bitbake/tree/josh/hoband as a poky repository at:
git://git.yoctoproject.org/poky-contribjosh/hob
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=josh/hobJoshua Lock (6):
crumbs/persistenttooltip: a new Gtk+ widget for use in Hob ui/icons: crop the info icons
ui/crumbs/hobwidget: implement HobInfoButton per Hob interaction
design
ui/crumbs/imageconfigurationpage: make use of the HobInfoButton ui/crumbs/hig: use HobInfoButton in place of gtk.Image with tooltip ui/crumbs/hig: special case stock info icons in CrumbsMesssageDialoglib/bb/ui/crumbs/hig.py | 52 +++++------- lib/bb/ui/crumbs/hobwidget.py | 49 +++++++++++ lib/bb/ui/crumbs/imageconfigurationpage.py | 12 +-- lib/bb/ui/crumbs/persistenttooltip.py | 127 ++++++++++++++++++++++++++++ lib/bb/ui/icons/info/info_display.png | Bin 4760 -> 4558 bytes lib/bb/ui/icons/info/info_hover.png | Bin 4847 -> 4650 bytes 6 files changed, 200 insertions(+), 40 deletions(-)create mode 100644
lib/bb/ui/crumbs/persistenttooltip.py
Signature · 3 lines
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology CentreRe: [PATCH 1/6] crumbs/persistenttooltip: a new Gtk+ widget for use in Hob
In reply to Joshua LockACK the rest except one comment below.
--
Shane
Quoted 125 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Joshua Lock
Sent: Friday, March 02, 2012 4:39 PM
To: [email protected]
Subject: [bitbake-devel] [PATCH 1/6] crumbs/persistenttooltip: a new Gtk+ widget for use in HobThe Hob interaction design calls for a top level widget which shows a persistent tooltip. This tooltip will not disappear until the user explicitly closes it.
This allows us to provide clickable hyperlinks, longer instructions and deeper information in the tooltips.
Note: by design the tooltip should dismiss when the user clicks off it, this implementation does include that functionality. It's a to do item.
Signed-off-by Joshua Lock <[email protected]>--- lib/bb/ui/crumbs/persistenttooltip.py | 127 +++++++++++++++++++++++++++++++++ 1 files changed, 127 insertions(+), 0 deletions(-) create mode 100644 lib/bb/ui/crumbs/persistenttooltip.pylib/bb/ui/crumbs/persistenttooltip.py new file +26
-0@@ -0,0 +1,127 @@ +# +# BitBake Graphical GTK User Interface +# +# Copyright (C) 2012 Intel Corporation +# +# Authored by Joshua Lock <[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import gobject +import gtk + +class PersistentTooltip(gtk.Window): + """ + A tooltip which persists once shown until the user dismisses it with theEsc
lib/bb/ui/crumbs/persistenttooltip.py new file +3
-0+ key or by clicking the close button. + + # FIXME: the PersistentTooltip should be disabled when the user clicksanywhere off
lib/bb/ui/crumbs/persistenttooltip.py new file +1
-0+ # it. We can't do this with focus-out-event becuase modal ensures wehave focus?
lib/bb/ui/crumbs/persistenttooltip.py new file +15
-0+ + markup: some Pango text markup to display in the tooltip + """ + def __init__(self, markup): + gtk.Window.__init__(self, gtk.WINDOW_POPUP) + + # We need to ensure we're only shown once + self.shown = False + + # We don't want any WM decorations + self.set_decorated(False) + # We don't want to show in the taskbar or window switcher + self.set_skip_pager_hint(True) + self.set_skip_taskbar_hint(True) + # We must be modal to ensure we grab focus when presented froma gtk.Dialog
lib/bb/ui/crumbs/persistenttooltip.py new file +42
-0+ self.set_modal(True) + + self.set_border_width(6) + self.set_position(gtk.WIN_POS_MOUSE) + self.set_opacity(0.95) + + # Draw our label and close buttons + hbox = gtk.HBox(False, 0) + hbox.show() + vbox = gtk.VBox(False, 0) + vbox.show() + vbox.pack_start(hbox, True, True, 0) + + img = gtk.Image() + img.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_BUTTON) + + self.button = gtk.Button() + self.button.set_image(img) + self.button.connect("clicked", self._dismiss_cb) + self.button.set_can_default(True) + self.button.grab_focus() + self.button.show() + hbox.pack_end(self.button, False, False, 0) + + self.set_default(self.button) + + self.label = gtk.Label() + self.label.set_markup(markup) + self.label.show() + vbox.pack_end(self.label, True, True, 6) + + self.connect("key-press-event", self._catch_esc_cb) + + # Inherit the system theme for a tooltip + style = gtk.rc_get_style_by_paths(gtk.settings_get_default(), + 'gtk-tooltip', 'gtk-tooltip', gobject.TYPE_NONE) + self.set_style(style) + + self.add(vbox) + + """ + Modify the displayed message once the PersistentTooltip has beencreated.
lib/bb/ui/crumbs/persistenttooltip.py line 92
Quoted 5 lines
lib/bb/ui/crumbs/persistenttooltip.py new file +5
-0+ + markup: the Pango Markup of the new message + """ + def set_tooltip(self, markup): + self.label.set_markup(markup)
I haven't seen this is used. Can we remove it?
Quoted 43 lines
lib/bb/ui/crumbs/persistenttooltip.py new file +35
-1+ + + """ + Callback when the PersistentTooltip's close button is clicked. + Hides the PersistentTooltip. + """ + def _dismiss_cb(self, button): + self.hide() + return True + + """ + Callback when the Esc key is detected. Hides the PersistentTooltip. + """ + def _catch_esc_cb(self, widget, event): + keyname = gtk.gdk.keyval_name(event.keyval) + if keyname == "Escape": + self.hide() + return True + + """ + Called to present the PersistentTooltip. + Overrides the superclasses show() method to include state tracking. + """ + def show(self): + if not self.shown: + self.shown = True + gtk.Window.show(self) + + """ + Called to hide the PersistentTooltip. + Overrides the superclasses hide() method to include state tracking. + """ + def hide(self): + self.shown = False + gtk.Window.hide(self) --1.7.7.6
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
Re: [PATCH 3/6] ui/crumbs/hobwidget: implement HobInfoButton per Hob interaction design
In reply to Joshua LockJoshua Lock wrote on 2012-03-02:
Quoted 6 lines
This button-like widget will display a persistent tooltip with the supplied Pango Markup when it is clicked by the user. This widget features prominently in the interaction design to offer help in a more prominent manner.
Signed-off-by Joshua Lock <[email protected]>
ACK.
--
Shane
Re: [PATCH 4/6] ui/crumbs/imageconfigurationpage: make use of the HobInfoButton
In reply to Joshua LockJoshua Lock wrote on 2012-03-02:
Quoted 7 lines
Use the new HobInfoButton widget in place of the existing gtk.Image with tooltip.
Modify the markup of the tooltip so that the link to the reference manual is a clickable hyperlink.
Signed-off-by Joshua Lock <[email protected]>
ACK
--
Shane
Re: [PATCH 5/6] ui/crumbs/hig: use HobInfoButton in place of gtk.Image with tooltip
In reply to Joshua LockJoshua Lock wrote on 2012-03-02:
Quoted 4 lines
Replace all instances of the stock info icon with an attached tooltip with the new HobInfoButton with associated PersistentTooltip.
Signed-off-by Joshua Lock <[email protected]>
ACK.
--
Shane
Re: [PATCH 6/6] ui/crumbs/hig: special case stock info icons in CrumbsMesssageDialog
In reply to Joshua LockJoshua Lock wrote on 2012-03-02:
Quoted 5 lines
The Hob visual design includes an info icon which should be used consistently throught the GUI. This change detects use of the stock info icon in CrumbsMessageDialog and uses the Hob info icon instead.
Signed-off-by Joshua Lock <[email protected]>
ACK
--
Shane
Re: [PATCH 1/6] crumbs/persistenttooltip: a new Gtk+ widget for use in Hob
In reply to Wang, ShaneQuoted 128 lines · Shane
ACK the rest except one comment below.
--
ShaneQuoted 123 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Joshua Lock
Sent: Friday, March 02, 2012 4:39 PM
To: [email protected]
Subject: [bitbake-devel] [PATCH 1/6] crumbs/persistenttooltip: a new Gtk+ widget for use in HobThe Hob interaction design calls for a top level widget which shows a persistent tooltip. This tooltip will not disappear until the user explicitly closes it.
This allows us to provide clickable hyperlinks, longer instructions and deeper information in the tooltips.
Note: by design the tooltip should dismiss when the user clicks off it, this implementation does include that functionality. It's a to do item.
Signed-off-by Joshua Lock<[email protected]>--- lib/bb/ui/crumbs/persistenttooltip.py | 127 +++++++++++++++++++++++++++++++++ 1 files changed, 127 insertions(+), 0 deletions(-)create mode 100644
lib/bb/ui/crumbs/persistenttooltip.pylib/bb/ui/crumbs/persistenttooltip.py new file +26
-0@@ -0,0 +1,127 @@ +# +# BitBake Graphical GTK User Interface +# +# Copyright (C) 2012 Intel Corporation +# +# Authored by Joshua Lock<[email protected]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import gobject +import gtk + +class PersistentTooltip(gtk.Window): + """ + A tooltip which persists once shown until the user dismisses it with theEsc
lib/bb/ui/crumbs/persistenttooltip.py new file +3
-0+ key or by clicking the close button. + + # FIXME: the PersistentTooltip should be disabled when the user clicksanywhere off
lib/bb/ui/crumbs/persistenttooltip.py new file +1
-0+ # it. We can't do this with focus-out-event becuase modal ensures wehave focus?
lib/bb/ui/crumbs/persistenttooltip.py new file +15
-0+ + markup: some Pango text markup to display in the tooltip + """ + def __init__(self, markup): + gtk.Window.__init__(self, gtk.WINDOW_POPUP) + + # We need to ensure we're only shown once + self.shown = False + + # We don't want any WM decorations + self.set_decorated(False) + # We don't want to show in the taskbar or window switcher + self.set_skip_pager_hint(True) + self.set_skip_taskbar_hint(True) + # We must be modal to ensure we grab focus when presented froma gtk.Dialog
lib/bb/ui/crumbs/persistenttooltip.py new file +41
-0+ self.set_modal(True) + + self.set_border_width(6) + self.set_position(gtk.WIN_POS_MOUSE) + self.set_opacity(0.95) + + # Draw our label and close buttons + hbox = gtk.HBox(False, 0) + hbox.show() + vbox = gtk.VBox(False, 0) + vbox.show() + vbox.pack_start(hbox, True, True, 0) + + img = gtk.Image() + img.set_from_stock(gtk.STOCK_CLOSE, gtk.ICON_SIZE_BUTTON) + + self.button = gtk.Button() + self.button.set_image(img) + self.button.connect("clicked", self._dismiss_cb) + self.button.set_can_default(True) + self.button.grab_focus() + self.button.show() + hbox.pack_end(self.button, False, False, 0) + + self.set_default(self.button) + + self.label = gtk.Label() + self.label.set_markup(markup) + self.label.show() + vbox.pack_end(self.label, True, True, 6) + + self.connect("key-press-event", self._catch_esc_cb) + + # Inherit the system theme for a tooltip + style = gtk.rc_get_style_by_paths(gtk.settings_get_default(), + 'gtk-tooltip', 'gtk-tooltip', gobject.TYPE_NONE) + self.set_style(style) + + self.add(vbox) + + """
Quoted 8 lines
lib/bb/ui/crumbs/persistenttooltip.py line 92
Quoted 7 lines
lib/bb/ui/crumbs/persistenttooltip.py new file +1
-0+ Modify the displayed message once the PersistentTooltip has beencreated.
lib/bb/ui/crumbs/persistenttooltip.py new file +5
-0+ + markup: the Pango Markup of the new message + """ + def set_tooltip(self, markup): + self.label.set_markup(markup)I haven't seen this is used. Can we remove it?
Good catch. I've removed this method in the bitbake and poky branches.
Cheers,
Joshua
Signature · 3 lines
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology CentreRichard Purdie
AppliedQuoted 14 lines · Joshua Lock
asldlasjd
The following changes since commit
4a480a052f450c4ee061ab0e60a495a45f140cf9:stderr would previously be appended to stdout, corrupting the result when something was outputed to stderr but exit code was still 0 (non-fatal warning messages). This commit makes the code parse only stdout, but output stderr if an error happened. (2012-03-02 16:17:43 +0000)
are available in the git repository at:
git://github.com/incandescant/bitbakejosh/hob
https://github.com/incandescant/bitbake/tree/josh/hoband as a poky repository at:
git://git.yoctoproject.org/poky-contribjosh/hob
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=josh/hob
Quoted 8 lines
Joshua Lock (6):
crumbs/persistenttooltip: a new Gtk+ widget for use in Hob ui/icons: crop the info icons
ui/crumbs/hobwidget: implement HobInfoButton per Hob interaction
design
ui/crumbs/imageconfigurationpage: make use of the HobInfoButton ui/crumbs/hig: use HobInfoButton in place of gtk.Image with tooltip ui/crumbs/hig: special case stock info icons in CrumbsMesssageDialog
Merged to master, thanks.
Richard
Joshua Lock wrote on 2012-03-03:
Quoted 18 lines
Whoops. Forgot to hit save in my editor before sending... The message should be:
The following series addresses some issues I've raised with the Hob implementation. Firstly it introduces two new widgets, a generic PersistentTooltip widget which is an implementation of a tooltip like widget that persists until the user explicitly dismisses it, this matches the Hob interaction design more closely. The second widget is a button-like widget using the info icon from the visual design which, when clicked, will display a persistent tooltip.
The series then replaces all known instances of a gtk.Image containing the stock info item plus a standard tooltip with the new HobInfoButton.
The final patch, to ensure consistency, special cases the stock info icon in the CrumbsMesssageDialog so that any dialogues which show an info icon will display the custom icon per the visual design.
Quoted 5 lines
I've attached a few screenshots showing the PersistentTooltip and HobInfoButton's in use.
Cheers,
Joshua
Josh, I am using Ubuntu system, the color of your tooltips is gray and the background of a window is black. I found it is difficult for me to see the words.
I am wondering whether that is what you want, and whether we can make them white.
--
Shane
Joshua Lock wrote on 2012-03-03:
Quoted 18 lines
Whoops. Forgot to hit save in my editor before sending... The message should be:
The following series addresses some issues I've raised with the Hob implementation. Firstly it introduces two new widgets, a generic PersistentTooltip widget which is an implementation of a tooltip like widget that persists until the user explicitly dismisses it, this matches the Hob interaction design more closely. The second widget is a button-like widget using the info icon from the visual design which, when clicked, will display a persistent tooltip.
The series then replaces all known instances of a gtk.Image containing the stock info item plus a standard tooltip with the new HobInfoButton.
The final patch, to ensure consistency, special cases the stock info icon in the CrumbsMesssageDialog so that any dialogues which show an info icon will display the custom icon per the visual design.
Quoted 5 lines
I've attached a few screenshots showing the PersistentTooltip and HobInfoButton's in use.
Cheers,
Joshua
Josh, I am using Ubuntu system, the color of your tooltips is gray and the background of a window is black. I found it is difficult for me to see the words.
I am wondering whether that is what you want, and whether we can make them white.
--
Shane
Quoted 24 lines · Shane
Joshua Lock wrote on 2012-03-03:
Quoted 21 lines
Whoops. Forgot to hit save in my editor before sending... The message should be:
The following series addresses some issues I've raised with the Hob implementation. Firstly it introduces two new widgets, a generic PersistentTooltip widget which is an implementation of a tooltip like widget that persists until the user explicitly dismisses it, this matches the Hob interaction design more closely. The second widget is a button-like widget using the info icon from the visual design which, when clicked, will display a persistent tooltip.
The series then replaces all known instances of a gtk.Image containing the stock info item plus a standard tooltip with the new HobInfoButton.
The final patch, to ensure consistency, special cases the stock info icon in the CrumbsMesssageDialog so that any dialogues which show an info icon will display the custom icon per the visual design.
I've attached a few screenshots showing the PersistentTooltip and HobInfoButton's in use.
Quoted 6 lines
Quoted 2 lines
Cheers,
JoshuaJosh, I am using Ubuntu system, the color of your tooltips is gray and the background of a window is black. I found it is difficult for me to see the words.
I am wondering whether that is what you want, and whether we can make them white.
Hi Shane,
This isn't intended - I discovered this bug via proxy recently: https://bugzilla.yoctoproject.org/show_bug.cgi?id=2128
I'm working to make the tooltips more readable when using Ubuntu with Unity.
Cheers,
Joshua
Signature · 3 lines
Joshua '贾詡' Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre