From b15fceaeeb1276e0865818d1629fa91d18ab49c2 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Wed, 18 Jun 2008 11:18:17 +0100 Subject: [PATCH] Added tooltips for the action buttons in the 0desktop list. --- zeroinstall/gtkui/applistbox.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/zeroinstall/gtkui/applistbox.py b/zeroinstall/gtkui/applistbox.py index 602007f..74c992c 100644 --- a/zeroinstall/gtkui/applistbox.py +++ b/zeroinstall/gtkui/applistbox.py @@ -7,7 +7,7 @@ import gtk, gobject import gtk.glade import subprocess -from zeroinstall.gtkui import icon, xdgutils +from zeroinstall.gtkui import icon, xdgutils, treetips def _pango_escape(s): return s.replace('&', '&').replace('<', '<') @@ -27,6 +27,13 @@ class AppList: path = self.apps[uri] os.unlink(path) +_tooltips = { + 0: "Run the application", + 1: "Show documentation files", + 2: "Upgrade or change versions", + 3: "Remove launcher from the menu", +} + class AppListBox: """A dialog box which lists applications already added to the menus.""" ICON, URI, NAME, MARKUP = range(4) @@ -71,6 +78,7 @@ class AppListBox: area = tv.get_cell_area(path, actions_column) tv.queue_draw_area(*area) + tips = treetips.TreeTips() def motion(widget, mev): if mev.window == tv.get_bin_window(): new_hover = (None, None, None) @@ -87,11 +95,13 @@ class AppListBox: redraw_actions(cell_actions.hover[0]) cell_actions.hover = new_hover redraw_actions(cell_actions.hover[0]) + tips.prime(tv, _tooltips.get(cell_actions.hover[2], None)) tv.connect('motion-notify-event', motion) def leave(widget, lev): redraw_actions(cell_actions.hover[0]) cell_actions.hover = (None, None, None) + tips.hide() tv.connect('leave-notify-event', leave) -- 2.11.4.GIT