Merge lp:~osomon/webbrowser-app/zoom-qwerty-keyboard into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Bill Filler
Approved revision: 1536
Merged at revision: 1537
Proposed branch: lp:~osomon/webbrowser-app/zoom-qwerty-keyboard
Merge into: lp:webbrowser-app
Diff against target: 55 lines (+27/-0)
2 files modified
src/app/webbrowser/Browser.qml (+16/-0)
tests/autopilot/webbrowser_app/tests/test_keyboard.py (+11/-0)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/zoom-qwerty-keyboard
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
system-apps-ci-bot continuous-integration Needs Fixing
Andrew Hayzen (community) Approve
Review via email: mp+306132@code.launchpad.net

Commit message

Add "Ctrl+=" and "Ctrl+_" as shortcuts for zoom in and zoom out actions,
for improved compatibility with qwerty-based keyboard layouts.

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Tested on various keyboard layouts on unity7.

LGTM and unit tests pass :-)

review: Approve
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:1536
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/645/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/1555
    UNSTABLE: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/363
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1555
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1403
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1403/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1403
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1403/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1403
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1403/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1403
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1403/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1403
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1403/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1403
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1403/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1403
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1403/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1403
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1403/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1403
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1403/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-webbrowser-app-ci/645/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

works for me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/Browser.qml'
2--- src/app/webbrowser/Browser.qml 2016-07-01 08:52:37 +0000
3+++ src/app/webbrowser/Browser.qml 2016-09-19 18:03:22 +0000
4@@ -2144,6 +2144,14 @@
5 ((currentWebview.maximumZoomFactor - currentWebview.zoomFactor) > 0.001)
6 onActivated: internal.changeZoomFactor(1)
7 }
8+ // For improved compatibility with qwerty-based keyboard layouts, where "="
9+ // and "+" are on the same key (see https://launchpad.net/bugs/1624381):
10+ Shortcut {
11+ sequence: "Ctrl+="
12+ enabled: currentWebview &&
13+ ((currentWebview.maximumZoomFactor - currentWebview.zoomFactor) > 0.001)
14+ onActivated: internal.changeZoomFactor(1)
15+ }
16
17 // Ctrl+Minus: zoom out
18 Shortcut {
19@@ -2152,6 +2160,14 @@
20 ((currentWebview.zoomFactor - currentWebview.minimumZoomFactor) > 0.001)
21 onActivated: internal.changeZoomFactor(-1)
22 }
23+ // For improved compatibility with qwerty-based keyboard layouts, where "-"
24+ // and "_" are on the same key (see https://launchpad.net/bugs/1624381):
25+ Shortcut {
26+ sequence: "Ctrl+_"
27+ enabled: currentWebview &&
28+ ((currentWebview.zoomFactor - currentWebview.minimumZoomFactor) > 0.001)
29+ onActivated: internal.changeZoomFactor(-1)
30+ }
31
32 // Ctrl+0: reset zoom factor to 1.0
33 Shortcut {
34
35=== modified file 'tests/autopilot/webbrowser_app/tests/test_keyboard.py'
36--- tests/autopilot/webbrowser_app/tests/test_keyboard.py 2016-05-23 15:49:49 +0000
37+++ tests/autopilot/webbrowser_app/tests/test_keyboard.py 2016-09-19 18:03:22 +0000
38@@ -558,6 +558,17 @@
39 self.main_window.press_key('Ctrl+0')
40 self.assertThat(webview.zoomFactor, Eventually(AlmostEquals(1.0)))
41
42+ def test_zoom_qwerty_compatibility_shortcuts(self):
43+ # Ref: https://launchpad.net/bugs/1624381
44+ webview = self.main_window.get_current_webview()
45+ self.assertThat(webview.zoomFactor, Eventually(AlmostEquals(1.0)))
46+
47+ self.main_window.press_key('Ctrl+equal')
48+ self.assertThat(webview.zoomFactor, Eventually(AlmostEquals(1.1)))
49+
50+ self.main_window.press_key('Ctrl+underscore')
51+ self.assertThat(webview.zoomFactor, Eventually(AlmostEquals(1.0)))
52+
53 def test_zoom_affects_domain(self):
54 webview = self.main_window.get_current_webview()
55 self.assertThat(webview.zoomFactor, Eventually(AlmostEquals(1.0)))

Subscribers

People subscribed via source and target branches

to status/vote changes: