Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/dock.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</description>
<issues>
<issue url="https://github.com/elementary/dock/issues/455">Background tasks: no menu</issue>
<issue url="https://github.com/elementary/dock/issues/486">Add super number shortcuts to tooltips</issue>
<issue url="https://github.com/elementary/dock/issues/505">No app tooltip shows when Hide Dock is set to Never while using Wayland</issue>
<issue url="https://github.com/elementary/dock/issues/520">"Keep in Dock" Not Working For Most Applications</issue>
<issue url="https://github.com/elementary/dock/issues/527">Drag and drop an app window into the workspace switcher</issue>
Expand Down
20 changes: 19 additions & 1 deletion src/AppSystem/Launcher.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ();

Expand Down Expand Up @@ -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 ();
Expand Down