diff --git a/data/dock.metainfo.xml.in b/data/dock.metainfo.xml.in index bd3235d1..385784e1 100644 --- a/data/dock.metainfo.xml.in +++ b/data/dock.metainfo.xml.in @@ -39,6 +39,7 @@ Background tasks: no menu + Add super number shortcuts to tooltips No app tooltip shows when Hide Dock is set to Never while using Wayland "Keep in Dock" Not Working For Most Applications Drag and drop an app window into the workspace switcher diff --git a/src/AppSystem/Launcher.vala b/src/AppSystem/Launcher.vala index 2a4ee1bb..4ecef3b7 100644 --- a/src/AppSystem/Launcher.vala +++ b/src/AppSystem/Launcher.vala @@ -10,12 +10,15 @@ public class Dock.Launcher : BaseItem { private const int DND_TIMEOUT = 1000; + private static Settings keybinding_settings; private static Settings? notify_settings; static construct { if (SettingsSchemaSource.get_default ().lookup ("io.elementary.notifications", true) != null) { notify_settings = new Settings ("io.elementary.notifications"); } + + keybinding_settings = new GLib.Settings ("io.elementary.dock.keybindings"); } // Matches icon size and padding in Launcher.css @@ -89,7 +92,9 @@ 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); + keybinding_settings.changed.connect (update_tooltip); image = new Gtk.Image (); @@ -368,6 +373,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 = keybinding_settings.get_strv ("launch-dock-%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 ();