Merge lp:~fboucault/unity-2d/dash_proper_hover into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Gerry Boland
Approved revision: 684
Merged at revision: 685
Proposed branch: lp:~fboucault/unity-2d/dash_proper_hover
Merge into: lp:unity-2d/3.0
Diff against target: 322 lines (+92/-75)
9 files modified
places/Button.qml (+0/-43)
places/ButtonBackground.qml (+31/-0)
places/Home.qml (+2/-2)
places/HomeButton.qml (+26/-23)
places/UnityDefaultRenderer.qml (+12/-3)
places/UnityEmptySearchRenderer.qml (+8/-1)
places/UnityFileInfoRenderer.qml (+6/-1)
places/UnityHorizontalTileRenderer.qml (+6/-1)
places/dash.qml (+1/-1)
To merge this branch: bzr merge lp:~fboucault/unity-2d/dash_proper_hover
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+72604@code.launchpad.net

Description of the change

[dash] Removed 'hover' state everywhere but in search results and home screen shortctus.
In these 2 places the style was adapted to look better and also closer to Unity's.
HomeButton now expands its label when focused.

To post a comment you must log in.
683. By Florian Boucault

Added missing ButtonBackground.

684. By Florian Boucault

Merged trunk

Revision history for this message
Gerry Boland (gerboland) wrote :

