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

Proposed by Felipe Escoto
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 (community) Needs Fixing
elementary Pantheon team 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.
Revision history for this message
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
=== modified file 'src/Slingshot.vala'
--- src/Slingshot.vala 2016-02-17 19:06:52 +0000
+++ src/Slingshot.vala 2016-05-21 18:45:08 +0000
@@ -17,8 +17,7 @@
17//17//
1818
19public class Slingshot.Slingshot : Wingpanel.Indicator {19public class Slingshot.Slingshot : Wingpanel.Indicator {
2020 private static SlingshotView? view = null;
21 private SlingshotView? view = null;
2221
23 private Gtk.Label? indicator_label = null;22 private Gtk.Label? indicator_label = null;
2423
@@ -58,6 +57,10 @@
58 return view;57 return view;
59 }58 }
6059
60 public static void request_close () {
61 view.close_indicator ();
62 }
63
61 public override Gtk.Widget get_display_widget () {64 public override Gtk.Widget get_display_widget () {
62 if (indicator_label == null)65 if (indicator_label == null)
63 indicator_label = new Gtk.Label (_("Applications"));66 indicator_label = new Gtk.Label (_("Applications"));
@@ -75,7 +78,6 @@
75 public override void closed () {78 public override void closed () {
76 // TODO: Do we need to do anyhting here?79 // TODO: Do we need to do anyhting here?
77 }80 }
78
79}81}
8082
81public Wingpanel.Indicator get_indicator (Module module) {83public Wingpanel.Indicator get_indicator (Module module) {
8284
=== modified file 'src/Widgets/AppEntry.vala'
--- src/Widgets/AppEntry.vala 2016-02-17 19:06:52 +0000
+++ src/Widgets/AppEntry.vala 2016-05-21 18:45:08 +0000
@@ -134,9 +134,10 @@
134 return false;134 return false;
135 });135 });
136136
137 this.drag_begin.connect ( (ctx) => {137 this.drag_begin.connect ((ctx) => {
138 this.dragging = true;138 this.dragging = true;
139 Gtk.drag_set_icon_gicon (ctx, app.icon, 0, 0);139 Gtk.drag_set_icon_gicon (ctx, this.image.gicon, 16, 16);
140 Slingshot.request_close ();
140 });141 });
141142
142 this.drag_end.connect ( () => {143 this.drag_end.connect ( () => {
@@ -183,7 +184,7 @@
183184
184 count_image.set_from_surface (surface.Internal);185 count_image.set_from_surface (surface.Internal);
185 }186 }
186#endif 187#endif
187188
188 private void create_menu () {189 private void create_menu () {
189 // Display the apps static quicklist items in a popover menu190 // Display the apps static quicklist items in a popover menu

Subscribers

People subscribed via source and target branches