Merge lp:~saviq/unity8/simple-theming into lp:unity8

Proposed by Michał Sawicz
Status: Merged
Approved by: Michael Zanetti
Approved revision: 57
Merged at revision: 58
Proposed branch: lp:~saviq/unity8/simple-theming
Merge into: lp:unity8
Diff against target: 200 lines (+25/-76)
8 files modified
Components/FilterGrid.qml (+1/-1)
Components/PageHeader.qml (+2/-2)
Components/Tile.qml (+1/-1)
Components/UbuntuShapeForItem.qml (+18/-62)
Dash/Apps/RunningApplicationTile.qml (+1/-1)
Dash/Music/AlbumTile.qml (+1/-1)
Hud/SearchBar.qml (+0/-7)
Hud/ToolBarIcon.qml (+1/-1)
To merge this branch: bzr merge lp:~saviq/unity8/simple-theming
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Approve
Review via email: mp+171812@code.launchpad.net

Commit message

Support the simplified theming from ubuntu-ui-toolkit.

To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) wrote :

29 Button {
30 - ItemStyle.class: "transparent-button"
31 + color: "transparent"

Actually I'm curios why this is a button at all. To me it doesn't seem we should load 2 UbuntuShapes just to not display them. Woudln't a MouseArea do the same job here, but with less resources ?

review: Needs Information
Revision history for this message
Michał Sawicz (saviq) wrote :

Indeed, there should be an AbstractButton that would simply be the MouseArea (and later keyboard handling).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) :
review: Approve
lp:~saviq/unity8/simple-theming updated
56. By Michał Sawicz

Bring back UbuntuShapeForItem.qml

57. By Michał Sawicz

Drop newline

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Tested after applying this: https://code.launchpad.net/~fboucault/ubuntu-ui-toolkit/button_no_background_when_transparent/+merge/171690

Works as expected.

