on xenial help sign in
Support the simplified theming from ubuntu-ui-toolkit.

Approved by Michael Zanetti, PS Jenkins bot, Michał Sawicz.

commit1d88b3102c5985b08a520b7aace3cde170b8b85c authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 28 Jun 2013, 17:44 (13 years ago) parent1ecc4dfb5d9385
8 files changed+19−70
Components/FilterGrid.qml+1−1 Components/PageHeader.qml+2−2 Components/Tile.qml+1−1 Components/UbuntuShapeForItem.qml+12−56 Dash/Apps/RunningApplicationTile.qml+1−1 Dash/Music/AlbumTile.qml+1−1 Hud/SearchBar.qml−7 Hud/ToolBarIcon.qml+1−1
Components/FilterGrid.qml+1−1
@@ -108,7 +108,7 @@ Item {
108108
109109 anchors.fill: parent
110110 radius: "small"
111− borderSource: ItemStyle.style.borderPressed
111+ borderSource: "radius_pressed.sci"
112112 opacity: button.pressed ? 1.0 : 0.0
113113 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
114114 }
Components/PageHeader.qml+2−2
@@ -149,7 +149,7 @@ Item {
149149
150150 primaryItem: Button {
151151 enabled: searchField.text != ""
152− ItemStyle.class: "transparent-button"
152+ color: "transparent"
153153 onClicked: {
154154 if (searchField.text != "") {
155155 searchHistory.addQuery(searchField.text)
@@ -272,7 +272,7 @@ Item {
272272 // FIXME: this should go into the first item below, but enable: false
273273 // prevents mouse events propagation
274274 Button {
275− ItemStyle.class: "transparent-button"
275+ color: "transparent"
276276 anchors {
277277 top: parent.top
278278 right: parent.right
Components/Tile.qml+1−1
@@ -51,7 +51,7 @@ AbstractButton {
5151
5252 anchors.fill: icon
5353 radius: "medium"
54− borderSource: ItemStyle.style.borderPressed
54+ borderSource: "radius_pressed.sci"
5555 opacity: root.pressed ? 1.0 : 0.0
5656 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
5757 }
Components/UbuntuShapeForItem.qml+12−56
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18−import Ubuntu.Components 0.1 as Theming
18+import Ubuntu.Components 0.1
1919
2020/* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more
2121 * general (Item-based) components. This ability should be incorporated into the SDK's
@@ -24,66 +24,22 @@ import Ubuntu.Components 0.1 as Theming
2424 */
2525
2626Item {
27− id: shape
27+ id: root
2828
29− Theming.ItemStyle.class: "UbuntuShape-radius-" + radius
29+ property alias radius: shape.radius
30+ property alias image: source.sourceItem
3031
31− property string radius: "small"
32− property url maskSource: Theming.ComponentUtils.style(shape, "maskSource", "")
33− property url borderSource: Theming.ComponentUtils.style(shape, "borderIdle", "")
34− property Item image
35−
36− implicitWidth: units.gu(8)
37− implicitHeight: units.gu(8)
38−
39− onWidthChanged: __updateImageDimensions()
40− onHeightChanged: __updateImageDimensions()
41− onImageChanged: __updateImageDimensions()
42−
43− function __updateImageDimensions() {
44− if (!image) return;
45− image.width = shape.width;
46− image.height = shape.height;
47− image.visible = false;
48− }
49−
50− ShaderEffect {
51− anchors.fill: parent
52− visible: shape.image
53−
54− property ShaderEffectSource mask: ShaderEffectSource {
55− sourceItem: BorderImage {
56− width: shape.width
57− height: shape.height
58− source: shape.maskSource
59− visible: false
60− }
61− }
62−
63− property ShaderEffectSource image: ShaderEffectSource {
64− sourceItem: shape.image
65− }
66−
67− fragmentShader:
68− "
69− varying highp vec2 qt_TexCoord0;
70− uniform lowp float qt_Opacity;
71− uniform sampler2D mask;
72− uniform sampler2D image;
73−
74− void main(void)
75− {
76− lowp vec4 maskColor = texture2D(mask, qt_TexCoord0.st);
77− lowp vec4 imageColor = texture2D(image, qt_TexCoord0.st);
78− gl_FragColor = imageColor * maskColor.a * qt_Opacity;
79− }
80− "
32+ ShaderEffectSource {
33+ id: source
34+ width: 1
35+ height: 1
36+ hideSource: true
8137 }
8238
83− BorderImage {
84− id: border
39+ Shape {
40+ id: shape
41+ image: source
8542
8643 anchors.fill: parent
87− source: shape.borderSource
8844 }
8945}
Dash/Apps/RunningApplicationTile.qml+1−1
@@ -87,7 +87,7 @@ AbstractButton {
8787
8888 anchors.fill: shapedApplicationImage
8989 radius: "medium"
90− borderSource: ItemStyle.style.borderPressed
90+ borderSource: "radius_pressed.sci"
9191 opacity: root.pressed ? 1.0 : 0.0
9292 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
9393 }
Dash/Music/AlbumTile.qml+1−1
@@ -45,7 +45,7 @@ AbstractButton {
4545
4646 anchors.fill: icon
4747 radius: "medium"
48− borderSource: ItemStyle.style.borderPressed
48+ borderSource: "radius_pressed.sci"
4949 opacity: root.pressed ? 1.0 : 0.0
5050 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
5151 }
Hud/SearchBar.qml−7
@@ -55,13 +55,6 @@ Item {
5555 }
5656 }
5757
58− // Don't let the style play with our opacity
59− Binding {
60− target: searchBar.ItemStyle.style
61− property: "opacity"
62− value: 1
63− }
64−
6558 Item {
6659 id: primary
6760 height: searchBar.height
Hud/ToolBarIcon.qml+1−1
@@ -18,7 +18,7 @@ import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919
2020Button {
21− ItemStyle.class: "transparent-button"
21+ color: "transparent"
2222
2323 property alias source: image.source
2424