on xenial help sign in
review fixes
4e68c9fAlbert Astals Cid
qml/Components/MediaServices/MediaServices.qml+18−18
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2015 Canonical, Ltd.
2+ * Copyright (C) 2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -37,6 +37,9 @@ FocusScope {
37 if (!fullscreen) rotationAction.checked = false;
37 if (!fullscreen) rotationAction.checked = false;
38 }
38 }
39
39
40+ readonly property color backgroundColor: "#1B1B1B"
41+ readonly property color iconColor: "#F3F3E7"
42+
40 OrientationHelper {
43 OrientationHelper {
41 id: orientationHelper
44 id: orientationHelper
42 automaticOrientation: fullscreen
45 automaticOrientation: fullscreen
@@ -88,7 +91,7 @@ FocusScope {
88
91
89 Rectangle {
92 Rectangle {
90 anchors.fill: parent
93 anchors.fill: parent
91− color: "#1B1B1B"
94+ color: root.backgroundColor
92 opacity: 0.85
95 opacity: 0.85
93 }
96 }
94
97
@@ -104,6 +107,9 @@ FocusScope {
104 fixedHeight: fullscreen
107 fixedHeight: fullscreen
105 orientation: orientationState.state == "landscape" ? Qt.LandscapeOrientation : Qt.PortraitOrientation
108 orientation: orientationState.state == "landscape" ? Qt.LandscapeOrientation : Qt.PortraitOrientation
106
109
110+ playButtonBackgroundColor: root.backgroundColor
111+ playButtonIconColor: root.iconColor
112+
107 screenshot: {
113 screenshot: {
108 var screenshot = root.sourceData["screenshot"];
114 var screenshot = root.sourceData["screenshot"];
109 if (screenshot) return screenshot;
115 if (screenshot) return screenshot;
@@ -145,7 +151,7 @@ FocusScope {
145 top: contentLoader.top
151 top: contentLoader.top
146 left: parent.left
152 left: parent.left
147 right: parent.right
153 right: parent.right
148− topMargin: -units.gu(6)
154+ topMargin: -headerContent.height
149 }
155 }
150 height: units.gu(6)
156 height: units.gu(6)
151 visible: false
157 visible: false
@@ -157,7 +163,7 @@ FocusScope {
157
163
158 Rectangle {
164 Rectangle {
159 anchors.fill: parent
165 anchors.fill: parent
160− color: "#1B1B1B"
166+ color: root.backgroundColor
161 opacity: 0.85
167 opacity: 0.85
162 visible: headerContent.status === Loader.Ready
168 visible: headerContent.status === Loader.Ready
163 }
169 }
@@ -172,14 +178,6 @@ FocusScope {
172 rotationAction.checked = false;
178 rotationAction.checked = false;
173 root.close();
179 root.close();
174 }
180 }
175−
176− component: {
177− switch (context) {
178− case "video":
179− break;
180− }
181− return undefined;
182− }
183 }
181 }
184 }
182 }
185
183
@@ -199,7 +197,7 @@ FocusScope {
199 left: parent.left
197 left: parent.left
200 right: parent.right
198 right: parent.right
201 bottom: contentLoader.bottom
199 bottom: contentLoader.bottom
202− bottomMargin: -units.gu(7)
200+ bottomMargin: -footerContent.height
203 }
201 }
204 height: units.gu(7)
202 height: units.gu(7)
205 visible: false
203 visible: false
@@ -218,7 +216,7 @@ FocusScope {
218
216
219 Rectangle {
217 Rectangle {
220 anchors.fill: parent
218 anchors.fill: parent
221− color: "#1B1B1B"
219+ color: root.backgroundColor
222 opacity: 0.85
220 opacity: 0.85
223 visible: footerContent.status === Loader.Ready
221 visible: footerContent.status === Loader.Ready
224 }
222 }
@@ -231,15 +229,17 @@ FocusScope {
231
229
232 viewAction: rotationAction.enabled ? rotationAction : fullscreenAction
230 viewAction: rotationAction.enabled ? rotationAction : fullscreenAction
233 userActions: root.actions
231 userActions: root.actions
232+ iconColor: root.iconColor
233+ backgroundColor: root.backgroundColor
234
234
235 mediaPlayer.source: {
235 mediaPlayer.source: {
236 if (!root.sourceData) return "";
236 if (!root.sourceData) return "";
237
237
238− var x = root.sourceData["source"];
238+ var source = root.sourceData["source"];
239− if (x.toString().indexOf("video://") === 0) {
239+ if (source.toString().indexOf("video://") === 0) {
240− return x.toString().substr(6);
240+ return source.toString().substr(6);
241 }
241 }
242− return x;
242+ return source;
243 }
243 }
244 mediaPlayer.onPlaybackStateChanged: {
244 mediaPlayer.onPlaybackStateChanged: {
245 controlHideTimer.restart();
245 controlHideTimer.restart();
qml/Components/MediaServices/MediaServicesControls.qml+8−5
@@ -31,6 +31,9 @@ Item {
31 property list<Action> userActions
31 property list<Action> userActions
32 property Action viewAction
32 property Action viewAction
33
33
34+ property color iconColor
35+ property color backgroundColor
36+
34 RowLayout {
37 RowLayout {
35 anchors {
38 anchors {
36 left: parent.left
39 left: parent.left
@@ -68,7 +71,7 @@ Item {
68 anchors.fill: parent
71 anchors.fill: parent
69 visible: actionButton.action && actionButton.action.iconSource !== "" || false
72 visible: actionButton.action && actionButton.action.iconSource !== "" || false
70 source: actionButton.action ? actionButton.action.iconSource : ""
73 source: actionButton.action ? actionButton.action.iconSource : ""
71− color: "#F3F3E7"
74+ color: root.iconColor
72 opacity: actionButton.action && actionButton.action.enabled ? 1.0 : 0.5
75 opacity: actionButton.action && actionButton.action.enabled ? 1.0 : 0.5
73 }
76 }
74 }
77 }
@@ -91,7 +94,7 @@ Item {
91 anchors.fill: parent
94 anchors.fill: parent
92 visible: viewAction.iconSource !== ""
95 visible: viewAction.iconSource !== ""
93 source: viewAction.iconSource
96 source: viewAction.iconSource
94− color: "#F3F3E7"
97+ color: root.iconColor
95 opacity: viewAction.enabled ? 1.0 : 0.5
98 opacity: viewAction.enabled ? 1.0 : 0.5
96 }
99 }
97 }
100 }
@@ -102,7 +105,7 @@ Item {
102
105
103 Rectangle {
106 Rectangle {
104 id: popup
107 id: popup
105− color: "#1B1B1B"
108+ color: root.backgroundColor
106 width: userActionsColumn.width
109 width: userActionsColumn.width
107 height: userActionsColumn.height
110 height: userActionsColumn.height
108
111
@@ -147,7 +150,7 @@ Item {
147 id: actionIcon
150 id: actionIcon
148 visible: "" !== action.iconSource
151 visible: "" !== action.iconSource
149 source: action.iconSource
152 source: action.iconSource
150− color: "#F3F3E7"
153+ color: root.iconColor
151 anchors {
154 anchors {
152 verticalCenter: parent.verticalCenter
155 verticalCenter: parent.verticalCenter
153 verticalCenterOffset: units.dp(-1)
156 verticalCenterOffset: units.dp(-1)
@@ -172,7 +175,7 @@ Item {
172 fontSize: actionIcon.visible ? "small" : "medium"
175 fontSize: actionIcon.visible ? "small" : "medium"
173 elide: Text.ElideRight
176 elide: Text.ElideRight
174 text: action.text
177 text: action.text
175− color: "#F3F3E7"
178+ color: root.iconColor
176 opacity: action.enabled ? 1.0 : 0.5
179 opacity: action.enabled ? 1.0 : 0.5
177 }
180 }
178
181
qml/Components/MediaServices/MediaServicesHeader.qml+2−2
@@ -23,6 +23,7 @@ Item {
23
23
24 property alias title: _title.text
24 property alias title: _title.text
25 property alias component: loader.sourceComponent
25 property alias component: loader.sourceComponent
26+ property alias iconColor: _title.color
26
27
27 signal goPrevious
28 signal goPrevious
28
29
@@ -47,7 +48,7 @@ Item {
47 Icon {
48 Icon {
48 anchors.fill: parent
49 anchors.fill: parent
49 name: "go-previous"
50 name: "go-previous"
50− color: "#F3F3E7"
51+ color: _title.color
51 }
52 }
52
53
53 onTriggered: {
54 onTriggered: {
@@ -60,7 +61,6 @@ Item {
60 Layout.fillWidth: true
61 Layout.fillWidth: true
61 Layout.alignment: Qt.AlignVCenter
62 Layout.alignment: Qt.AlignVCenter
62 elide: Text.ElideRight
63 elide: Text.ElideRight
63− color: "#F3F3E7"
64 }
64 }
65
65
66 Loader {
66 Loader {
qml/Components/MediaServices/VideoPlayer.qml+4−2
@@ -29,6 +29,9 @@ Item {
29 property bool fixedHeight: false
29 property bool fixedHeight: false
30 property var maximumEmbeddedHeight
30 property var maximumEmbeddedHeight
31
31
32+ property alias playButtonBackgroundColor: playButton.color
33+ property alias playButtonIconColor: playButtonIcon.color
34+
32 implicitHeight: {
35 implicitHeight: {
33 if (parent && orientation == Qt.LandscapeOrientation) {
36 if (parent && orientation == Qt.LandscapeOrientation) {
34 return parent.height;
37 return parent.height;
@@ -112,17 +115,16 @@ Item {
112 width: bigButton ? units.gu(10) : units.gu(8)
115 width: bigButton ? units.gu(10) : units.gu(8)
113 height: width
116 height: width
114 visible: mediaPlayer && mediaPlayer.playbackState !== MediaPlayer.PlayingState || false
117 visible: mediaPlayer && mediaPlayer.playbackState !== MediaPlayer.PlayingState || false
115− color: "#1B1B1B"
116 opacity: 0.85
118 opacity: 0.85
117 radius: width/2
119 radius: width/2
118
120
119 Behavior on width { UbuntuNumberAnimation {} }
121 Behavior on width { UbuntuNumberAnimation {} }
120
122
121 Icon {
123 Icon {
124+ id: playButtonIcon
122 anchors.fill: parent
125 anchors.fill: parent
123 anchors.margins: units.gu(1)
126 anchors.margins: units.gu(1)
124 name: errorTimer.running ? "dialog-warning-symbolic" : "media-playback-start"
127 name: errorTimer.running ? "dialog-warning-symbolic" : "media-playback-start"
125− color: "#F3F3E7"
126 }
128 }
127 }
129 }
128
130
qml/Components/MediaServices/VideoPlayerControls.qml+3−3
@@ -81,7 +81,7 @@ MediaServicesControls {
81 }
81 }
82 verticalAlignment: Text.AlignBottom
82 verticalAlignment: Text.AlignBottom
83 fontSize: "x-small"
83 fontSize: "x-small"
84− color: "#F3F3E7"
84+ color: root.iconColor
85
85
86 text: priv.formatProgress(mediaPlayer.position)
86 text: priv.formatProgress(mediaPlayer.position)
87 }
87 }
@@ -102,7 +102,7 @@ MediaServicesControls {
102 value: mediaPlayer.position
102 value: mediaPlayer.position
103
103
104 onStyleInstanceChanged: {
104 onStyleInstanceChanged: {
105− if (__styleInstance) __styleInstance.backgroundColor = "#F3F3E7";
105+ if (__styleInstance) __styleInstance.backgroundColor = root.iconColor;
106 }
106 }
107
107
108 onValueChanged: {
108 onValueChanged: {
@@ -141,7 +141,7 @@ MediaServicesControls {
141 }
141 }
142 verticalAlignment: Text.AlignBottom
142 verticalAlignment: Text.AlignBottom
143 fontSize: "x-small"
143 fontSize: "x-small"
144− color: "#F3F3E7"
144+ color: root.iconColor
145
145
146 text: priv.formatProgress(mediaPlayer.duration)
146 text: priv.formatProgress(mediaPlayer.duration)
147 }
147 }