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
=== modified file 'Components/FilterGrid.qml'
--- Components/FilterGrid.qml 2013-06-05 22:03:08 +0000
+++ Components/FilterGrid.qml 2013-06-28 12:59:28 +0000
@@ -108,7 +108,7 @@
108108
109 anchors.fill: parent109 anchors.fill: parent
110 radius: "small"110 radius: "small"
111 borderSource: ItemStyle.style.borderPressed111 borderSource: "radius_pressed.sci"
112 opacity: button.pressed ? 1.0 : 0.0112 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 }
115115
=== modified file 'Components/PageHeader.qml'
--- Components/PageHeader.qml 2013-06-05 22:03:08 +0000
+++ Components/PageHeader.qml 2013-06-28 12:59:28 +0000
@@ -149,7 +149,7 @@
149149
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 @@
272 // FIXME: this should go into the first item below, but enable: false272 // FIXME: this should go into the first item below, but enable: false
273 // prevents mouse events propagation273 // prevents mouse events propagation
274 Button {274 Button {
275 ItemStyle.class: "transparent-button"275 color: "transparent"
276 anchors {276 anchors {
277 top: parent.top277 top: parent.top
278 right: parent.right278 right: parent.right
279279
=== modified file 'Components/Tile.qml'
--- Components/Tile.qml 2013-06-05 22:03:08 +0000
+++ Components/Tile.qml 2013-06-28 12:59:28 +0000
@@ -51,7 +51,7 @@
5151
52 anchors.fill: icon52 anchors.fill: icon
53 radius: "medium"53 radius: "medium"
54 borderSource: ItemStyle.style.borderPressed54 borderSource: "radius_pressed.sci"
55 opacity: root.pressed ? 1.0 : 0.055 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 }
5858
=== modified file 'Components/UbuntuShapeForItem.qml'
--- Components/UbuntuShapeForItem.qml 2013-06-05 22:03:08 +0000
+++ Components/UbuntuShapeForItem.qml 2013-06-28 12:59:28 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.1 as Theming18import Ubuntu.Components 0.1
1919
20/* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more20/* 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's21 * general (Item-based) components. This ability should be incorporated into the SDK's
@@ -24,66 +24,22 @@
24 */24 */
2525
26Item {26Item {
27 id: shape27 id: root
2828
29 Theming.ItemStyle.class: "UbuntuShape-radius-" + radius29 property alias radius: shape.radius
3030 property alias image: source.sourceItem
31 property string radius: "small"31
32 property url maskSource: Theming.ComponentUtils.style(shape, "maskSource", "")32 ShaderEffectSource {
33 property url borderSource: Theming.ComponentUtils.style(shape, "borderIdle", "")33 id: source
34 property Item image34 width: 1
3535 height: 1
36 implicitWidth: units.gu(8)36 hideSource: true
37 implicitHeight: units.gu(8)37 }
3838
39 onWidthChanged: __updateImageDimensions()39 Shape {
40 onHeightChanged: __updateImageDimensions()40 id: shape
41 onImageChanged: __updateImageDimensions()41 image: source
4242
43 function __updateImageDimensions() {43 anchors.fill: parent
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 "
81 }
82
83 BorderImage {
84 id: border
85
86 anchors.fill: parent
87 source: shape.borderSource
88 }44 }
89}45}
9046
=== modified file 'Dash/Apps/RunningApplicationTile.qml'
--- Dash/Apps/RunningApplicationTile.qml 2013-06-05 22:03:08 +0000
+++ Dash/Apps/RunningApplicationTile.qml 2013-06-28 12:59:28 +0000
@@ -87,7 +87,7 @@
8787
88 anchors.fill: shapedApplicationImage88 anchors.fill: shapedApplicationImage
89 radius: "medium"89 radius: "medium"
90 borderSource: ItemStyle.style.borderPressed90 borderSource: "radius_pressed.sci"
91 opacity: root.pressed ? 1.0 : 0.091 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 }
9494
=== modified file 'Dash/Music/AlbumTile.qml'
--- Dash/Music/AlbumTile.qml 2013-06-05 22:03:08 +0000
+++ Dash/Music/AlbumTile.qml 2013-06-28 12:59:28 +0000
@@ -45,7 +45,7 @@
4545
46 anchors.fill: icon46 anchors.fill: icon
47 radius: "medium"47 radius: "medium"
48 borderSource: ItemStyle.style.borderPressed48 borderSource: "radius_pressed.sci"
49 opacity: root.pressed ? 1.0 : 0.049 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 }
5252
=== modified file 'Hud/SearchBar.qml'
--- Hud/SearchBar.qml 2013-06-05 22:03:08 +0000
+++ Hud/SearchBar.qml 2013-06-28 12:59:28 +0000
@@ -55,13 +55,6 @@
55 }55 }
56 }56 }
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
65 Item {58 Item {
66 id: primary59 id: primary
67 height: searchBar.height60 height: searchBar.height
6861
=== modified file 'Hud/ToolBarIcon.qml'
--- Hud/ToolBarIcon.qml 2013-06-05 22:03:08 +0000
+++ Hud/ToolBarIcon.qml 2013-06-28 12:59:28 +0000
@@ -18,7 +18,7 @@
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
1919
20Button {20Button {
21 ItemStyle.class: "transparent-button"21 color: "transparent"
2222
23 property alias source: image.source23 property alias source: image.source
2424

Subscribers

People subscribed via source and target branches