[tasque] [Gtk.Tasque] Imitate tooltip in AppIndicator using a MenuItem.



commit dd8bc821a6390785a0a7b68327459aee5b809e83
Author: Antonius Riha <antoniusriha gmail com>
Date:   Fri Sep 21 03:31:08 2012 +0200

    [Gtk.Tasque] Imitate tooltip in AppIndicator using a MenuItem.
    
    This workaround was originally proposed in Alessio Caiazza's patch
    to his bug report about the missing tray in Ubuntu/Unity:
    https://bugzilla.gnome.org/show_bug.cgi?id=649670
    
    Note: Due to another bug the tooltip is currently not updated and
    always states "Tasque Rocks".

 src/Gtk.Tasque/AppIndicatorTray.cs |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/Gtk.Tasque/AppIndicatorTray.cs b/src/Gtk.Tasque/AppIndicatorTray.cs
index 9bc217b..cdb47ab 100644
--- a/src/Gtk.Tasque/AppIndicatorTray.cs
+++ b/src/Gtk.Tasque/AppIndicatorTray.cs
@@ -40,11 +40,24 @@ namespace Tasque
 			ToggleTaskWindowAction.ConnectProxy (toggleTaskWindowMenuItem);
 			menu.Insert (toggleTaskWindowMenuItem, 0);
 			menu.Insert (new SeparatorMenuItem (), 1);
+
+			tooltipProxyMenuItem = new MenuItem (Tooltip);
+			tooltipProxyMenuItem.Sensitive = false;
+			menu.Insert (tooltipProxyMenuItem, 2);
+			menu.Insert (new SeparatorMenuItem (), 3);
+
 			menu.ShowAll ();
 			
 			appIndicator.Menu = menu;
 		}
 
+		protected override void OnTooltipChanged ()
+		{
+			if (tooltipProxyMenuItem != null)
+				((Label)tooltipProxyMenuItem.Child).Text = Tooltip;
+		}
+
 		ApplicationIndicator appIndicator;
+		MenuItem tooltipProxyMenuItem;
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]