on xenial help sign in
Support the simplified theming from ubuntu-ui-toolkit.
1d88b31Michał Sawicz
Components/FilterGrid.qml+1−1
@@ -108,7 +108,7 @@ Item {
108
108
109 anchors.fill: parent
109 anchors.fill: parent
110 radius: "small"
110 radius: "small"
111− borderSource: ItemStyle.style.borderPressed
111+ borderSource: "radius_pressed.sci"
112 opacity: button.pressed ? 1.0 : 0.0
112 opacity: button.pressed ? 1.0 : 0.0
113 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
113 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
114 }
114 }
Components/PageHeader.qml+2−2
@@ -149,7 +149,7 @@ Item {
149
149
150 primaryItem: Button {
150 primaryItem: Button {
151 enabled: searchField.text != ""
151 enabled: searchField.text != ""
152− ItemStyle.class: "transparent-button"
152+ color: "transparent"
153 onClicked: {
153 onClicked: {
154 if (searchField.text != "") {
154 if (searchField.text != "") {
155 searchHistory.addQuery(searchField.text)
155 searchHistory.addQuery(searchField.text)
@@ -272,7 +272,7 @@ Item {
272 // FIXME: this should go into the first item below, but enable: false
272 // FIXME: this should go into the first item below, but enable: false
273 // prevents mouse events propagation
273 // prevents mouse events propagation
274 Button {
274 Button {
275− ItemStyle.class: "transparent-button"
275+ color: "transparent"
276 anchors {
276 anchors {
277 top: parent.top
277 top: parent.top
278 right: parent.right
278 right: parent.right
Components/Tile.qml+1−1
@@ -51,7 +51,7 @@ AbstractButton {
51
51
52 anchors.fill: icon
52 anchors.fill: icon
53 radius: "medium"
53 radius: "medium"
54− borderSource: ItemStyle.style.borderPressed
54+ borderSource: "radius_pressed.sci"
55 opacity: root.pressed ? 1.0 : 0.0
55 opacity: root.pressed ? 1.0 : 0.0
56 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
56 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
57 }
57 }
Components/UbuntuShapeForItem.qml+12−56
@@ -15,7 +15,7 @@
15 */
15 */
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18−import Ubuntu.Components 0.1 as Theming
18+import Ubuntu.Components 0.1
19
19
20/* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more
20/* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more
21 * general (Item-based) components. This ability should be incorporated into the SDK's
21 * general (Item-based) components. This ability should be incorporated into the SDK's
@@ -24,66 +24,22 @@ import Ubuntu.Components 0.1 as Theming
24 */
24 */
25
25
26Item {
26Item {
27− id: shape
27+ id: root
28
28
29− Theming.ItemStyle.class: "UbuntuShape-radius-" + radius
29+ property alias radius: shape.radius
30+ property alias image: source.sourceItem
30
31
31− property string radius: "small"
32+ ShaderEffectSource {
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
33+ id: source
59− visible: false
34+ width: 1
60− }
35+ height: 1
61− }
36+ hideSource: true
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− "
81 }
37 }
82
38
83− BorderImage {
39+ Shape {
84− id: border
40+ id: shape
41+ image: source
85
42
86 anchors.fill: parent
43 anchors.fill: parent
87− source: shape.borderSource
88 }
44 }
89}
45}
Dash/Apps/RunningApplicationTile.qml+1−1
@@ -87,7 +87,7 @@ AbstractButton {
87
87
88 anchors.fill: shapedApplicationImage
88 anchors.fill: shapedApplicationImage
89 radius: "medium"
89 radius: "medium"
90− borderSource: ItemStyle.style.borderPressed
90+ borderSource: "radius_pressed.sci"
91 opacity: root.pressed ? 1.0 : 0.0
91 opacity: root.pressed ? 1.0 : 0.0
92 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
92 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
93 }
93 }
Dash/Music/AlbumTile.qml+1−1
@@ -45,7 +45,7 @@ AbstractButton {
45
45
46 anchors.fill: icon
46 anchors.fill: icon
47 radius: "medium"
47 radius: "medium"
48− borderSource: ItemStyle.style.borderPressed
48+ borderSource: "radius_pressed.sci"
49 opacity: root.pressed ? 1.0 : 0.0
49 opacity: root.pressed ? 1.0 : 0.0
50 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
50 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
51 }
51 }
Hud/SearchBar.qml−7
@@ -55,13 +55,6 @@ Item {
55 }
55 }
56 }
56 }
57
57
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−
65 Item {
58 Item {
66 id: primary
59 id: primary
67 height: searchBar.height
60 height: searchBar.height
Hud/ToolBarIcon.qml+1−1
@@ -18,7 +18,7 @@ import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19
19
20Button {
20Button {
21− ItemStyle.class: "transparent-button"
21+ color: "transparent"
22
22
23 property alias source: image.source
23 property alias source: image.source
24
24