Merge lp:~osomon/webbrowser-app/custom-media-access-dialog into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1382
Merged at revision: 1400
Proposed branch: lp:~osomon/webbrowser-app/custom-media-access-dialog
Merge into: lp:webbrowser-app
Diff against target: 106 lines (+50/-19)
1 file modified
src/app/webbrowser/MediaAccessDialog.qml (+50/-19)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/custom-media-access-dialog
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+288687@code.launchpad.net

Commit message

Customize the contents of the media permission dialog to avoid truncated text.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1381. By Olivier Tilloy

Updated dialog implementation per visual design feedback.

1382. By Olivier Tilloy

Add missing separator.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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 'src/app/webbrowser/MediaAccessDialog.qml'
2--- src/app/webbrowser/MediaAccessDialog.qml 2015-10-19 12:10:28 +0000
3+++ src/app/webbrowser/MediaAccessDialog.qml 2016-03-14 12:06:30 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2015 Canonical Ltd.
7+ * Copyright 2015-2016 Canonical Ltd.
8 *
9 * This file is part of webbrowser-app.
10 *
11@@ -24,30 +24,54 @@
12 property var request
13 modal: true
14
15- title: request.isForAudio && request.isForVideo ?
16- i18n.tr("Allow this domain to access your camera and microphone?") :
17- (request.isForVideo ? i18n.tr("Allow this domain to access your camera?")
18- : i18n.tr("Allow this domain to access your microphone?"))
19-
20- text: request.embedder.toString() !== request.origin.toString() ?
21- internal.textWhenEmbedded : request.origin
22+ Label {
23+ elide: Text.ElideRight
24+ textSize: Label.Large
25+ color: theme.palette.normal.overlayText
26+ text: i18n.tr("Permission")
27+ }
28+
29+ Label {
30+ color: theme.palette.normal.baseText
31+ wrapMode: Text.Wrap
32+ text: (request.isForAudio && request.isForVideo)
33+ ? i18n.tr("Allow this domain to access your camera and microphone?")
34+ : (request.isForVideo ? i18n.tr("Allow this domain to access your camera?")
35+ : i18n.tr("Allow this domain to access your microphone?"))
36+ }
37+
38+ Label {
39+ color: theme.palette.normal.baseText
40+ wrapMode: Text.Wrap
41+ text: (request.embedder.toString() !== request.origin.toString())
42+ // TRANSLATORS: %1 is the URL of the site requesting access to camera and/or microphone and %2 is the URL of the site that embeds it
43+ ? i18n.tr("%1 (embedded in %2)").arg(request.origin).arg(request.embedder)
44+ : request.origin
45+ }
46+
47+ Item {
48+ height: units.gu(2)
49+ Rectangle {
50+ anchors {
51+ left: parent.left
52+ right: parent.right
53+ bottom: parent.bottom
54+ }
55+ height: units.dp(1)
56+ color: theme.palette.normal.base
57+ }
58+ }
59
60 Row {
61- id: internal
62-
63- // TRANSLATORS: %1 is the URL of the site requesting access to camera and/or microphone and %2 is the URL of the site that embeds it
64- readonly property string textWhenEmbedded: i18n.tr("%1 (embedded in %2)")
65- .arg(request.origin).arg(request.embedder)
66 height: units.gu(4)
67 spacing: units.gu(2)
68- anchors.horizontalCenter: parent.horizontalCenter
69+ layoutDirection: Qt.RightToLeft
70
71 Button {
72- id: allowButton
73 objectName: "mediaAccessDialog.allowButton"
74 text: i18n.tr("Yes")
75 color: UbuntuColors.green
76- width: units.gu(14)
77+ width: units.gu(10)
78 onClicked: {
79 request.allow()
80 hide()
81@@ -55,15 +79,22 @@
82 }
83
84 Button {
85- id: denyButton
86 objectName: "mediaAccessDialog.denyButton"
87 text: i18n.tr("No")
88- color: UbuntuColors.red
89- width: units.gu(14)
90+ color: UbuntuColors.lightGrey
91+ width: units.gu(10)
92 onClicked: {
93 request.deny()
94 hide()
95 }
96 }
97 }
98+
99+ // adjust default dialog visuals to custom design requirements
100+ // (should not be needed when updated dialog implementation lands in UITK)
101+ Binding {
102+ target: __foreground
103+ property: "margins"
104+ value: units.gu(2)
105+ }
106 }

Subscribers

People subscribed via source and target branches

to status/vote changes: