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
6 changes: 0 additions & 6 deletions src/Indicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,13 @@ public class Slingshot.Indicator : Wingpanel.Indicator {
default_theme.add_resource_path ("/io/elementary/desktop/wingpanel/applications-menu/icons");
}

private void on_close_indicator () {
close ();
}

public override Gtk.Widget? get_widget () {
if (view == null) {
view = new SlingshotView ();

unowned var unity_client = Unity.get_default ();
unity_client.add_client (view);

view.close_indicator.connect (on_close_indicator);

if (dbus_service == null) {
dbus_service = new DBusService (view);
}
Expand Down
14 changes: 2 additions & 12 deletions src/SlingshotView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/

public class Slingshot.SlingshotView : Gtk.Bin, UnityClient {
public signal void close_indicator ();

public Backend.AppSystem app_system;
public Gtk.SearchEntry search_entry;
public Gtk.Stack stack;
Expand Down Expand Up @@ -140,14 +138,6 @@ public class Slingshot.SlingshotView : Gtk.Bin, UnityClient {

search_entry.activate.connect (search_entry_activated);

grid_view.app_launched.connect (() => {
close_indicator ();
});

search_view.app_launched.connect (() => {
close_indicator ();
});

// Auto-update applications grid
app_system.changed.connect (() => {
grid_view.populate (app_system);
Expand Down Expand Up @@ -221,7 +211,7 @@ public class Slingshot.SlingshotView : Gtk.Bin, UnityClient {
if (search_entry.text.length > 0) {
search_entry.text = "";
} else {
close_indicator ();
((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ();
}

return Gdk.EVENT_STOP;
Expand All @@ -246,7 +236,7 @@ public class Slingshot.SlingshotView : Gtk.Bin, UnityClient {
if ((state & Gdk.ModifierType.MOD1_MASK) != 0) {
switch (keyval) {
case Gdk.Key.F4:
close_indicator ();
((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ();
return Gdk.EVENT_STOP;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Views/CategoryView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class Slingshot.Widgets.CategoryView : Gtk.EventBox {
listbox.row_activated.connect ((row) => {
Idle.add (() => {
((AppListRow) row).launch ();
view.close_indicator ();
((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ();

return false;
});
Expand Down Expand Up @@ -127,13 +127,13 @@ public class Slingshot.Widgets.CategoryView : Gtk.EventBox {
Gtk.drag_set_icon_gicon (ctx, drag_item.app_info.get_icon (), 32, 32);
}

view.close_indicator ();
((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ();
}
});

listbox.drag_end.connect (() => {
if (drag_uri != null) {
view.close_indicator ();
((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ();
}

drag_uri = null;
Expand Down
4 changes: 1 addition & 3 deletions src/Views/GridView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/

public class Slingshot.Widgets.Grid : Gtk.Box {
public signal void app_launched ();

private const int PAGE_ROWS = 3;
private const int PAGE_COLUMNS = 5;

Expand Down Expand Up @@ -84,7 +82,7 @@ public class Slingshot.Widgets.Grid : Gtk.Box {

foreach (Backend.App app in app_system.get_apps_by_name ()) {
var app_button = new Widgets.AppButton (app);
app_button.app_launched.connect (() => app_launched ());
app_button.app_launched.connect (() => ((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ());

if (next_col_index == PAGE_COLUMNS) {
next_col_index = 0;
Expand Down
9 changes: 4 additions & 5 deletions src/Views/SearchView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public class Slingshot.Widgets.SearchView : Gtk.Bin {
const int MAX_RESULTS = 10;

public signal void start_search (Synapse.SearchMatch search_match, Synapse.Match? target);
public signal void app_launched ();

private Granite.Widgets.AlertView alert_view;
private Gtk.ListBox list_box;
Expand Down Expand Up @@ -117,13 +116,13 @@ public class Slingshot.Widgets.SearchView : Gtk.Bin {
Gtk.drag_set_icon_gicon (ctx, drag_item.image.gicon, 32, 32);
}

app_launched ();
((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ();
}
});

list_box.drag_end.connect (() => {
if (drag_uri != null) {
app_launched ();
((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ();
}

drag_uri = null;
Expand Down Expand Up @@ -154,7 +153,7 @@ public class Slingshot.Widgets.SearchView : Gtk.Bin {
break;
}

app_launched ();
((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ();

return false;
});
Expand Down Expand Up @@ -273,7 +272,7 @@ public class Slingshot.Widgets.SearchView : Gtk.Bin {
var search_item = new SearchItem (app, search_term, result_type);
app.start_search.connect ((search, target) => start_search (search, target));

app.launched.connect (() => app_launched ());
app.launched.connect (() => ((Gtk.Popover) get_ancestor (typeof (Gtk.Popover))).popdown ());

list_box.add (search_item);
search_item.show_all ();
Expand Down