Merge lp:~3v1n0/unity/tunable-show-menus-now into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4013
Proposed branch: lp:~3v1n0/unity/tunable-show-menus-now
Merge into: lp:unity
Diff against target: 45 lines (+12/-0)
2 files modified
com.canonical.Unity.gschema.xml (+7/-0)
unity-shared/MenuManager.cpp (+5/-0)
To merge this branch: bzr merge lp:~3v1n0/unity/tunable-show-menus-now
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Andrea Azzarone (community) Approve
Review via email: mp+271518@code.launchpad.net

Commit message

MenuManager: add a new setting to control the show-now delay

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'com.canonical.Unity.gschema.xml'
--- com.canonical.Unity.gschema.xml 2015-04-20 14:50:48 +0000
+++ com.canonical.Unity.gschema.xml 2015-09-17 16:44:55 +0000
@@ -53,6 +53,13 @@
53 on the window decoration, otherwise they will be always shown on the53 on the window decoration, otherwise they will be always shown on the
54 unity top panel</description>54 unity top panel</description>
55 </key>55 </key>
56 <key type="u" name="show-menus-now-delay">
57 <default>180</default>
58 <range min="0" max="5000"/>
59 <summary>Delay (in ms) before showing the menus when pressing Alt</summary>
60 <description>This allows tune the delay before presenting unity menus
61 (in non always-show-menus mode).</description>
62 </key>
56 <key type="b" name="always-show-menus">63 <key type="b" name="always-show-menus">
57 <default>false</default>64 <default>false</default>
58 <summary>Toggle the menu visibility based on mouse hovering.</summary>65 <summary>Toggle the menu visibility based on mouse hovering.</summary>
5966
=== modified file 'unity-shared/MenuManager.cpp'
--- unity-shared/MenuManager.cpp 2015-06-05 14:28:27 +0000
+++ unity-shared/MenuManager.cpp 2015-09-17 16:44:55 +0000
@@ -38,6 +38,7 @@
3838
39const std::string SETTINGS_NAME = "com.canonical.Unity";39const std::string SETTINGS_NAME = "com.canonical.Unity";
40const std::string LIM_KEY = "integrated-menus";40const std::string LIM_KEY = "integrated-menus";
41const std::string SHOW_MENUS_NOW_DELAY = "show-menus-now-delay";
41const std::string ALWAYS_SHOW_MENUS_KEY = "always-show-menus";42const std::string ALWAYS_SHOW_MENUS_KEY = "always-show-menus";
42}43}
4344
@@ -68,11 +69,15 @@
68 signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + LIM_KEY, [this] (GSettings*, const gchar*) {69 signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + LIM_KEY, [this] (GSettings*, const gchar*) {
69 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());70 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());
70 });71 });
72 signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + SHOW_MENUS_NOW_DELAY, [this] (GSettings*, const gchar*) {
73 parent_->show_menus_wait = g_settings_get_uint(settings_, SHOW_MENUS_NOW_DELAY.c_str());
74 });
71 signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + ALWAYS_SHOW_MENUS_KEY, [this] (GSettings*, const gchar*) {75 signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + ALWAYS_SHOW_MENUS_KEY, [this] (GSettings*, const gchar*) {
72 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());76 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());
73 });77 });
7478
75 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());79 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());
80 parent_->show_menus_wait = g_settings_get_uint(settings_, SHOW_MENUS_NOW_DELAY.c_str());
76 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());81 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());
77 parent_->menu_open = indicators_->GetActiveEntry() != nullptr;82 parent_->menu_open = indicators_->GetActiveEntry() != nullptr;
78 }83 }