diff --git a/src/AppSystem/Launcher.vala b/src/AppSystem/Launcher.vala index bb7e0c01..b20fd30a 100644 --- a/src/AppSystem/Launcher.vala +++ b/src/AppSystem/Launcher.vala @@ -89,7 +89,8 @@ public class Dock.Launcher : BaseItem { popover_menu.set_offset (0, -1); popover_menu.set_parent (this); - tooltip_text = app.app_info.get_display_name (); + update_tooltip (); + notify["current-pos"].connect (update_tooltip); image = new Gtk.Image (); @@ -377,6 +378,19 @@ public class Dock.Launcher : BaseItem { }); } + private void update_tooltip () { + string[] accels = {}; + var index = (int) current_pos / ItemManager.get_launcher_size (); + if (index < 9) { + accels = {"%i".printf (index + 1)}; + } + + tooltip_text = Granite.markup_accel_tooltip ( + accels, + app.app_info.get_display_name () + ); + } + protected override bool drag_cancelled (Gdk.Drag drag, Gdk.DragCancelReason reason) { if (app.pinned && reason == NO_TARGET) { var popover = new PoofPopover ();