Skip to content

Commit

Permalink
Fix tooltip update (#162)
Browse files Browse the repository at this point in the history
Start listening for keyboard shortcut change when indicator is created (get_display_widget), as apposed to only after the menu has been opened (get_widget). Making sure the tooltip is always up to date.
  • Loading branch information
peteruithoven authored and cassidyjames committed Dec 7, 2018
1 parent 06a82e8 commit a04df24
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/Slingshot.vala
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ public class Slingshot.Slingshot : Wingpanel.Indicator {

public override Gtk.Widget? get_widget () {
if (view == null) {
if (keybinding_settings != null) {
keybinding_settings.changed.connect ((key) => {
if (key == "panel-main-menu") {
update_tooltip ();
}
});
}

settings = new Settings ();

view = new SlingshotView ();
Expand Down Expand Up @@ -91,6 +83,14 @@ public class Slingshot.Slingshot : Wingpanel.Indicator {
indicator_grid.attach (indicator_icon, 0, 0, 1, 1);
indicator_grid.attach (indicator_label, 1, 0, 1, 1);
update_tooltip ();

if (keybinding_settings != null) {
keybinding_settings.changed.connect ((key) => {
if (key == "panel-main-menu") {
update_tooltip ();
}
});
}
}

visible = true;
Expand Down Expand Up @@ -177,4 +177,3 @@ public Wingpanel.Indicator get_indicator (Module module, Wingpanel.IndicatorMana
var indicator = new Slingshot.Slingshot ();
return indicator;
}

0 comments on commit a04df24

Please sign in to comment.