Merge lp:~philip.scott/slingshot/close-on-drag into lp:~elementary-pantheon/slingshot/trunk

Proposed by Felipe Escoto on 2016-05-21
Status: Merged
Merged at revision: 667
Proposed branch: lp:~philip.scott/slingshot/close-on-drag
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 58 lines (+9/-6)
2 files modified
src/Slingshot.vala (+5/-3)
src/Widgets/AppEntry.vala (+4/-3)
To merge this branch: bzr merge lp:~philip.scott/slingshot/close-on-drag
Reviewer Review Type Date Requested Status
Zisu Andrei Needs Fixing on 2016-05-25
elementary Pantheon team 2016-05-21 Pending
Review via email: mp+295393@code.launchpad.net

Commit message

Close indicator when dragging

Description of the change

Slingshot now closes when you want to drag something. I've also made it so the cursor is on the center of the icon you drag.

To post a comment you must log in.
Zisu Andrei (matzipan) wrote :

Only one thing to point out: make the icon position dynamically calculated.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Slingshot.vala'
2--- src/Slingshot.vala 2016-02-17 19:06:52 +0000
3+++ src/Slingshot.vala 2016-05-21 18:45:08 +0000
4@@ -17,8 +17,7 @@
5 //
6
7 public class Slingshot.Slingshot : Wingpanel.Indicator {
8-
9- private SlingshotView? view = null;
10+ private static SlingshotView? view = null;
11
12 private Gtk.Label? indicator_label = null;
13
14@@ -58,6 +57,10 @@
15 return view;
16 }
17
18+ public static void request_close () {
19+ view.close_indicator ();
20+ }
21+
22 public override Gtk.Widget get_display_widget () {
23 if (indicator_label == null)
24 indicator_label = new Gtk.Label (_("Applications"));
25@@ -75,7 +78,6 @@
26 public override void closed () {
27 // TODO: Do we need to do anyhting here?
28 }
29-
30 }
31
32 public Wingpanel.Indicator get_indicator (Module module) {
33
34=== modified file 'src/Widgets/AppEntry.vala'
35--- src/Widgets/AppEntry.vala 2016-02-17 19:06:52 +0000
36+++ src/Widgets/AppEntry.vala 2016-05-21 18:45:08 +0000
37@@ -134,9 +134,10 @@
38 return false;
39 });
40
41- this.drag_begin.connect ( (ctx) => {
42+ this.drag_begin.connect ((ctx) => {
43 this.dragging = true;
44- Gtk.drag_set_icon_gicon (ctx, app.icon, 0, 0);
45+ Gtk.drag_set_icon_gicon (ctx, this.image.gicon, 16, 16);
46+ Slingshot.request_close ();
47 });
48
49 this.drag_end.connect ( () => {
50@@ -183,7 +184,7 @@
51
52 count_image.set_from_surface (surface.Internal);
53 }
54-#endif
55+#endif
56
57 private void create_menu () {
58 // Display the apps static quicklist items in a popover menu

Subscribers

People subscribed via source and target branches