Merge lp:~davidgomes/slingshot/open-on-mouse-option into lp:~elementary-pantheon/slingshot/trunk

Proposed by David Gomes
Status: Merged
Merged at revision: 128
Proposed branch: lp:~davidgomes/slingshot/open-on-mouse-option
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 129 lines (+22/-12)
3 files modified
org.elementary.slingshot.gschema.xml (+5/-0)
src/Settings.vala (+5/-4)
src/SlingshotView.vala (+12/-8)
To merge this branch: bzr merge lp:~davidgomes/slingshot/open-on-mouse-option
Reviewer Review Type Date Requested Status
Giulio Collura Pending
Review via email: mp+87270@code.launchpad.net

Description of the change

Fixed bug #897443, it needs "sudo make install", because it changes the schema file.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'org.elementary.slingshot.gschema.xml'
2--- org.elementary.slingshot.gschema.xml 2011-10-09 13:52:23 +0000
3+++ org.elementary.slingshot.gschema.xml 2012-01-02 16:42:33 +0000
4@@ -19,6 +19,11 @@
5 <default>true</default>
6 <summary>Show the category switcher or not</summary>
7 <description>This value handles the category switcher.</description>
8+ </key>
9+ <key name="open-on-mouse" type="b">
10+ <default>false</default>
11+ <summary>Open on mouse position.</summary>
12+ <description>Whether Slingshot should open on mouse position or not.</description>
13 </key>
14 </schema>
15 </schemalist>
16
17=== modified file 'src/Settings.vala'
18--- src/Settings.vala 2011-10-09 13:52:23 +0000
19+++ src/Settings.vala 2012-01-02 16:42:33 +0000
20@@ -1,17 +1,17 @@
21 // -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
22-//
23+//
24 // Copyright (C) 2011 Giulio Collura
25-//
26+//
27 // This program is free software: you can redistribute it and/or modify
28 // it under the terms of the GNU General Public License as published by
29 // the Free Software Foundation, either version 3 of the License, or
30 // (at your option) any later version.
31-//
32+//
33 // This program is distributed in the hope that it will be useful,
34 // but WITHOUT ANY WARRANTY; without even the implied warranty of
35 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 // GNU General Public License for more details.
37-//
38+//
39 // You should have received a copy of the GNU General Public License
40 // along with this program. If not, see <http://www.gnu.org/licenses/>.
41 //
42@@ -26,6 +26,7 @@
43 public int rows { get; set; }
44 public int icon_size { get; set; }
45 public bool show_category_filter { get; set; }
46+ public bool open_on_mouse { get; set; }
47
48 public Settings () {
49 base ("desktop.pantheon.slingshot");
50
51=== modified file 'src/SlingshotView.vala'
52--- src/SlingshotView.vala 2011-11-27 16:25:34 +0000
53+++ src/SlingshotView.vala 2012-01-02 16:42:33 +0000
54@@ -91,7 +91,7 @@
55 // Have the window in the right place
56 read_settings (true);
57 height_request = default_rows * 145 + 180;
58-
59+
60 Slingshot.icon_theme = IconTheme.get_default ();
61
62 app_system = new AppSystem ();
63@@ -160,7 +160,7 @@
64 bottom.pack_end (new Label (""), true, true, 0); // A fake label
65
66 container.pack_start (Utils.set_padding (top, 12, 12, 12, 12), false, true, 0);
67- container.pack_start (Utils.set_padding (center, 0, 12, 12, 12),
68+ container.pack_start (Utils.set_padding (center, 0, 12, 12, 12),
69 true, true, 0);
70 container.pack_end (Utils.set_padding (bottom, 0, 24, 12, 24), false, true, 0);
71
72@@ -425,7 +425,7 @@
73 }
74
75 public void hide_slingshot () {
76-
77+
78 // Show the first page
79 searchbar.text = "";
80
81@@ -438,7 +438,11 @@
82
83 public void show_slingshot () {
84
85- move_to_coords (0, 0);
86+ if (Slingshot.settings.open_on_mouse)
87+ window_position = WindowPosition.MOUSE;
88+ else
89+ move_to_coords (0, 0);
90+
91 show_all ();
92 set_modality ((Modality) view_selector.selected);
93
94@@ -479,7 +483,7 @@
95
96 // Avoid unexpected behavior
97 if (modality != Modality.NORMAL_VIEW)
98- return;
99+ return;
100
101 if ((- current_position) < (grid_view.n_columns*130)) {
102 int count = 0;
103@@ -494,7 +498,7 @@
104 current_position -= val;
105 count += val;
106 return true;
107-
108+
109 }, Priority.DEFAULT_IDLE);
110 }
111
112@@ -553,7 +557,7 @@
113 view_manager.move (category_view, columns*130, 0);
114 view_manager.move (search_view, 0, 0); // Show the searchview
115 return;
116-
117+
118 }
119
120 }
121@@ -564,7 +568,7 @@
122 set_modality ((Modality) view_selector.selected);
123 return;
124 }
125-
126+
127 if (modality != Modality.SEARCH_VIEW)
128 set_modality (Modality.SEARCH_VIEW);
129 search_view_position = 0;

Subscribers

People subscribed via source and target branches