Merge lp:~oria/slingshot/slingshot into lp:~elementary-pantheon/slingshot/trunk

Proposed by Franck Dugué on 2014-02-25
Status: Rejected
Rejected by: Cody Garver on 2015-05-29
Proposed branch: lp:~oria/slingshot/slingshot
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 129 lines (+49/-6)
4 files modified
org.pantheon.desktop.slingshot.gschema.xml (+16/-1)
src/Backend/AppSystem.vala (+7/-1)
src/Settings.vala (+4/-0)
src/SlingshotView.vala (+22/-4)
To merge this branch: bzr merge lp:~oria/slingshot/slingshot
Reviewer Review Type Date Requested Status
Avi Romanoff 2014-04-19 Needs Fixing on 2014-05-24
David Gomes 2014-02-25 Needs Fixing on 2014-04-19
Review via email: mp+208047@code.launchpad.net

Description of the change

Add options to customize Slingshot

I added an option to place Slingshot with x and y axis.
This allows to user to customize Slingshot and to place it like it wants.
And I added a function to choose its own file applications menu.
The user can change these settings with gsettings or dconf-editor e.g

To post a comment you must log in.
lp:~oria/slingshot/slingshot updated on 2014-02-27
409. By Franck Dugué on 2014-02-27

Add function to choose menu file

David Gomes (davidgomes) wrote :

You've got some messy indentation in your Vala code and are mixing tabs with spaces in your XML code.

This needs design approval too.

review: Needs Fixing
Daniel Fore (danrabbit) wrote :

Sadly, my primary objection to this branch is political. For Isis+1, to use a Gtk.Popover here Slingshot will have to be a child of Wingpanel and not its own window. So I believe it will no longer be possible to set a different x or y position. Then we'll have to explain to users why a more robust codebase is more important than the feature they liked and that's never fun.

But as for choosing the applications menu file, I guess some people might find that valuable if they're running multiple desktop environments. As long as there isn't a performance impact, I'm indifferent to that change.

So, in my personal opinion, OP should drop the X Y position stuff or at least have it evaluated in a separate branch.

Avi Romanoff (aroman) wrote :

