on xenial help sign in
Use symbolic names for the custom colors.
commitab7b4cdbb71677b4aefe2e44ed20ad05a862a8de authorMirco Müller <mirco.mueller@ubuntu.com> dateFri 6 Mar 2015, 17:35 (12 years ago) parent600fdff
1 file changed+16−13
qml/Notifications/SwipeToAct.qml+16−13
qml/Notifications/SwipeToAct.qml+16−13
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014-2015 Canonical, Ltd.
2+ * Copyright (C) 20014-2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -30,7 +30,10 @@ Item {
3030 property string rightIconName
3131 readonly property double sliderHeight: units.gu(8)
3232 readonly property double gap: units.gu(1)
33− readonly property color sliderDefault: "#b2b2b2"
33+ readonly property color sliderMainColor: "#b2b2b2"
34+ readonly property color green: "#38b44a"
35+ readonly property color red: "#df382c"
36+ readonly property color sliderBGColor: "#f4f4f4"
3437 readonly property double halfWay: mouseArea.drag.maximumX / 2
3538
3639 // linearly interpolate between start- and end-color
@@ -54,14 +57,14 @@ Item {
5457 id: row
5558 width: parent.width
5659 height: sliderHeight
57− color: "#f4f4f4"
60+ color: sliderBGColor
5861
5962 UbuntuShape {
6063 id: leftShape
6164 anchors.top: parent.top
6265 anchors.left: parent.left
6366 anchors.margins: gap
64− color: "#df382c" //UbuntuColors.red
67+ color: red
6568
6669 state: "normal"
6770 height: units.gu(6)
@@ -93,7 +96,7 @@ Item {
9396 Icon {
9497 name: "back"
9598 height: units.gu(2.5)
96− color: "#b2b2b2"
99+ color: sliderMainColor
97100 UbuntuNumberAnimation on opacity {
98101 from: .5
99102 to: 1
@@ -105,7 +108,7 @@ Item {
105108 Icon {
106109 name: "back"
107110 height: units.gu(2.5)
108− color: "#b2b2b2"
111+ color: sliderMainColor
109112 UbuntuNumberAnimation on opacity {
110113 from: 1
111114 to: .5
@@ -144,17 +147,17 @@ Item {
144147 if (slider.x <= gap + leftShape.width)
145148 {
146149 factor = (slider.x - gap) / leftShape.width
147− slider.color = interpolate(leftShape.color, sliderDefault, factor)
150+ slider.color = interpolate(leftShape.color, sliderMainColor, factor)
148151 } else if (slider.x >= rightShape.x - slider.width) {
149152 factor = (slider.x - rightShape.x + rightShape.width) / rightShape.width
150− slider.color = interpolate(sliderDefault, rightShape.color, factor)
153+ slider.color = interpolate(sliderMainColor, rightShape.color, factor)
151154 } else {
152− slider.color = "#b2b2b2"
155+ slider.color = sliderMainColor
153156 }
154157 }
155158
156159 z: 1
157− color: "#b2b2b2"
160+ color: sliderMainColor
158161 height: units.gu(6)
159162 width: units.gu(6)
160163 borderSource: "none"
@@ -175,7 +178,7 @@ Item {
175178 Icon {
176179 name: "next"
177180 height: units.gu(2.5)
178− color: "#b2b2b2"
181+ color: sliderMainColor
179182 UbuntuNumberAnimation on opacity {
180183 from: 1
181184 to: .5
@@ -187,7 +190,7 @@ Item {
187190 Icon {
188191 name: "next"
189192 height: units.gu(2.5)
190− color: "#b2b2b2"
193+ color: sliderMainColor
191194 UbuntuNumberAnimation on opacity {
192195 from: .5
193196 to: 1
@@ -203,7 +206,7 @@ Item {
203206 anchors.top: parent.top
204207 anchors.right: parent.right
205208 anchors.margins: gap
206− color: "#38b44a" // UbuntuColors.green
209+ color: green
207210
208211 state: "normal"
209212 height: units.gu(6)