Merge lp:~aacid/unity-2d/cornerreveal into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 1040
Merged at revision: 1043
Proposed branch: lp:~aacid/unity-2d/cornerreveal
Merge into: lp:unity-2d
Diff against target: 187 lines (+74/-2)
5 files modified
data/com.canonical.Unity2d.gschema.xml (+8/-0)
shell/Shell.qml (+2/-2)
tests/launcher/autohide_show_tests.rb (+14/-0)
tests/launcher/autohide_show_tests_common.rb (+36/-0)
tests/launcher/autohide_show_tests_rtl.rb (+14/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/cornerreveal
Reviewer Review Type Date Requested Status
Paweł Stołowski Pending
Review via email: mp+100744@code.launchpad.net

Commit message

[Launcher] Add the corner reveal option

Description of the change

[Launcher] Add the corner reveal option

To post a comment you must log in.
Revision history for this message
Unity Merger (unity-merger) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/com.canonical.Unity2d.gschema.xml'
2--- data/com.canonical.Unity2d.gschema.xml 2012-03-22 11:08:54 +0000
3+++ data/com.canonical.Unity2d.gschema.xml 2012-04-04 13:03:24 +0000
4@@ -41,6 +41,14 @@
5 2: intellihide; same as auto hide but the launcher will disappear if a window is placed on top of it
6 </description>
7 </key>
8+ <key type="i" name="reveal-mode">
9+ <default>0</default>
10+ <summary>Reveal mode</summary>
11+ <description>Possible values:
12+ 0: Reveal the launcher by pushing the mouse against the left side of the screen (right in RTL)
13+ 1: Reveal the launcher by pushing the mouse against the top-left corner of the screen (top-right in RTL)
14+ </description>
15+ </key>
16 <key name="edge-responsiveness" type="d">
17 <default>2</default>
18 <summary>Responsiveness of the Launcher</summary>
19
20=== modified file 'shell/Shell.qml'
21--- shell/Shell.qml 2012-04-04 00:25:35 +0000
22+++ shell/Shell.qml 2012-04-04 13:03:24 +0000
23@@ -285,8 +285,8 @@
24 triggerOnly: enableTrigger && !enableSticky
25 p1: Qt.point(x, declarativeView.screen.geometry.y)
26 p2: Qt.point(x, declarativeView.screen.geometry.y + declarativeView.screen.geometry.height)
27- triggerZoneP1: Qt.point(x, declarativeView.globalPosition.y)
28- triggerZoneP2: Qt.point(x, declarativeView.globalPosition.y + launcherLoader.height)
29+ triggerZoneP1: Qt.point(x, launcher2dConfiguration.revealMode == 1 ? declarativeView.screen.geometry.y : declarativeView.globalPosition.y)
30+ triggerZoneP2: Qt.point(x, launcher2dConfiguration.revealMode == 1 ? declarativeView.screen.geometry.y + 1 : declarativeView.globalPosition.y + launcherLoader.height)
31 threshold: (enableSticky || enableTrigger) ? launcher2dConfiguration.edgeStopVelocity : -1
32 maxVelocityMultiplier: launcher2dConfiguration.edgeResponsiveness
33 decayRate: launcher2dConfiguration.edgeDecayrate
34
35=== modified file 'tests/launcher/autohide_show_tests.rb'
36--- tests/launcher/autohide_show_tests.rb 2012-03-30 13:44:54 +0000
37+++ tests/launcher/autohide_show_tests.rb 2012-04-04 13:03:24 +0000
38@@ -33,6 +33,7 @@
39 context "Launcher Autohide and Show Tests" do
40 launcher_favorites = ""
41 hide_mode = 0
42+ reveal_mode = false
43
44 def verify_launcher_visible(timeout, message = '')
45 verify_equal( 0, timeout, message ) {
46@@ -55,6 +56,10 @@
47 XDo::Mouse.move(0, 200, 0, true)
48 end
49
50+ def move_mouse_to_screen_corner()
51+ XDo::Mouse.move(0, 0, 0, true)
52+ end
53+
54 def mouse_push_screen_edge
55 (1..100).each do |i|
56 $SUT.execute_shell_command 'xdotool mousemove_relative -- -10 0'
57@@ -83,10 +88,14 @@
58 $SUT.execute_shell_command 'killall unity-2d-shell'
59
60 hide_mode = $SUT.execute_shell_command 'gsettings get com.canonical.Unity2d.Launcher hide-mode'
61+ reveal_mode = $SUT.execute_shell_command 'gsettings get com.canonical.Unity2d.Launcher reveal-mode'
62
63 # Set hide mode to intellihide
64 $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode 2'
65
66+ # Set reveal mode to side
67+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher reveal-mode 0'
68+
69 # Minimize all windows
70 XDo::XWindow.toggle_minimize_all
71 end
72@@ -94,6 +103,7 @@
73 # Run once at the end of this test suite
74 shutdown do
75 $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode ' + hide_mode
76+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher reveal-mode ' + reveal_mode
77 end
78
79 # Run before each test case begins
80@@ -203,4 +213,8 @@
81 test_auto_hide_launcher_mouse_move_just_after_barrier_trigger()
82 end
83
84+ test "Auto Hide: Launcher mouse corner reveal" do
85+ test_auto_hide_launcher_mouse_corner_reveal()
86+ end
87+
88 end
89
90=== modified file 'tests/launcher/autohide_show_tests_common.rb'
91--- tests/launcher/autohide_show_tests_common.rb 2012-03-30 13:44:54 +0000
92+++ tests/launcher/autohide_show_tests_common.rb 2012-04-04 13:03:24 +0000
93@@ -647,3 +647,39 @@
94 XDo::Mouse.move(300, 300, 0, true)
95 verify_launcher_hidden(TIMEOUT, 'Launcher should not be visible after moving the mouse away')
96 end
97+
98+# Test case objectives:
99+# * Auto Hide: Launcher reveal with mouse on the corner
100+# Pre-conditions
101+# * Desktop with no running applications
102+# Test steps
103+# * Set hide-mode to 1
104+# * Set reveal-mode to 1
105+# * Move mouse away from launcher
106+# * Verify Launcher hides
107+# * Move mouse to screen edge
108+# * Verify Launcher still hiding
109+# * Press the edge
110+# * Verify Launcher still hiding
111+# * Move mouse to screen corner
112+# * Verify Launcher still hiding
113+# * Press the corner
114+# * Verify Launcher shows
115+# Post-conditions
116+# * None
117+# References
118+# * None
119+def test_auto_hide_launcher_mouse_corner_reveal
120+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode 1'
121+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher reveal-mode 1'
122+ XDo::Mouse.move(300, 300, 0, true)
123+ verify_launcher_hidden(TIMEOUT, 'Launcher should not be visible immediately without pushing the edge')
124+ move_mouse_to_screen_edge()
125+ verify_launcher_hidden(0, 'Launcher should not be visible immediately without pushing the corner')
126+ mouse_push_screen_edge()
127+ verify_launcher_hidden(2, 'Launcher should not be visible by pushing the edge on corner-reveal enabled')
128+ move_mouse_to_screen_corner()
129+ verify_launcher_hidden(0, 'Launcher should not be visible immediately without pushing the corner')
130+ mouse_push_screen_edge()
131+ verify_launcher_visible(TIMEOUT, 'Launcher hidden, should be visible')
132+end
133
134=== modified file 'tests/launcher/autohide_show_tests_rtl.rb'
135--- tests/launcher/autohide_show_tests_rtl.rb 2012-03-30 13:44:54 +0000
136+++ tests/launcher/autohide_show_tests_rtl.rb 2012-04-04 13:03:24 +0000
137@@ -33,6 +33,7 @@
138 context "Launcher Autohide and Show Tests on RTL" do
139 launcher_favorites = ""
140 hide_mode = 0
141+ reveal_mode = false
142
143 def verify_launcher_visible(timeout, message = '')
144 verify_equal( XDo::XWindow.display_geometry[0] - LAUNCHER_WIDTH, timeout, message ) {
145@@ -56,6 +57,10 @@
146 XDo::Mouse.move(XDo::XWindow.display_geometry[0], 200, 0, true)
147 end
148
149+ def move_mouse_to_screen_corner()
150+ XDo::Mouse.move(XDo::XWindow.display_geometry[0], 0, 0, true)
151+ end
152+
153 def mouse_push_screen_edge
154 (1..100).each do |i|
155 $SUT.execute_shell_command 'xdotool mousemove_relative 10 0'
156@@ -84,10 +89,14 @@
157 $SUT.execute_shell_command 'killall unity-2d-shell'
158
159 hide_mode = $SUT.execute_shell_command 'gsettings get com.canonical.Unity2d.Launcher hide-mode'
160+ reveal_mode = $SUT.execute_shell_command 'gsettings get com.canonical.Unity2d.Launcher reveal-mode'
161
162 # Set hide mode to intellihide
163 $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode 2'
164
165+ # Set reveal mode to side
166+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher reveal-mode 0'
167+
168 # Minimize all windows
169 XDo::XWindow.toggle_minimize_all
170 end
171@@ -95,6 +104,7 @@
172 # Run once at the end of this test suite
173 shutdown do
174 $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode ' + hide_mode
175+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher reveal-mode ' + reveal_mode
176 end
177
178 # Run before each test case begins
179@@ -204,4 +214,8 @@
180 test_auto_hide_launcher_mouse_move_just_after_barrier_trigger()
181 end
182
183+ test "Auto Hide: Launcher mouse corner reveal" do
184+ test_auto_hide_launcher_mouse_corner_reveal()
185+ end
186+
187 end

Subscribers

People subscribed via source and target branches