Skip to content
Merged
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
22 changes: 12 additions & 10 deletions src/Indicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Slingshot.Indicator : Wingpanel.Indicator {
private const string GALA_BEHAVIOR_SCHEMA = "io.elementary.desktop.wm.behavior";

private DBusService? dbus_service = null;
private Gtk.Grid? indicator_grid = null;
private Granite.Box? display_box = null;
private SlingshotView? view = null;

private static GLib.Settings? keybinding_settings;
Expand Down Expand Up @@ -65,15 +65,17 @@ public class Slingshot.Indicator : Wingpanel.Indicator {
}

public override Gtk.Widget get_display_widget () {
if (indicator_grid == null) {
var indicator_label = new Gtk.Label (_("Applications"));
indicator_label.vexpand = true;
if (display_box == null) {
var indicator_label = new Gtk.Label (_("Applications")) {
vexpand = true
};

var indicator_icon = new Gtk.Image.from_icon_name ("start-here-symbolic");

indicator_grid = new Gtk.Grid ();
indicator_grid.attach (indicator_icon, 0, 0, 1, 1);
indicator_grid.attach (indicator_label, 1, 0, 1, 1);
display_box = new Granite.Box (HORIZONTAL, HALF);
display_box.append (indicator_icon);
display_box.append (indicator_label);

update_tooltip ();

if (keybinding_settings != null) {
Expand All @@ -95,7 +97,7 @@ public class Slingshot.Indicator : Wingpanel.Indicator {

visible = true;

return indicator_grid;
return display_box;
}

public override void opened () {
Expand All @@ -110,7 +112,7 @@ public class Slingshot.Indicator : Wingpanel.Indicator {
private void update_tooltip () {
string[] accels = {};

if (keybinding_settings != null && indicator_grid != null) {
if (keybinding_settings != null && display_box != null) {
var raw_accels = keybinding_settings.get_strv ("panel-main-menu");
foreach (unowned string raw_accel in raw_accels) {
if (raw_accel != "") accels += raw_accel;
Expand All @@ -123,7 +125,7 @@ public class Slingshot.Indicator : Wingpanel.Indicator {
}
}

indicator_grid.tooltip_markup = Granite.markup_accel_tooltip (accels, _("Open and search apps"));
display_box.tooltip_markup = Granite.markup_accel_tooltip (accels, _("Open and search apps"));
}
}

Expand Down
Loading