Works ok, accepted.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'places/Button.qml'
--- places/Button.qml 2011-08-09 16:18:45 +0000
+++ places/Button.qml 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
1/*
2 * This file is part of unity-2d
3 *
4 * Copyright 2010-2011 Canonical Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 1.0
20
21AbstractButton {
22 Rectangle {
23 anchors.fill: parent
24 anchors.bottomMargin: 1
25 anchors.rightMargin: 1
26 opacity: ( parent.state == "selected" || parent.state == "pressed"
27 || parent.state == "hovered" ) ? 1.0 : 0.0
28
29 color: parent.state == "pressed" ? "#ffffffff" : "#00000000"
30 border.color: "#cccccc"
31 border.width: 1
32 radius: 3
33
34 Behavior on opacity {NumberAnimation {duration: 100}}
35
36 Image {
37 fillMode: Image.Tile
38 anchors.fill: parent
39 source: "artwork/button_background.png"
40 smooth: false
41 }
42 }
43}
440
=== added file 'places/ButtonBackground.qml'
--- places/ButtonBackground.qml 1970-01-01 00:00:00 +0000
+++ places/ButtonBackground.qml 2011-08-23 17:40:25 +0000
@@ -0,0 +1,31 @@
1import QtQuick 1.0
2
3Item {
4 id: background
5
6 property string state
7
8 opacity: ( state == "selected" || state == "pressed"
9 || state == "hovered" ) ? 1.0 : 0.0
10 Behavior on opacity {NumberAnimation {duration: 100}}
11
12 Rectangle {
13
14 /* FIXME: */
15 anchors.fill: parent
16 anchors.bottomMargin: 1
17 anchors.rightMargin: 1
18
19 color: background.state == "pressed" ? "#ffffffff" : "#00000000"
20 border.color: "#cccccc"
21 border.width: 1
22 radius: 3
23
24 Image {
25 fillMode: Image.Tile
26 anchors.fill: parent
27 source: "artwork/button_background.png"
28 smooth: false
29 }
30 }
31}
032
=== modified file 'places/Home.qml'
--- places/Home.qml 2011-08-10 10:01:52 +0000
+++ places/Home.qml 2011-08-23 17:40:25 +0000
@@ -56,7 +56,7 @@
56 /* Used by dash.qml to bind to dashView "expanded" property */56 /* Used by dash.qml to bind to dashView "expanded" property */
57 property bool expanded: globalSearchActive || shortcutsActive57 property bool expanded: globalSearchActive || shortcutsActive
5858
59 Button {59 AbstractButton {
60 id: openShortcutsButton60 id: openShortcutsButton
6161
62 anchors.bottom: parent.top62 anchors.bottom: parent.top
@@ -146,7 +146,7 @@
146 color: Qt.rgba(0, 0, 0, 0.3)146 color: Qt.rgba(0, 0, 0, 0.3)
147 }147 }
148148
149 Button {149 AbstractButton {
150 id: closeShortcutsButton150 id: closeShortcutsButton
151151
152 anchors.left: parent.left152 anchors.left: parent.left
153153
=== modified file 'places/HomeButton.qml'
--- places/HomeButton.qml 2011-08-23 15:47:49 +0000
+++ places/HomeButton.qml 2011-08-23 17:40:25 +0000
@@ -18,7 +18,9 @@
1818
19import QtQuick 1.019import QtQuick 1.0
2020
21Button {21AbstractButton {
22 id: button
23
22 property alias icon: icon.source24 property alias icon: icon.source
23 property alias label: label.text25 property alias label: label.text
24 property alias iconSourceSize: icon.sourceSize26 property alias iconSourceSize: icon.sourceSize
@@ -26,37 +28,38 @@
26 width: 16028 width: 160
27 height: 17229 height: 172
2830
29 Item {31 ButtonBackground {
30 anchors.right: parent.right32 anchors.fill: icon
31 anchors.left: parent.left33 anchors.margins: -5
34 state: button.state
35 }
36
37 Image {
38 id: icon
39
40 width: sourceSize.width
41 height: sourceSize.height
42
43 anchors.horizontalCenter: parent.horizontalCenter
32 anchors.top: parent.top44 anchors.top: parent.top
33 anchors.bottom: label.bottom45 anchors.topMargin: 5
34 anchors.bottomMargin: 3046 fillMode: Image.PreserveAspectFit
3547
36 Image {48 asynchronous: true
37 id: icon49 opacity: status == Image.Ready ? 1 : 0
3850 Behavior on opacity {NumberAnimation {duration: 200; easing.type: Easing.InOutQuad}}
39 width: sourceSize.width
40 height: sourceSize.height
41
42 anchors.centerIn: parent
43 fillMode: Image.PreserveAspectFit
44
45 asynchronous: true
46 opacity: status == Image.Ready ? 1 : 0
47 Behavior on opacity {NumberAnimation {duration: 200; easing.type: Easing.InOutQuad}}
48 }
49 }51 }
5052
51 TextMultiLine {53 TextMultiLine {
52 id: label54 id: label
5355
54 color: parent.state == "pressed" ? "#444444" : "#ffffff"56 color: "#ffffff"
57 state: ( parent.state == "selected" || parent.state == "hovered" ) ? "expanded" : ""
55 horizontalAlignment: Text.AlignHCenter58 horizontalAlignment: Text.AlignHCenter
56 anchors.bottom: parent.bottom59 anchors.top: icon.bottom
57 anchors.right: parent.right60 anchors.right: parent.right
58 anchors.left: parent.left61 anchors.left: parent.left
59 anchors.bottomMargin: 362 anchors.topMargin: 8
60 anchors.rightMargin: 563 anchors.rightMargin: 5
61 anchors.leftMargin: 764 anchors.leftMargin: 7
62 height: 4065 height: 40
6366
=== modified file 'places/UnityDefaultRenderer.qml'
--- places/UnityDefaultRenderer.qml 2011-08-23 16:27:12 +0000
+++ places/UnityDefaultRenderer.qml 2011-08-23 17:40:25 +0000
@@ -21,12 +21,14 @@
2121
22RendererGrid {22RendererGrid {
23 cellWidth: 10023 cellWidth: 100
24 cellHeight: 10824 cellHeight: 112
25 horizontalSpacing: 4225 horizontalSpacing: 42
26 verticalSpacing: 2026 verticalSpacing: 20
2727
28 cellRenderer: Component {28 cellRenderer: Component {
29 Button {29 AbstractButton {
30 id: button
31
30 property string uri32 property string uri
31 property string iconHint33 property string iconHint
32 property string mimetype34 property string mimetype
@@ -66,6 +68,12 @@
66 onDrop: parent.pressed = false68 onDrop: parent.pressed = false
67 }69 }
6870
71 ButtonBackground {
72 anchors.fill: icon
73 anchors.margins: -4
74 state: button.state
75 }
76
69 Image {77 Image {
70 id: icon78 id: icon
7179
@@ -74,6 +82,7 @@
74 height: 6482 height: 64
75 anchors.horizontalCenter: parent.horizontalCenter83 anchors.horizontalCenter: parent.horizontalCenter
76 anchors.top: parent.top84 anchors.top: parent.top
85 anchors.topMargin: 4
77 fillMode: Image.PreserveAspectFit86 fillMode: Image.PreserveAspectFit
78 sourceSize.width: width87 sourceSize.width: width
79 sourceSize.height: height88 sourceSize.height: height
@@ -87,7 +96,7 @@
87 id: label96 id: label
8897
89 text: displayName98 text: displayName
90 color: parent.state == "pressed" ? "#5e5e5e" : "#ffffff"99 color: "#ffffff"
91 state: ( parent.state == "selected" || parent.state == "hovered" ) ? "expanded" : ""100 state: ( parent.state == "selected" || parent.state == "hovered" ) ? "expanded" : ""
92 horizontalAlignment: Text.AlignHCenter101 horizontalAlignment: Text.AlignHCenter
93 anchors.top: icon.bottom102 anchors.top: icon.bottom
94103
=== modified file 'places/UnityEmptySearchRenderer.qml'
--- places/UnityEmptySearchRenderer.qml 2011-07-24 16:23:00 +0000
+++ places/UnityEmptySearchRenderer.qml 2011-08-23 17:40:25 +0000
@@ -41,7 +41,9 @@
41 orientation: ListView.Vertical41 orientation: ListView.Vertical
4242
43 model: renderer.group_model43 model: renderer.group_model
44 delegate: Button {44 delegate: AbstractButton {
45 id: button
46
45 property string uri: column_047 property string uri: column_0
46 property string iconHint: column_148 property string iconHint: column_1
47 property string groupId: column_249 property string groupId: column_2
@@ -59,6 +61,11 @@
59 placeEntryModel.place.activate(uri)61 placeEntryModel.place.activate(uri)
60 }62 }
6163
64 ButtonBackground {
65 anchors.fill: parent
66 state: button.state
67 }
68
62 TextCustom {69 TextCustom {
63 text: displayName70 text: displayName
64 font.pixelSize: 1671 font.pixelSize: 16
6572
=== modified file 'places/UnityFileInfoRenderer.qml'
--- places/UnityFileInfoRenderer.qml 2011-08-23 15:47:49 +0000
+++ places/UnityFileInfoRenderer.qml 2011-08-23 17:40:25 +0000
@@ -25,7 +25,7 @@
25 verticalSpacing: 2625 verticalSpacing: 26
2626
27 cellRenderer: Component {27 cellRenderer: Component {
28 Button {28 AbstractButton {
29 id: button29 id: button
3030
31 property url uri31 property url uri
@@ -50,6 +50,11 @@
5050
51 onClicked: placeEntryModel.place.activate(decodeURIComponent(uri.toString()))51 onClicked: placeEntryModel.place.activate(decodeURIComponent(uri.toString()))
5252
53 ButtonBackground {
54 anchors.fill: parent
55 state: button.state
56 }
57
53 Image {58 Image {
54 id: icon59 id: icon
5560
5661
=== modified file 'places/UnityHorizontalTileRenderer.qml'
--- places/UnityHorizontalTileRenderer.qml 2011-06-22 12:47:52 +0000
+++ places/UnityHorizontalTileRenderer.qml 2011-08-23 17:40:25 +0000
@@ -26,7 +26,7 @@
26 verticalSpacing: 1026 verticalSpacing: 10
2727
28 cellRenderer: Component {28 cellRenderer: Component {
29 Button {29 AbstractButton {
30 id: button30 id: button
3131
32 property string uri32 property string uri
@@ -68,6 +68,11 @@
68 onDrop: parent.pressed = false68 onDrop: parent.pressed = false
69 }69 }
7070
71 ButtonBackground {
72 anchors.fill: parent
73 state: button.state
74 }
75
71 Image {76 Image {
72 id: icon77 id: icon
7378
7479
=== modified file 'places/dash.qml'
--- places/dash.qml 2011-08-23 15:00:31 +0000
+++ places/dash.qml 2011-08-23 17:40:25 +0000
@@ -232,7 +232,7 @@
232 }232 }
233 }233 }
234234
235 Button {235 AbstractButton {
236 id: fullScreenButton236 id: fullScreenButton
237 anchors.bottom: parent.bottom237 anchors.bottom: parent.bottom
238 anchors.right: parent.right238 anchors.right: parent.right

Subscribers

People subscribed via source and target branches