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

Proposed by Franck Dugué
Status: Rejected
Rejected by: Cody Garver
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 (community) Needs Fixing
David Gomes (community) Needs Fixing
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
409. By Franck Dugué

Add function to choose menu file

Revision history for this message
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
Revision history for this message
Danielle Foré (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.

Revision history for this message
Avi Romanoff (aroman) wrote :

(See Dan's comments for the UX perspective)

review: Needs Fixing

Unmerged revisions

409. By Franck Dugué

Add function to choose menu file

408. By Franck Dugué

Can be placed with x, y axis

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'org.pantheon.desktop.slingshot.gschema.xml'
--- org.pantheon.desktop.slingshot.gschema.xml 2013-01-09 16:24:00 +0000
+++ org.pantheon.desktop.slingshot.gschema.xml 2014-02-27 02:52:58 +0000
@@ -15,6 +15,16 @@
15 <summary>The default icon size of apps</summary>15 <summary>The default icon size of apps</summary>
16 <description>This value manages the size of the icons in Slingshot.</description>16 <description>This value manages the size of the icons in Slingshot.</description>
17 </key>17 </key>
18 <key name="posx" type="i">
19 <default>100</default>
20 <summary>The default x axis</summary>
21 <description>This value needs to be greater than 1 to be effective.</description>
22 </key>
23 <key name="posy" type="i">
24 <default>30</default>
25 <summary>The default y axis</summary>
26 <description>This value needs to be greater than 1 to be effective.</description>
27 </key>
18 <key name="show-category-filter" type="b">28 <key name="show-category-filter" type="b">
19 <default>true</default>29 <default>true</default>
20 <summary>Show the category switcher or not</summary>30 <summary>Show the category switcher or not</summary>
@@ -30,5 +40,10 @@
30 <summary>The last resolution of the screen</summary>40 <summary>The last resolution of the screen</summary>
31 <description>This value makes slingshot able to adapt to each screen.</description>41 <description>This value makes slingshot able to adapt to each screen.</description>
32 </key>42 </key>
33 </schema>43 <key name="menufile" type="s">
44 <default>"pantheon-applications.menu"</default>
45 <summary>The default filename menu</summary>
46 <description>This value can be to find in /etc/xdg/menus/ or $HOME/.config/menus/</description>
47 </key>
48</schema>
34</schemalist>49</schemalist>
3550
=== modified file 'src/Backend/AppSystem.vala'
--- src/Backend/AppSystem.vala 2013-01-10 16:53:50 +0000
+++ src/Backend/AppSystem.vala 2014-02-27 02:52:58 +0000
@@ -21,6 +21,7 @@
21 private Gee.ArrayList<GMenu.TreeDirectory> categories = null;21 private Gee.ArrayList<GMenu.TreeDirectory> categories = null;
22 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;22 private Gee.HashMap<string, Gee.ArrayList<App>> apps = null;
23 private GMenu.Tree apps_menu = null;23 private GMenu.Tree apps_menu = null;
24 private string menu_file;
2425
25#if HAVE_ZEITGEIST26#if HAVE_ZEITGEIST
26 private RelevancyService rl_service;27 private RelevancyService rl_service;
@@ -35,7 +36,12 @@
35 rl_service.update_complete.connect (update_popularity);36 rl_service.update_complete.connect (update_popularity);
36#endif37#endif
3738
38 apps_menu = new GMenu.Tree ("pantheon-applications.menu", GMenu.TreeFlags.INCLUDE_EXCLUDED | GMenu.TreeFlags.SORT_DISPLAY_NAME);39 if (Slingshot.settings.menufile != "") // if menufile exist
40 menu_file = Slingshot.settings.menufile;
41 else
42 menu_file = "pantheon-applications.menu";
43
44 apps_menu = new GMenu.Tree (menu_file, GMenu.TreeFlags.INCLUDE_EXCLUDED | GMenu.TreeFlags.SORT_DISPLAY_NAME);
39 apps_menu.changed.connect (update_app_system);45 apps_menu.changed.connect (update_app_system);
40 46
41 apps = new Gee.HashMap<string, Gee.ArrayList<App>> ();47 apps = new Gee.HashMap<string, Gee.ArrayList<App>> ();
4248
=== modified file 'src/Settings.vala'
--- src/Settings.vala 2013-12-26 00:08:04 +0000
+++ src/Settings.vala 2014-02-27 02:52:58 +0000
@@ -34,6 +34,10 @@
34 public bool use_category { get; set; }34 public bool use_category { get; set; }
35 public string screen_resolution { get; set; }35 public string screen_resolution { get; set; }
36 public GalaSettings gala_settings;36 public GalaSettings gala_settings;
37 public int posx { get; set; }
38 public int posy { get; set; }
39 public string menufile { get; set; }
40
3741
38 public Settings () {42 public Settings () {
39 base ("org.pantheon.desktop.slingshot");43 base ("org.pantheon.desktop.slingshot");
4044
=== modified file 'src/SlingshotView.vala'
--- src/SlingshotView.vala 2013-12-26 00:08:04 +0000
+++ src/SlingshotView.vala 2014-02-27 02:52:58 +0000
@@ -53,6 +53,10 @@
53 private Modality modality;53 private Modality modality;
54 private bool can_trigger_hotcorner = true;54 private bool can_trigger_hotcorner = true;
5555
56 // Positions
57 private int default_posx;
58 private int default_posy;
59
56 // Sizes60 // Sizes
57 public int columns {61 public int columns {
58 get {62 get {
@@ -361,8 +365,8 @@
361 screen.get_monitor_geometry (this.screen.get_primary_monitor(), out monitor_dimensions);365 screen.get_monitor_geometry (this.screen.get_primary_monitor(), out monitor_dimensions);
362 app_launcher_pos = Gdk.Rectangle () { x = monitor_dimensions.x,366 app_launcher_pos = Gdk.Rectangle () { x = monitor_dimensions.x,
363 y = monitor_dimensions.y,367 y = monitor_dimensions.y,
364 width = 100,368 width = default_posx, // default 100
365 height = 30369 height = default_posy // default 30
366 };370 };
367 move_to_rect (app_launcher_pos, show);371 move_to_rect (app_launcher_pos, show);
368 }372 }
@@ -839,7 +843,21 @@
839843
840 }844 }
841845
842 private void read_settings (bool first_start = false, bool check_columns = true, bool check_rows = true) {846 private void read_settings (bool first_start = false, bool check_columns = true, bool check_rows = true, bool check_posx = true, bool check_posy = true) {
847
848 if (check_posx) {
849 if (Slingshot.settings.posx > 99)
850 default_posx = Slingshot.settings.posx;
851 else
852 default_posx = Slingshot.settings.posx = 100;
853 }
854
855 if (check_posy) {
856 if (Slingshot.settings.posy > 29)
857 default_posy = Slingshot.settings.posy;
858 else
859 default_posy = Slingshot.settings.posy = 30;
860 }
843861
844 if (check_columns) {862 if (check_columns) {
845 if (Slingshot.settings.columns > 3)863 if (Slingshot.settings.columns > 3)
@@ -950,4 +968,4 @@
950 }968 }
951 }969 }
952970
953}
954\ No newline at end of file971\ No newline at end of file
972}

Subscribers

People subscribed via source and target branches