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
1=== modified file 'com.canonical.Unity.gschema.xml'
2--- com.canonical.Unity.gschema.xml 2015-04-20 14:50:48 +0000
3+++ com.canonical.Unity.gschema.xml 2015-09-17 16:44:55 +0000
4@@ -53,6 +53,13 @@
5 on the window decoration, otherwise they will be always shown on the
6 unity top panel</description>
7 </key>
8+ <key type="u" name="show-menus-now-delay">
9+ <default>180</default>
10+ <range min="0" max="5000"/>
11+ <summary>Delay (in ms) before showing the menus when pressing Alt</summary>
12+ <description>This allows tune the delay before presenting unity menus
13+ (in non always-show-menus mode).</description>
14+ </key>
15 <key type="b" name="always-show-menus">
16 <default>false</default>
17 <summary>Toggle the menu visibility based on mouse hovering.</summary>
18
19=== modified file 'unity-shared/MenuManager.cpp'
20--- unity-shared/MenuManager.cpp 2015-06-05 14:28:27 +0000
21+++ unity-shared/MenuManager.cpp 2015-09-17 16:44:55 +0000
22@@ -38,6 +38,7 @@
23
24 const std::string SETTINGS_NAME = "com.canonical.Unity";
25 const std::string LIM_KEY = "integrated-menus";
26+const std::string SHOW_MENUS_NOW_DELAY = "show-menus-now-delay";
27 const std::string ALWAYS_SHOW_MENUS_KEY = "always-show-menus";
28 }
29
30@@ -68,11 +69,15 @@
31 signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + LIM_KEY, [this] (GSettings*, const gchar*) {
32 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());
33 });
34+ signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + SHOW_MENUS_NOW_DELAY, [this] (GSettings*, const gchar*) {
35+ parent_->show_menus_wait = g_settings_get_uint(settings_, SHOW_MENUS_NOW_DELAY.c_str());
36+ });
37 signals_.Add<void, GSettings*, const gchar*>(settings_, "changed::" + ALWAYS_SHOW_MENUS_KEY, [this] (GSettings*, const gchar*) {
38 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());
39 });
40
41 parent_->integrated_menus = g_settings_get_boolean(settings_, LIM_KEY.c_str());
42+ parent_->show_menus_wait = g_settings_get_uint(settings_, SHOW_MENUS_NOW_DELAY.c_str());
43 parent_->always_show_menus = g_settings_get_boolean(settings_, ALWAYS_SHOW_MENUS_KEY.c_str());
44 parent_->menu_open = indicators_->GetActiveEntry() != nullptr;
45 }