I still disagree that we're using buttons at all here but that's just my opinion. The proposed solution works and looks as expected.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Components/FilterGrid.qml'
2--- Components/FilterGrid.qml 2013-06-05 22:03:08 +0000
3+++ Components/FilterGrid.qml 2013-06-28 12:59:28 +0000
4@@ -108,7 +108,7 @@
5
6 anchors.fill: parent
7 radius: "small"
8- borderSource: ItemStyle.style.borderPressed
9+ borderSource: "radius_pressed.sci"
10 opacity: button.pressed ? 1.0 : 0.0
11 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
12 }
13
14=== modified file 'Components/PageHeader.qml'
15--- Components/PageHeader.qml 2013-06-05 22:03:08 +0000
16+++ Components/PageHeader.qml 2013-06-28 12:59:28 +0000
17@@ -149,7 +149,7 @@
18
19 primaryItem: Button {
20 enabled: searchField.text != ""
21- ItemStyle.class: "transparent-button"
22+ color: "transparent"
23 onClicked: {
24 if (searchField.text != "") {
25 searchHistory.addQuery(searchField.text)
26@@ -272,7 +272,7 @@
27 // FIXME: this should go into the first item below, but enable: false
28 // prevents mouse events propagation
29 Button {
30- ItemStyle.class: "transparent-button"
31+ color: "transparent"
32 anchors {
33 top: parent.top
34 right: parent.right
35
36=== modified file 'Components/Tile.qml'
37--- Components/Tile.qml 2013-06-05 22:03:08 +0000
38+++ Components/Tile.qml 2013-06-28 12:59:28 +0000
39@@ -51,7 +51,7 @@
40
41 anchors.fill: icon
42 radius: "medium"
43- borderSource: ItemStyle.style.borderPressed
44+ borderSource: "radius_pressed.sci"
45 opacity: root.pressed ? 1.0 : 0.0
46 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
47 }
48
49=== modified file 'Components/UbuntuShapeForItem.qml'
50--- Components/UbuntuShapeForItem.qml 2013-06-05 22:03:08 +0000
51+++ Components/UbuntuShapeForItem.qml 2013-06-28 12:59:28 +0000
52@@ -15,7 +15,7 @@
53 */
54
55 import QtQuick 2.0
56-import Ubuntu.Components 0.1 as Theming
57+import Ubuntu.Components 0.1
58
59 /* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more
60 * general (Item-based) components. This ability should be incorporated into the SDK's
61@@ -24,66 +24,22 @@
62 */
63
64 Item {
65- id: shape
66-
67- Theming.ItemStyle.class: "UbuntuShape-radius-" + radius
68-
69- property string radius: "small"
70- property url maskSource: Theming.ComponentUtils.style(shape, "maskSource", "")
71- property url borderSource: Theming.ComponentUtils.style(shape, "borderIdle", "")
72- property Item image
73-
74- implicitWidth: units.gu(8)
75- implicitHeight: units.gu(8)
76-
77- onWidthChanged: __updateImageDimensions()
78- onHeightChanged: __updateImageDimensions()
79- onImageChanged: __updateImageDimensions()
80-
81- function __updateImageDimensions() {
82- if (!image) return;
83- image.width = shape.width;
84- image.height = shape.height;
85- image.visible = false;
86- }
87-
88- ShaderEffect {
89- anchors.fill: parent
90- visible: shape.image
91-
92- property ShaderEffectSource mask: ShaderEffectSource {
93- sourceItem: BorderImage {
94- width: shape.width
95- height: shape.height
96- source: shape.maskSource
97- visible: false
98- }
99- }
100-
101- property ShaderEffectSource image: ShaderEffectSource {
102- sourceItem: shape.image
103- }
104-
105- fragmentShader:
106- "
107- varying highp vec2 qt_TexCoord0;
108- uniform lowp float qt_Opacity;
109- uniform sampler2D mask;
110- uniform sampler2D image;
111-
112- void main(void)
113- {
114- lowp vec4 maskColor = texture2D(mask, qt_TexCoord0.st);
115- lowp vec4 imageColor = texture2D(image, qt_TexCoord0.st);
116- gl_FragColor = imageColor * maskColor.a * qt_Opacity;
117- }
118- "
119- }
120-
121- BorderImage {
122- id: border
123-
124- anchors.fill: parent
125- source: shape.borderSource
126+ id: root
127+
128+ property alias radius: shape.radius
129+ property alias image: source.sourceItem
130+
131+ ShaderEffectSource {
132+ id: source
133+ width: 1
134+ height: 1
135+ hideSource: true
136+ }
137+
138+ Shape {
139+ id: shape
140+ image: source
141+
142+ anchors.fill: parent
143 }
144 }
145
146=== modified file 'Dash/Apps/RunningApplicationTile.qml'
147--- Dash/Apps/RunningApplicationTile.qml 2013-06-05 22:03:08 +0000
148+++ Dash/Apps/RunningApplicationTile.qml 2013-06-28 12:59:28 +0000
149@@ -87,7 +87,7 @@
150
151 anchors.fill: shapedApplicationImage
152 radius: "medium"
153- borderSource: ItemStyle.style.borderPressed
154+ borderSource: "radius_pressed.sci"
155 opacity: root.pressed ? 1.0 : 0.0
156 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
157 }
158
159=== modified file 'Dash/Music/AlbumTile.qml'
160--- Dash/Music/AlbumTile.qml 2013-06-05 22:03:08 +0000
161+++ Dash/Music/AlbumTile.qml 2013-06-28 12:59:28 +0000
162@@ -45,7 +45,7 @@
163
164 anchors.fill: icon
165 radius: "medium"
166- borderSource: ItemStyle.style.borderPressed
167+ borderSource: "radius_pressed.sci"
168 opacity: root.pressed ? 1.0 : 0.0
169 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
170 }
171
172=== modified file 'Hud/SearchBar.qml'
173--- Hud/SearchBar.qml 2013-06-05 22:03:08 +0000
174+++ Hud/SearchBar.qml 2013-06-28 12:59:28 +0000
175@@ -55,13 +55,6 @@
176 }
177 }
178
179- // Don't let the style play with our opacity
180- Binding {
181- target: searchBar.ItemStyle.style
182- property: "opacity"
183- value: 1
184- }
185-
186 Item {
187 id: primary
188 height: searchBar.height
189
190=== modified file 'Hud/ToolBarIcon.qml'
191--- Hud/ToolBarIcon.qml 2013-06-05 22:03:08 +0000
192+++ Hud/ToolBarIcon.qml 2013-06-28 12:59:28 +0000
193@@ -18,7 +18,7 @@
194 import Ubuntu.Components 0.1
195
196 Button {
197- ItemStyle.class: "transparent-button"
198+ color: "transparent"
199
200 property alias source: image.source
201

Subscribers

People subscribed via source and target branches