(See Dan's comments for the UX perspective)

review: Needs Fixing

Unmerged revisions

409. By Franck Dugué on 2014-02-27

Add function to choose menu file

408. By Franck Dugué on 2014-02-24

Can be placed with x, y axis

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'org.pantheon.desktop.slingshot.gschema.xml'
2--- org.pantheon.desktop.slingshot.gschema.xml 2013-01-09 16:24:00 +0000
3+++ org.pantheon.desktop.slingshot.gschema.xml 2014-02-27 02:52:58 +0000
4@@ -15,6 +15,16 @@
5 <summary>The default icon size of apps</summary>
6 <description>This value manages the size of the icons in Slingshot.</description>
7 </key>
8+ <key name="posx" type="i">
9+ <default>100</default>
10+ <summary>The default x axis</summary>
11+ <description>This value needs to be greater than 1 to be effective.</description>
12+ </key>
13+ <key name="posy" type="i">
14+ <default>30</default>
15+ <summary>The default y axis</summary>
16+ <description>This value needs to be greater than 1 to be effective.</description>
17+ </key>
18 <key name="show-category-filter" type="b">
19 <default>true</default>
20 <summary>Show the category switcher or not</summary>
21@@ -30,5 +40,10 @@
22 <summary>The last resolution of the screen</summary>
23 <description>This value makes slingshot able to adapt to each screen.</description>
24 </key>
25- </schema>
26+ <key name="menufile" type="s">
27+ <default>"pantheon-applications.menu"</default>
28+ <summary>The default filename menu</summary>
29+ <description>This value can be to find in /etc/xdg/menus/ or $HOME/.config/menus/</description>
30+ </key>
31+</schema>
32 </schemalist>
33
34=== modified file 'src/Backend/AppSystem.vala'
35--- src/Backend/AppSystem.vala 2013-01-10 16:53:50 +0000
36+++ src/Backend/AppSystem.vala 2014-02-27 02:52:58 +0000
37@@ -21,6 +21,7 @@
38 private Gee.ArrayList<GMenu.TreeDirectory> categories = null;
39 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;
40 private GMenu.Tree apps_menu = null;
41+ private string menu_file;
42
43 #if HAVE_ZEITGEIST
44 private RelevancyService rl_service;
45@@ -35,7 +36,12 @@
46 rl_service.update_complete.connect (update_popularity);
47 #endif
48
49- apps_menu = new GMenu.Tree ("pantheon-applications.menu", GMenu.TreeFlags.INCLUDE_EXCLUDED | GMenu.TreeFlags.SORT_DISPLAY_NAME);
50+ if (Slingshot.settings.menufile != "") // if menufile exist
51+ menu_file = Slingshot.settings.menufile;
52+ else
53+ menu_file = "pantheon-applications.menu";
54+
55+ apps_menu = new GMenu.Tree (menu_file, GMenu.TreeFlags.INCLUDE_EXCLUDED | GMenu.TreeFlags.SORT_DISPLAY_NAME);
56 apps_menu.changed.connect (update_app_system);
57
58 apps = new Gee.HashMap<string, Gee.ArrayList<App>> ();
59
60=== modified file 'src/Settings.vala'
61--- src/Settings.vala 2013-12-26 00:08:04 +0000
62+++ src/Settings.vala 2014-02-27 02:52:58 +0000
63@@ -34,6 +34,10 @@
64 public bool use_category { get; set; }
65 public string screen_resolution { get; set; }
66 public GalaSettings gala_settings;
67+ public int posx { get; set; }
68+ public int posy { get; set; }
69+ public string menufile { get; set; }
70+
71
72 public Settings () {
73 base ("org.pantheon.desktop.slingshot");
74
75=== modified file 'src/SlingshotView.vala'
76--- src/SlingshotView.vala 2013-12-26 00:08:04 +0000
77+++ src/SlingshotView.vala 2014-02-27 02:52:58 +0000
78@@ -53,6 +53,10 @@
79 private Modality modality;
80 private bool can_trigger_hotcorner = true;
81
82+ // Positions
83+ private int default_posx;
84+ private int default_posy;
85+
86 // Sizes
87 public int columns {
88 get {
89@@ -361,8 +365,8 @@
90 screen.get_monitor_geometry (this.screen.get_primary_monitor(), out monitor_dimensions);
91 app_launcher_pos = Gdk.Rectangle () { x = monitor_dimensions.x,
92 y = monitor_dimensions.y,
93- width = 100,
94- height = 30
95+ width = default_posx, // default 100
96+ height = default_posy // default 30
97 };
98 move_to_rect (app_launcher_pos, show);
99 }
100@@ -839,7 +843,21 @@
101
102 }
103
104- private void read_settings (bool first_start = false, bool check_columns = true, bool check_rows = true) {
105+ private void read_settings (bool first_start = false, bool check_columns = true, bool check_rows = true, bool check_posx = true, bool check_posy = true) {
106+
107+ if (check_posx) {
108+ if (Slingshot.settings.posx > 99)
109+ default_posx = Slingshot.settings.posx;
110+ else
111+ default_posx = Slingshot.settings.posx = 100;
112+ }
113+
114+ if (check_posy) {
115+ if (Slingshot.settings.posy > 29)
116+ default_posy = Slingshot.settings.posy;
117+ else
118+ default_posy = Slingshot.settings.posy = 30;
119+ }
120
121 if (check_columns) {
122 if (Slingshot.settings.columns > 3)
123@@ -950,4 +968,4 @@
124 }
125 }
126
127-}
128\ No newline at end of file
129+}

Subscribers

People subscribed via source and target branches