Merge lp:~nick-dedekind/ubuntu-settings-components/indicator-polishing into lp:~registry/ubuntu-settings-components/trunk

Proposed by Nick Dedekind
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 108
Merged at revision: 78
Proposed branch: lp:~nick-dedekind/ubuntu-settings-components/indicator-polishing
Merge into: lp:~registry/ubuntu-settings-components/trunk
Prerequisite: lp:~nick-dedekind/ubuntu-settings-components/uqmlscene
Diff against target: 4066 lines (+1369/-1495)
58 files modified
CMakeLists.txt (+1/-0)
Ubuntu/Settings/Components/ActionTextField.qml (+35/-33)
Ubuntu/Settings/Components/CMakeLists.txt (+0/-2)
Ubuntu/Settings/Components/Calendar.qml (+2/-2)
Ubuntu/Settings/Components/IconVisual.qml (+0/-71)
Ubuntu/Settings/Components/MessageHeader.qml (+104/-134)
Ubuntu/Settings/Components/QuickReply.qml (+4/-4)
Ubuntu/Settings/Components/UbuntuShapeForItem.qml (+43/-0)
Ubuntu/Settings/Components/artwork/CMakeLists.txt (+0/-2)
Ubuntu/Settings/Components/qmldir (+2/-2)
Ubuntu/Settings/Menus/AccessPointMenu.qml (+14/-76)
Ubuntu/Settings/Menus/ButtonMenu.qml (+15/-13)
Ubuntu/Settings/Menus/CMakeLists.txt (+0/-2)
Ubuntu/Settings/Menus/CalendarMenu.qml (+3/-4)
Ubuntu/Settings/Menus/CheckableMenu.qml (+5/-13)
Ubuntu/Settings/Menus/EventMenu.qml (+9/-9)
Ubuntu/Settings/Menus/GroupedMessageMenu.qml (+28/-32)
Ubuntu/Settings/Menus/MediaPlayerMenu.qml (+39/-29)
Ubuntu/Settings/Menus/PlaybackItemMenu.qml (+53/-44)
Ubuntu/Settings/Menus/ProgressBarMenu.qml (+20/-12)
Ubuntu/Settings/Menus/ProgressValueMenu.qml (+9/-8)
Ubuntu/Settings/Menus/SectionMenu.qml (+2/-2)
Ubuntu/Settings/Menus/SeparatorMenu.qml (+3/-7)
Ubuntu/Settings/Menus/SimpleMessageMenu.qml (+66/-49)
Ubuntu/Settings/Menus/SimpleTextMessageMenu.qml (+0/-99)
Ubuntu/Settings/Menus/SliderMenu.qml (+6/-7)
Ubuntu/Settings/Menus/SnapDecisionMenu.qml (+64/-126)
Ubuntu/Settings/Menus/StandardMenu.qml (+24/-8)
Ubuntu/Settings/Menus/SwitchMenu.qml (+38/-37)
Ubuntu/Settings/Menus/TextMessageMenu.qml (+3/-4)
Ubuntu/Settings/Menus/TimeZoneMenu.qml (+10/-7)
Ubuntu/Settings/Menus/TransferMenu.qml (+24/-18)
Ubuntu/Settings/Menus/UserSessionMenu.qml (+28/-19)
Ubuntu/Settings/Menus/artwork/CMakeLists.txt (+0/-2)
Ubuntu/Settings/Menus/artwork/default_app.svg (+0/-42)
Ubuntu/Settings/Menus/artwork/secure.svg (+0/-71)
Ubuntu/Settings/Menus/qmldir (+1/-3)
debian/changelog (+8/-0)
debian/control (+2/-2)
examples/CMakeLists.txt (+2/-0)
examples/MessageComponents.qml (+119/-0)
examples/OtherComponents.qml (+237/-0)
examples/SettingsComponents.qml (+29/-254)
examples/TransferComponents.qml (+84/-0)
runtests.sh (+2/-2)
tests/qmltests/CMakeLists.txt (+3/-2)
tests/qmltests/Menus/tst_AccessPointMenu.qml (+3/-21)
tests/qmltests/Menus/tst_ButtonMenu.qml (+1/-1)
tests/qmltests/Menus/tst_CheckableMenu.qml (+2/-2)
tests/qmltests/Menus/tst_EventMenu.qml (+1/-1)
tests/qmltests/Menus/tst_GroupedMessageMenu.qml (+1/-1)
tests/qmltests/Menus/tst_MediaPlayerMenu.qml (+10/-10)
tests/qmltests/Menus/tst_PlaybackItemMenu.qml (+1/-1)
tests/qmltests/Menus/tst_SimpleMessageMenu.qml (+57/-50)
tests/qmltests/Menus/tst_SnapDecisionMenu.qml (+82/-95)
tests/qmltests/Menus/tst_SwitchMenu.qml (+2/-2)
tests/qmltests/Menus/tst_TextMessageMenu.qml (+67/-57)
tests/utils/modules/Ubuntu/Test/UbuntuTestCase.qml (+1/-1)
To merge this branch: bzr merge lp:~nick-dedekind/ubuntu-settings-components/indicator-polishing
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
Albert Astals Cid (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Needs Fixing
Michael Zanetti (community) Needs Fixing
Review via email: mp+229083@code.launchpad.net

This proposal supersedes a proposal from 2014-07-29.

Description of the change

Visual changes for indicator RTM polishing sprint

https://docs.google.com/a/canonical.com/document/d/1KC40suUs13gajIlE1Ms6PJYoIPx_AjlF4ae6bvtNjNc/edit

 * Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~nick-dedekind/unity8/indicator-polishing/+merge/228700

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the UI, has there been a design review?
Yes

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

jenkins failing due to lacking xvfb-run

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

Some comments, as well as I'd bump qt quick requirements to 2.2 on the files touched, and Ubuntu Components 1.1

review: Needs Fixing
Revision history for this message
Andrea Cimitan (cimi) wrote :

- Some listitems in the example qml have different highlight on press:
User account with lola chang, timezone one

- Status icon at the bottom doesn't seem to have padding or right size

- press effect on buttons seems a bit weird, like it changes size and font size

review: Needs Fixing
Revision history for this message
Andrea Cimitan (cimi) wrote :

Do we want to animate expansions of message components?

Revision history for this message
Andrea Cimitan (cimi) wrote :

Also, that might be a different issue (SDK) but when I move the slider, sometimes I can flick between pages.. be sure we don't have this in unity8, and if it happens to be a bug in sdk, file it

Revision history for this message
Andrea Cimitan (cimi) wrote :

if you can, would be nice to not shorten variable names or ids, like using animation instead ani

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

comments attached.

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> - Some listitems in the example qml have different highlight on press:
> User account with lola chang, timezone one

Fixed. use StandardMenu now.

>
> - Status icon at the bottom doesn't seem to have padding or right size

The Status icons are just examples of their component usage. Not supposed to be padded.

>
> - press effect on buttons seems a bit weird, like it changes size and font
> size

This is sdk. Raise a bug if you think it's wrong.
Not sure which buttons you are talking about size and font. The ones in messaging are as designed (or defaulted in sdk). The other buttons are sized to text as in sdk

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> Do we want to animate expansions of message components?

Yes. I put this back.

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> Also, that might be a different issue (SDK) but when I move the slider,
> sometimes I can flick between pages.. be sure we don't have this in unity8,
> and if it happens to be a bug in sdk, file it

SDK bug it would seem.

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> if you can, would be nice to not shorten variable names or ids, like using
> animation instead ani

fixed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) :
review: Approve
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
 * Did CI run pass? If not, please explain why.
Yes

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
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
 * Did CI run pass? If not, please explain why.
Yes

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

Breaks the indicators.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
 * Did CI run pass? If not, please explain why.
No, seems unrelated

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

Please add a i18n.tr to

./Ubuntu/Settings/Components/QuickReply.qml:63: text: "Quick reply with:"

And also who are people translating the strings marked with i18n here? Doesn't seem to be a .pot file :S

review: Needs Fixing
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> Please add a i18n.tr to
>
> ./Ubuntu/Settings/Components/QuickReply.qml:63: text: "Quick
> reply with:"

Done.

>
>
> And also who are people translating the strings marked with i18n here? Doesn't
> seem to be a .pot file :S

Hm. good point. I'll add it on another MP.

Revision history for this message
Andrea Cimitan (cimi) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-07-31 16:52:12 +0000
+++ CMakeLists.txt 2014-09-25 11:35:47 +0000
@@ -96,4 +96,5 @@
96enable_testing()96enable_testing()
9797
98add_subdirectory(Ubuntu)98add_subdirectory(Ubuntu)
99add_subdirectory(examples)
99add_subdirectory(tests)100add_subdirectory(tests)
100101
=== modified file 'Ubuntu/Settings/Components/ActionTextField.qml'
--- Ubuntu/Settings/Components/ActionTextField.qml 2013-10-04 12:38:07 +0000
+++ Ubuntu/Settings/Components/ActionTextField.qml 2014-09-25 11:35:47 +0000
@@ -19,7 +19,8 @@
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.0
22import Ubuntu.Components 0.122import Ubuntu.Components 1.1
23import QtQuick.Layouts 1.1
2324
24Item {25Item {
25 id: textField26 id: textField
@@ -29,43 +30,44 @@
2930
30 signal activated(var value)31 signal activated(var value)
3132
32 TextField {33 implicitHeight: layout.implicitHeight
33 id: replyField
34 objectName: "replyText"
3534
35 RowLayout {
36 id: layout
36 anchors {37 anchors {
37 top: parent.top
38 bottom: parent.bottom
39 left: parent.left38 left: parent.left
40 right: sendButton.left
41 rightMargin: units.gu(1)
42 }
43 placeholderText: "Reply"
44 hasClearButton: false
45
46 onEnabledChanged: {
47 //Make sure that the component lost focus when enabled = false,
48 //otherwise it will get focus again when enable = true
49 if (!enabled) {
50 focus = false;
51 }
52 }
53 }
54
55 Button {
56 id: sendButton
57 objectName: "sendButton"
58 anchors {
59 top: parent.top
60 bottom: parent.bottom
61 right: parent.right39 right: parent.right
62 }40 }
63 width: units.gu(9)41 spacing: units.gu(1)
64 enabled: replyField.text !== "" && textField.activateEnabled42
65 color: enabled ? "#c94212" : "#bababa"43 TextField {
6644 id: replyField
67 onClicked: {45 objectName: "replyText"
68 textField.activated(replyField.text);46
47 placeholderText: i18n.tr("Reply")
48 hasClearButton: false
49
50 Layout.fillWidth: true
51
52 onEnabledChanged: {
53 //Make sure that the component lost focus when enabled = false,
54 //otherwise it will get focus again when enable = true
55 if (!enabled) {
56 focus = false;
57 }
58 }
59 }
60
61 Button {
62 id: sendButton
63 objectName: "sendButton"
64 Layout.preferredWidth: units.gu(9)
65 enabled: replyField.text !== "" && textField.activateEnabled
66 color: UbuntuColors.green
67
68 onClicked: {
69 textField.activated(replyField.text);
70 }
69 }71 }
70 }72 }
71}73}
7274
=== modified file 'Ubuntu/Settings/Components/CMakeLists.txt'
--- Ubuntu/Settings/Components/CMakeLists.txt 2014-06-27 09:35:26 +0000
+++ Ubuntu/Settings/Components/CMakeLists.txt 2014-09-25 11:35:47 +0000
@@ -1,3 +1,1 @@
1add_subdirectory(artwork)
2
3add_usc_plugin(Ubuntu.Settings.Components 0.1 Ubuntu/Settings/Components)1add_usc_plugin(Ubuntu.Settings.Components 0.1 Ubuntu/Settings/Components)
42
=== modified file 'Ubuntu/Settings/Components/Calendar.qml'
--- Ubuntu/Settings/Components/Calendar.qml 2013-10-29 22:08:08 +0000
+++ Ubuntu/Settings/Components/Calendar.qml 2014-09-25 11:35:47 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 1.1
19import "dateExt.js" as DateExt19import "dateExt.js" as DateExt
2020
21ListView {21ListView {
@@ -204,7 +204,7 @@
204204
205 // Styling properties205 // Styling properties
206 property color color: Theme.palette.selected.backgroundText206 property color color: Theme.palette.selected.backgroundText
207 property color todayColor: "#DD4814"207 property color todayColor: Theme.palette.selected.foreground
208 property string fontSize: "large"208 property string fontSize: "large"
209 property var backgroundColor: "transparent" // FIXME use color instead var when Qt will fix the bug with the binding (loses alpha)209 property var backgroundColor: "transparent" // FIXME use color instead var when Qt will fix the bug with the binding (loses alpha)
210 property var sundayBackgroundColor: "#19AEA79F" // FIXME use color instead var when Qt will fix the bug with the binding (loses alpha)210 property var sundayBackgroundColor: "#19AEA79F" // FIXME use color instead var when Qt will fix the bug with the binding (loses alpha)
211211
=== removed file 'Ubuntu/Settings/Components/IconVisual.qml'
--- Ubuntu/Settings/Components/IconVisual.qml 2013-10-30 17:09:39 +0000
+++ Ubuntu/Settings/Components/IconVisual.qml 1970-01-01 00:00:00 +0000
@@ -1,71 +0,0 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19
20Item {
21 id: icon
22
23 property url source
24 property alias color: colorizedImage.keyColorOut
25 property alias keyColor: colorizedImage.keyColorIn
26 property alias status: image.status
27
28 Image {
29 id: image
30
31 /* Necessary so that icons are not loaded before a size is set. */
32 property bool ready: false
33 Component.onCompleted: ready = true
34
35 anchors.fill: parent
36 source: ready && width > 0 && height > 0 && icon.source ? icon.source : ""
37 sourceSize {
38 width: width
39 height: height
40 }
41 cache: true
42 visible: !colorizedImage.active
43 }
44
45 ShaderEffect {
46 id: colorizedImage
47
48 anchors.fill: parent
49 visible: active && image.status == Image.Ready
50
51 // Whether or not a color has been set.
52 property bool active: keyColorOut != Qt.rgba(0.0, 0.0, 0.0, 0.0)
53
54 property Image source: visible ? image : null
55 property color keyColorOut: Qt.rgba(0.0, 0.0, 0.0, 0.0)
56 property color keyColorIn: "#808080"
57 property real threshold: 0.6
58
59 fragmentShader: source ? "
60 varying highp vec2 qt_TexCoord0;
61 uniform sampler2D source;
62 uniform highp vec4 keyColorOut;
63 uniform highp vec4 keyColorIn;
64 uniform lowp float threshold;
65 uniform lowp float qt_Opacity;
66 void main() {
67 lowp vec4 sourceColor = texture2D(source, qt_TexCoord0);
68 gl_FragColor = mix(vec4(keyColorOut.rgb, 1.0) * sourceColor.a, sourceColor, step(threshold, distance(sourceColor.rgb / sourceColor.a, keyColorIn.rgb))) * qt_Opacity;
69 }" : ""
70 }
71}
720
=== renamed file 'Ubuntu/Settings/Components/HeroMessageHeader.qml' => 'Ubuntu/Settings/Components/MessageHeader.qml'
--- Ubuntu/Settings/Components/HeroMessageHeader.qml 2013-10-04 10:10:47 +0000
+++ Ubuntu/Settings/Components/MessageHeader.qml 2014-09-25 11:35:47 +0000
@@ -18,147 +18,117 @@
18 * Olivier Tilloy <olivier.tilloy@canonical.com>18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.1
22import Ubuntu.Components 0.122import Ubuntu.Components 1.1
23import QtQuick.Layouts 1.1
2324
24Item {25Item {
25 id: heroMessageHeader26 id: messageHeader
2627
27 property alias avatar: avatarImage.source28 property alias avatar: avatarImage.source
28 property alias icon: iconImage.source29 property alias icon: iconImage.source
29 property alias appIcon: appIconImage.source30 property alias title: titleText.text
30 property alias titleText: __titleText31 property alias time: timeText.text
31 property alias subtitleText: __subtitleText32 property alias body: bodyText.text
32 property alias bodyText: __bodyText33
33 property real bodyBottom: bodyText.y + bodyText.height34 signal iconClicked()
3435
35 signal appIconClicked()36 implicitHeight: layout.height
3637
37 height: units.gu(9)38 function shakeIcon() {
3839 shake.restart();
39 UbuntuShape {40 }
40 id: avatarImageContainer41
42 RowLayout {
43 id: layout
41 anchors {44 anchors {
42 top: parent.top
43 topMargin: units.gu(2)
44 left: parent.left45 left: parent.left
45 leftMargin: units.gu(2)46 right: parent.right
46 }47 rightMargin: units.gu(4)
47 height: units.gu(6)48 }
48 width: units.gu(6)49 spacing: units.gu(2)
49 image: Image {50
50 id: avatarImage51 UbuntuShapeForItem {
51 objectName: "avatar"52 Layout.preferredWidth: units.gu(6)
52 fillMode: Image.PreserveAspectFit53 Layout.preferredHeight: units.gu(6)
53 }54
54 }55 image: avatarImage
5556 Icon {
56 Image {57 id: avatarImage
57 id: iconImage58 objectName: "avatar"
58 objectName: "icon"59 anchors.fill: parent
59 anchors {60
60 top: parent.top61 color: {
61 topMargin: units.gu(2)62 if (String(source).match(/^image:\/\/theme/)) {
62 left: avatarImageContainer.right63 return Theme.palette.selected.backgroundText;
63 leftMargin: units.gu(1)64 }
64 }65 return Qt.rgba(0.0, 0.0, 0.0, 0.0);
65 width: units.gu(2)66 }
66 height: width67 }
67 horizontalAlignment: Image.AlignHCenter68 }
68 verticalAlignment: Image.AlignBottom69
69 fillMode: Image.PreserveAspectFit70 ColumnLayout {
70 }71 Label {
7172 id: titleText
72 Label {73 objectName: "title"
73 id: __titleText74
74 objectName: "title"75 maximumLineCount: 1
75 anchors {76 elide: Text.ElideRight
76 baseline: iconImage.bottom77 font.weight: Font.DemiBold
77 left: iconImage.right78 fontSize: "medium"
78 leftMargin: units.gu(1)79
79 right: __appIcon.left80 Layout.fillWidth: true
80 rightMargin: units.gu(2)81 // calculate width with regard to the time's incursion into this layout's space.
81 }82 Layout.maximumWidth: layout.width - timeLayout.width - units.gu(4)
82 elide: Text.ElideRight83 }
83 font.weight: Font.DemiBold84 spacing: units.gu(0.5)
84 fontSize: "medium"85
85 }86 Label {
8687 id: bodyText
87 Label {88 objectName: "body"
88 id: __subtitleText89
89 objectName: "subtitle"90 maximumLineCount: 3
90 anchors {91 wrapMode: Text.WordWrap
91 baseline: __titleText.baseline92 elide: Text.ElideRight
92 baselineOffset: units.gu(2.5)93 fontSize: "small"
93 left: __titleText.left94
94 right: __titleText.right95 Layout.fillWidth: true
95 }96 }
96 elide: Text.ElideRight97 }
97 fontSize: "small"98 }
98 }99
99100 ColumnLayout {
100 Label {101 id: timeLayout
101 id: __bodyText102 anchors.right: parent.right
102 objectName: "body"103
103 anchors {104 Label {
104 baseline: __subtitleText.baseline105 id: timeText
105 baselineOffset: units.gu(2.5)106 objectName: "time"
106 left: __titleText.left107 elide: Text.ElideRight
107 right: parent.right108 fontSize: "x-small"
108 rightMargin: units.gu(2)109 maximumLineCount: 1
109 }110 horizontalAlignment: Text.AlignRight
110 maximumLineCount: 2111 }
111 wrapMode: Text.WordWrap112 spacing: units.gu(0.5)
112 elide: Text.ElideRight113
113 fontSize: "small"114 Icon {
114 }115 id: iconImage
115116 objectName: "icon"
116 Item {117 Layout.preferredHeight: units.gu(3)
117 id: __appIcon118 Layout.preferredWidth: units.gu(3)
118 width: units.gu(7)119 Layout.alignment: Qt.AlignRight
119 height: units.gu(7)120 color: Theme.palette.selected.backgroundText
120 anchors {121
121 top: parent.top122 MouseArea {
122 right: parent.right123 anchors.fill: parent
123 }124 onClicked: messageHeader.iconClicked()
124 opacity: 0.0125 }
125 enabled: heroMessageHeader.state === "expanded"126
126127 SequentialAnimation {
127 Image {128 id: shake
128 id: appIconImage129 PropertyAnimation { target: iconImage; property: "rotation"; duration: 50; to: -20 }
129 objectName: "appIcon"130 SpringAnimation { target: iconImage; property: "rotation"; from: -20; to: 0; mass: 0.5; spring: 15; damping: 0.1 }
130 height: width131 }
131 anchors {
132 left: parent.left
133 leftMargin: units.gu(2)
134 right: parent.right
135 rightMargin: units.gu(2)
136 topMargin: units.gu(1)
137 verticalCenter: parent.verticalCenter
138 }
139 fillMode: Image.PreserveAspectFit
140 }
141
142 MouseArea {
143 anchors.fill: parent
144 onClicked: heroMessageHeader.appIconClicked()
145 }
146 }
147
148 states: State {
149 name: "expanded"
150
151 PropertyChanges {
152 target: __appIcon
153 opacity: 1.0
154 }
155 }
156
157 transitions: Transition {
158 NumberAnimation {
159 property: "opacity"
160 duration: 200
161 easing.type: Easing.OutQuad
162 }132 }
163 }133 }
164}134}
165135
=== modified file 'Ubuntu/Settings/Components/QuickReply.qml'
--- Ubuntu/Settings/Components/QuickReply.qml 2013-10-29 17:40:23 +0000
+++ Ubuntu/Settings/Components/QuickReply.qml 2014-09-25 11:35:47 +0000
@@ -19,8 +19,8 @@
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.0
22import Ubuntu.Components 0.122import Ubuntu.Components 1.1
23import Ubuntu.Components.ListItems 0.1 as ListItem23import Ubuntu.Components.ListItems 1.0 as ListItem
2424
25Item {25Item {
26 id: quickReply26 id: quickReply
@@ -53,14 +53,14 @@
53 width: units.gu(2)53 width: units.gu(2)
54 height: width54 height: width
55 fillMode: Image.PreserveAspectFit55 fillMode: Image.PreserveAspectFit
56 source: "artwork/message_sms01_54px.png"56 source: "image://theme/message"
57 }57 }
5858
59 Label {59 Label {
60 height: parent.height60 height: parent.height
61 verticalAlignment: Text.AlignVCenter61 verticalAlignment: Text.AlignVCenter
62 fontSize: "small"62 fontSize: "small"
63 text: "Quick reply with:"63 text: i18n.tr("Quick reply with:")
64 }64 }
65 }65 }
6666
6767
=== added file 'Ubuntu/Settings/Components/UbuntuShapeForItem.qml'
--- Ubuntu/Settings/Components/UbuntuShapeForItem.qml 1970-01-01 00:00:00 +0000
+++ Ubuntu/Settings/Components/UbuntuShapeForItem.qml 2014-09-25 11:35:47 +0000
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19
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
22 * UbuntuShape so this file can be removed.
23 * Bug: https://bugs.launchpad.net/tavastia/+bug/1089595
24 */
25Item {
26 property alias radius: shape.radius
27 property alias image: source.sourceItem
28
29 ShaderEffectSource {
30 id: source
31 anchors.centerIn: parent // Placed under shape, so it's hidden
32 width: 1
33 height: 1
34 hideSource: true
35 }
36
37 UbuntuShape {
38 id: shape
39 image: source
40
41 anchors.fill: parent
42 }
43}
044
=== removed directory 'Ubuntu/Settings/Components/artwork'
=== removed file 'Ubuntu/Settings/Components/artwork/CMakeLists.txt'
--- Ubuntu/Settings/Components/artwork/CMakeLists.txt 2014-06-27 09:35:26 +0000
+++ Ubuntu/Settings/Components/artwork/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
1# export the artwork files.
2export_qmlfiles(Ubuntu.Settings.Components.Art Ubuntu/Settings/Components/artwork DESTINATION ${QT_IMPORTS_DIR})
30
=== removed file 'Ubuntu/Settings/Components/artwork/message_sms01_54px.png'
4Binary files Ubuntu/Settings/Components/artwork/message_sms01_54px.png 2013-10-04 09:48:04 +0000 and Ubuntu/Settings/Components/artwork/message_sms01_54px.png 1970-01-01 00:00:00 +0000 differ1Binary files Ubuntu/Settings/Components/artwork/message_sms01_54px.png 2013-10-04 09:48:04 +0000 and Ubuntu/Settings/Components/artwork/message_sms01_54px.png 1970-01-01 00:00:00 +0000 differ
=== modified file 'Ubuntu/Settings/Components/qmldir'
--- Ubuntu/Settings/Components/qmldir 2014-06-30 15:36:05 +0000
+++ Ubuntu/Settings/Components/qmldir 2014-09-25 11:35:47 +0000
@@ -2,7 +2,7 @@
22
3ActionTextField 0.1 ActionTextField.qml3ActionTextField 0.1 ActionTextField.qml
4Calendar 0.1 Calendar.qml4Calendar 0.1 Calendar.qml
5HeroMessageHeader 0.1 HeroMessageHeader.qml5MessageHeader 0.1 MessageHeader.qml
6IconVisual 0.1 IconVisual.qml
7QuickReply 0.1 QuickReply.qml6QuickReply 0.1 QuickReply.qml
8StatusIcon 0.1 StatusIcon.qml7StatusIcon 0.1 StatusIcon.qml
8UbuntuShapeForItem 0.1 UbuntuShapeForItem.qml
99
=== modified file 'Ubuntu/Settings/Menus/AccessPointMenu.qml'
--- Ubuntu/Settings/Menus/AccessPointMenu.qml 2014-05-22 23:58:14 +0000
+++ Ubuntu/Settings/Menus/AccessPointMenu.qml 2014-09-25 11:35:47 +0000
@@ -18,95 +18,33 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.ListItems 0.1 as ListItem22import Ubuntu.Components.ListItems 1.0 as ListItem
2323
24ListItem.Empty {24ListItem.Empty {
25 id: menu25 id: menu
26 implicitHeight: units.gu(5.5)26 __height: units.gu(5.5)
2727
28 property bool checked: false28 property bool active: false
29 property bool secure: false29 property bool secure: false
30 property bool adHoc: false30 property bool adHoc: false
31 property int signalStrength: 031 property int signalStrength: 0
32 property alias text: label.text32 property alias text: label.text
3333
34 __acceptEvents: false34 Icon {
3535 id: iconSignal
36 CheckBox {36 objectName: "iconSignal"
37 id: checkbox37
38 objectName: "checkBox"38 color: active ? UbuntuColors.green : Theme.palette.selected.backgroundText
39 property bool enableCheckConnection: true39
4040 width: height
41 height: units.gu(3)41 height: Math.min(units.gu(3), parent.height - units.gu(1))
42 width: units.gu(3)
43
44 anchors {42 anchors {
45 left: parent.left43 left: parent.left
46 leftMargin: menu.__contentsMargins44 leftMargin: menu.__contentsMargins
47 verticalCenter: parent.verticalCenter45 verticalCenter: parent.verticalCenter
48 }46 }
4947
50 // need onCompleted to set the initial value
51 // can't use binding otherwise we will get feedback from connections.
52 Component.onCompleted: {
53 enableCheckConnection = false;
54 checked = menu.checked;
55 enableCheckConnection = true;
56 }
57
58 // FIXME : should use Checkbox.toggled signal
59 // lp:~nick-dedekind/ubuntu-ui-toolkit/checkbox.toggled
60 onCheckedChanged: {
61 if (!enableCheckConnection) {
62 return;
63 }
64 var oldEnable = enableCheckConnection;
65 enableCheckConnection = false;
66
67 menu.checked = checked;
68 menu.triggered(menu.checked);
69
70 enableCheckConnection = oldEnable;
71 }
72
73 Connections {
74 target: menu
75 onCheckedChanged: {
76 if (!checkbox.enableCheckConnection) {
77 return;
78 }
79 var oldEnable = checkbox.enableCheckConnection;
80 checkbox.enableCheckConnection = false;
81
82 checkbox.checked = menu.checked;
83
84 checkbox.enableCheckConnection = oldEnable;
85 }
86 }
87
88 Connections {
89 target: menu.__mouseArea
90 onClicked: {
91 checkbox.clicked();
92 }
93 }
94 }
95
96 Icon {
97 id: iconSignal
98 objectName: "iconSignal"
99
100 color: Theme.palette.selected.backgroundText
101
102 width: height
103 height: Math.min(units.gu(3), parent.height - units.gu(1))
104 anchors {
105 left: checkbox.right
106 leftMargin: units.gu(1)
107 verticalCenter: parent.verticalCenter
108 }
109
110 name: {48 name: {
111 var imageName = "nm-signal-100"49 var imageName = "nm-signal-100"
11250
@@ -135,7 +73,7 @@
135 rightMargin: menu.__contentsMargins73 rightMargin: menu.__contentsMargins
136 }74 }
137 elide: Text.ElideRight75 elide: Text.ElideRight
138 opacity: label.enabled ? 1.0 : 0.576 color: active ? UbuntuColors.green : Theme.palette.selected.backgroundText
139 }77 }
14078
141 Icon {79 Icon {
@@ -144,7 +82,7 @@
144 visible: secure82 visible: secure
145 name: "network-secure"83 name: "network-secure"
14684
147 color: Theme.palette.selected.backgroundText85 color: active ? UbuntuColors.green : Theme.palette.selected.backgroundText
14886
149 width: height87 width: height
150 height: Math.min(units.gu(3), parent.height - units.gu(1))88 height: Math.min(units.gu(3), parent.height - units.gu(1))
15189
=== modified file 'Ubuntu/Settings/Menus/ButtonMenu.qml'
--- Ubuntu/Settings/Menus/ButtonMenu.qml 2013-10-29 17:40:23 +0000
+++ Ubuntu/Settings/Menus/ButtonMenu.qml 2014-09-25 11:35:47 +0000
@@ -17,18 +17,20 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21
2222StandardMenu {
23ListItem.Standard {23 id: menu
24 property alias buttonText: button.text24 property string buttonText
2525
26 iconFrame: false26 component: Component {
27 Component.onCompleted: button.clicked.connect(clicked)27 Button {
2828 id: button
29 control: Button {29 objectName: "button"
30 id: button30 text: menu.buttonText
31 objectName: "button"31 width: Math.max(units.gu(5), implicitWidth)
32 width: Math.max(units.gu(5), implicitWidth)32
33 onClicked: menu.clicked()
34 }
33 }35 }
34}36}
3537
=== modified file 'Ubuntu/Settings/Menus/CMakeLists.txt'
--- Ubuntu/Settings/Menus/CMakeLists.txt 2014-06-27 13:56:26 +0000
+++ Ubuntu/Settings/Menus/CMakeLists.txt 2014-09-25 11:35:47 +0000
@@ -1,7 +1,5 @@
1project(UbuntuSettingsMenusQml)1project(UbuntuSettingsMenusQml)
22
3add_subdirectory(artwork)
4
5find_package(Qt5Core REQUIRED)3find_package(Qt5Core REQUIRED)
64
7include_directories(5include_directories(
86
=== modified file 'Ubuntu/Settings/Menus/CalendarMenu.qml'
--- Ubuntu/Settings/Menus/CalendarMenu.qml 2013-10-04 10:04:18 +0000
+++ Ubuntu/Settings/Menus/CalendarMenu.qml 2014-09-25 11:35:47 +0000
@@ -17,8 +17,8 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 1.0 as ListItem
22import Ubuntu.Settings.Components 0.122import Ubuntu.Settings.Components 0.1
2323
24ListItem.Empty {24ListItem.Empty {
@@ -31,7 +31,7 @@
31 property alias minimumDate: calendar.minimumDate31 property alias minimumDate: calendar.minimumDate
32 property alias selectedDate: calendar.selectedDate32 property alias selectedDate: calendar.selectedDate
3333
34 implicitHeight: column.height34 __height: column.height
3535
36 Column {36 Column {
37 id: column37 id: column
@@ -54,7 +54,6 @@
54 right: parent.right54 right: parent.right
55 }55 }
56 fontSize: "large"56 fontSize: "large"
57 //ItemStyle.class: "label label-date"
58 text: Qt.formatDate(calendar.currentDate, "MMMM") + " " + calendar.currentDate.getFullYear()57 text: Qt.formatDate(calendar.currentDate, "MMMM") + " " + calendar.currentDate.getFullYear()
59 }58 }
6059
6160
=== modified file 'Ubuntu/Settings/Menus/CheckableMenu.qml'
--- Ubuntu/Settings/Menus/CheckableMenu.qml 2013-12-13 11:04:38 +0000
+++ Ubuntu/Settings/Menus/CheckableMenu.qml 2014-09-25 11:35:47 +0000
@@ -18,15 +18,16 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.1 as Components21import Ubuntu.Components 1.1 as Components
22import Ubuntu.Components.ListItems 0.1 as ListItem22import Ubuntu.Components.ListItems 1.0 as ListItem
2323
24ListItem.Empty {24ListItem.Empty {
25 id: menu25 id: menu
2626
27 property alias text: label.text27 property alias text: label.text
28 property bool checked: false28 property bool checked: false
29 __acceptEvents: false29
30 onClicked: menu.checked = !menu.checked
3031
31 Components.CheckBox {32 Components.CheckBox {
32 id: checkbox33 id: checkbox
@@ -43,8 +44,7 @@
43 checked = menu.checked;44 checked = menu.checked;
44 }45 }
4546
46 // FIXME : should use Checkbox.toggled signal47 // FIXME : create a bi-directional feedback component
47 // lp:~nick-dedekind/ubuntu-ui-toolkit/checkbox.toggled
48 onCheckedChanged: {48 onCheckedChanged: {
49 if (!enableCheckConnection) {49 if (!enableCheckConnection) {
50 return;50 return;
@@ -72,13 +72,6 @@
72 checkbox.enableCheckConnection = oldEnable;72 checkbox.enableCheckConnection = oldEnable;
73 }73 }
74 }74 }
75
76 Connections {
77 target: menu.__mouseArea
78 onClicked: {
79 checkbox.clicked();
80 }
81 }
82 }75 }
8376
84 Components.Label {77 Components.Label {
@@ -91,6 +84,5 @@
91 verticalCenter: parent.verticalCenter84 verticalCenter: parent.verticalCenter
92 }85 }
93 elide: Text.ElideRight86 elide: Text.ElideRight
94 opacity: label.enabled ? 1.0 : 0.5
95 }87 }
96}88}
9789
=== modified file 'Ubuntu/Settings/Menus/EventMenu.qml'
--- Ubuntu/Settings/Menus/EventMenu.qml 2014-05-22 23:58:14 +0000
+++ Ubuntu/Settings/Menus/EventMenu.qml 2014-09-25 11:35:47 +0000
@@ -17,9 +17,8 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.1 as Components20import Ubuntu.Components 1.1
21import Ubuntu.Settings.Components 0.1 as USC21import Ubuntu.Components.ListItems 1.0 as ListItems
22import Ubuntu.Components.ListItems 0.1 as ListItems
2322
24ListItems.Empty {23ListItems.Empty {
25 id: menu24 id: menu
@@ -29,10 +28,10 @@
29 property alias time: dateLabel.text28 property alias time: dateLabel.text
30 property alias eventColor: iconVisual.color29 property alias eventColor: iconVisual.color
3130
32 USC.IconVisual {31 Icon {
33 id: iconVisual32 id: iconVisual
34 source: "image://theme/calendar"33 source: "image://theme/calendar"
35 visible: status == Image.Ready34 visible: source != ""
36 color: Theme.palette.selected.backgroundText35 color: Theme.palette.selected.backgroundText
3736
38 height: Math.min(units.gu(3), parent.height - units.gu(1))37 height: Math.min(units.gu(3), parent.height - units.gu(1))
@@ -45,7 +44,7 @@
45 }44 }
46 }45 }
4746
48 Components.Label {47 Label {
49 id: label48 id: label
50 anchors {49 anchors {
51 verticalCenter: parent.verticalCenter50 verticalCenter: parent.verticalCenter
@@ -55,17 +54,18 @@
55 rightMargin: menu.__contentsMargins54 rightMargin: menu.__contentsMargins
56 }55 }
57 elide: Text.ElideRight56 elide: Text.ElideRight
58 opacity: label.enabled ? 1.0 : 0.557 maximumLineCount: 1
58 opacity: enabled ? 1.0 : 0.5
59 }59 }
6060
61 Components.Label {61 Label {
62 id: dateLabel62 id: dateLabel
63 color: Theme.palette.normal.backgroundText
6463
65 anchors {64 anchors {
66 verticalCenter: parent.verticalCenter65 verticalCenter: parent.verticalCenter
67 right: parent.right66 right: parent.right
68 rightMargin: menu.__contentsMargins67 rightMargin: menu.__contentsMargins
69 }68 }
69 opacity: enabled ? 1.0 : 0.5
70 }70 }
71}71}
7272
=== modified file 'Ubuntu/Settings/Menus/GroupedMessageMenu.qml'
--- Ubuntu/Settings/Menus/GroupedMessageMenu.qml 2013-12-13 16:00:06 +0000
+++ Ubuntu/Settings/Menus/GroupedMessageMenu.qml 2014-09-25 11:35:47 +0000
@@ -19,44 +19,40 @@
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.0
22import Ubuntu.Components 0.122import Ubuntu.Components 1.1
23import Ubuntu.Components.ListItems 0.1 as ListItem23import Ubuntu.Components.ListItems 1.0 as ListItem
2424
25ListItem.Standard {25StandardMenu {
26 id: menu26 id: menu
2727
28 property alias count: label.text28 property string count: "0"
2929
30 signal dismissed()30 signal dismissed()
3131
32 iconSource: Qt.resolvedUrl("artwork/default_app.svg")32 iconSource: Qt.resolvedUrl("image://theme/message")
3333
34 control: UbuntuShape {34 component: Component {
35 height: label.height + units.gu(2)35 UbuntuShape {
36 width: label.width + units.gu(2)36 height: label.implicitHeight + units.gu(2)
37 color: Theme.palette.normal.backgroundText37 width: label.implicitWidth + units.gu(2)
38 radius: "medium"38
3939 color: Theme.palette.normal.backgroundText
40 Label {40 radius: "medium"
41 id: label41
42 objectName: "messageCount"42 Label {
4343 id: label
44 anchors {44 objectName: "messageCount"
45 horizontalCenter: parent.horizontalCenter45
46 verticalCenter: parent.verticalCenter46 anchors {
47 }47 horizontalCenter: parent.horizontalCenter
48 horizontalAlignment: Text.AlignRight48 verticalCenter: parent.verticalCenter
49 font.weight: Font.DemiBold49 }
50 fontSize: "medium"50 horizontalAlignment: Text.AlignRight
51 text: "0"51 font.weight: Font.DemiBold
5252 fontSize: "medium"
53 color: Theme.palette.normal.foregroundText53 text: menu.count
54 }54
5555 color: Theme.palette.normal.foregroundText
56 Connections {
57 target: menu.__mouseArea
58 onClicked: {
59 menu.clicked();
60 }56 }
61 }57 }
62 }58 }
6359
=== modified file 'Ubuntu/Settings/Menus/MediaPlayerMenu.qml'
--- Ubuntu/Settings/Menus/MediaPlayerMenu.qml 2013-10-04 10:04:18 +0000
+++ Ubuntu/Settings/Menus/MediaPlayerMenu.qml 2014-09-25 11:35:47 +0000
@@ -17,13 +17,14 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 1.0 as ListItem
22import QtQuick.Layouts 1.1
2223
23ListItem.Empty {24ListItem.Empty {
24 id: menu25 id: menu
2526
26 property bool running: false27 property bool showTrack: false
27 property alias playerName: playerNameLabel.text28 property alias playerName: playerNameLabel.text
28 property alias playerIcon: playerIcon.source29 property alias playerIcon: playerIcon.source
2930
@@ -32,7 +33,7 @@
32 property alias artist: artistLabel.text33 property alias artist: artistLabel.text
33 property alias album: albumLabel.text34 property alias album: albumLabel.text
3435
35 implicitHeight: column.height + units.gu(2)36 __height: column.height + units.gu(2)
36 Behavior on implicitHeight { UbuntuNumberAnimation {} }37 Behavior on implicitHeight { UbuntuNumberAnimation {} }
3738
38 Column {39 Column {
@@ -40,48 +41,43 @@
40 anchors {41 anchors {
41 left: parent.left42 left: parent.left
42 right: parent.right43 right: parent.right
43 top: parent.top
44 topMargin: units.gu(1)
45 leftMargin: menu.__contentsMargins44 leftMargin: menu.__contentsMargins
46 rightMargin: menu.__contentsMargins45 rightMargin: menu.__contentsMargins
46 verticalCenter: parent.verticalCenter
47 }47 }
48 height: running ? trackRow.height : playerRow.height
4948
50 Row {49 RowLayout {
51 objectName: "player"50 objectName: "player"
52 id: playerRow51 id: playerRow
53 spacing: menu.__contentsMargins52 spacing: menu.__contentsMargins
54 visible: !running53 visible: !showTrack
5554 anchors { left: parent.left; right: parent.right }
56 Behavior on opacity { UbuntuNumberAnimation {} }55
5756 Image {
58 UbuntuShape {57 id: playerIcon
59 width: units.gu(5)58 Layout.preferredHeight: units.gu(5)
60 height: width59 Layout.preferredWidth: units.gu(5)
61
62 image: Image {
63 id: playerIcon
64 }
65 }60 }
6661
67 Label {62 Label {
68 id: playerNameLabel63 id: playerNameLabel
69 anchors.verticalCenter: parent.verticalCenter64 Layout.fillWidth: true
65 Layout.alignment: Qt.AlignVCenter
66 elide: Text.ElideRight
67 maximumLineCount: 1
70 }68 }
71 }69 }
7270
73 Row {71 RowLayout {
74 objectName: "albumArt"72 objectName: "albumArt"
75 id: trackRow73 id: trackRow
76 width: menu.width
77 spacing: units.gu(2)74 spacing: units.gu(2)
78 visible: running75 visible: showTrack
7976 anchors { left: parent.left; right: parent.right }
80 Behavior on opacity { UbuntuNumberAnimation {} }
8177
82 UbuntuShape {78 UbuntuShape {
83 width: units.gu(10)79 Layout.preferredHeight: units.gu(8)
84 height: width80 Layout.preferredWidth: units.gu(8)
8581
86 image: Image {82 image: Image {
87 id: albumArtImage83 id: albumArtImage
@@ -89,19 +85,33 @@
89 }85 }
9086
91 Column {87 Column {
92 spacing: units.gu(1)88 Layout.alignment: Qt.AlignVCenter
93 anchors.verticalCenter: parent.verticalCenter89 Layout.fillWidth: true
90 spacing: units.gu(0.5)
9491
95 Label {92 Label {
96 id: songLabel93 id: songLabel
94 elide: Text.ElideRight
95 maximumLineCount: 1
96 visible: text !== ""
97 anchors { left: parent.left; right: parent.right }
97 }98 }
9899
99 Label {100 Label {
100 id: artistLabel101 id: artistLabel
102 elide: Text.ElideRight
103 maximumLineCount: 1
104 visible: text !== ""
105 anchors { left: parent.left; right: parent.right }
101 }106 }
102107
103 Label {108 Label {
104 id: albumLabel109 id: albumLabel
110 elide: Text.ElideRight
111 maximumLineCount: 1
112 fontSize: "small"
113 visible: text !== ""
114 anchors { left: parent.left; right: parent.right }
105 }115 }
106 }116 }
107 }117 }
108118
=== modified file 'Ubuntu/Settings/Menus/PlaybackItemMenu.qml'
--- Ubuntu/Settings/Menus/PlaybackItemMenu.qml 2013-10-04 10:04:18 +0000
+++ Ubuntu/Settings/Menus/PlaybackItemMenu.qml 2014-09-25 11:35:47 +0000
@@ -17,8 +17,9 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 1.0 as ListItem
22import QtQuick.Layouts 1.1
2223
23ListItem.Empty {24ListItem.Empty {
24 id: menu25 id: menu
@@ -33,66 +34,74 @@
33 signal play(bool play)34 signal play(bool play)
34 signal previous()35 signal previous()
3536
36 implicitHeight: controlsRow.height + units.gu(2)37 highlightWhenPressed: false
3738 implicitHeight: layout.implicitHeight + units.gu(2)
38 Row {39
39 id: controlsRow40 RowLayout {
4041 id: layout
41 anchors {42 anchors.centerIn: parent
42 top: parent.top43 spacing: units.gu(3)
43 topMargin: units.gu(1)44
44 horizontalCenter: parent.horizontalCenter45 Icon {
45 }
46 spacing: units.gu(2)
47
48 Button {
49 objectName: "previousButton"46 objectName: "previousButton"
50 width: units.gu(5)47
51 height: width48 Layout.preferredWidth: units.gu(5)
52 onClicked: menu.previous()49 Layout.preferredHeight: units.gu(5)
53 text: ""50
51 source: "image://theme/media-skip-backward"
52 color: {
53 if (!enabled)
54 return Theme.palette.normal.backgroundText;
55 return prevMA.pressed ? Theme.palette.selected.foreground : Theme.palette.normal.foregroundText;
56 }
54 enabled: canGoPrevious57 enabled: canGoPrevious
55 anchors.verticalCenter: parent.verticalCenter
5658
57 Icon {59 MouseArea {
60 id: prevMA
58 anchors.fill: parent61 anchors.fill: parent
59 anchors.margins: units.gu(1)62 onClicked: menu.previous()
60 name: "media-skip-backward"
61 color: Theme.palette.normal.foregroundText
62 }63 }
63 }64 }
6465
65 Button {66 Icon {
66 objectName: "playButton"67 objectName: "playButton"
67 width: units.gu(6)68
68 height: width69 Layout.preferredWidth: units.gu(5)
69 onClicked: menu.play(!playing)70 Layout.preferredHeight: units.gu(5)
70 text: ""71
72 source: playing ? "image://theme/media-playback-pause" : "image://theme/media-playback-start"
73 color: {
74 if (!enabled)
75 return Theme.palette.normal.backgroundText;
76 return playMA.pressed ? Theme.palette.selected.foreground : Theme.palette.normal.foregroundText;
77 }
71 enabled: canPlay78 enabled: canPlay
72 anchors.verticalCenter: parent.verticalCenter
7379
74 Icon {80 MouseArea {
81 id: playMA
75 anchors.fill: parent82 anchors.fill: parent
76 anchors.margins: units.gu(1)83 onClicked: menu.play(!playing)
77 name: playing ? "media-playback-pause" : "media-playback-start"
78 color: Theme.palette.normal.foregroundText
79 }84 }
80 }85 }
8186
82 Button {87 Icon {
83 objectName: "nextButton"88 objectName: "nextButton"
84 width: units.gu(5)89
85 height: width90 Layout.preferredWidth: units.gu(5)
86 onClicked: menu.next()91 Layout.preferredHeight: units.gu(5)
87 text: ""92
93 source: "image://theme/media-skip-forward"
94 color: {
95 if (!enabled)
96 return Theme.palette.normal.backgroundText;
97 return nextMA.pressed ? Theme.palette.selected.foreground : Theme.palette.normal.foregroundText;
98 }
88 enabled: canGoNext99 enabled: canGoNext
89 anchors.verticalCenter: parent.verticalCenter
90100
91 Icon {101 MouseArea {
102 id: nextMA
92 anchors.fill: parent103 anchors.fill: parent
93 anchors.margins: units.gu(1)104 onClicked: menu.next()
94 name: "media-skip-forward"
95 color: Theme.palette.normal.foregroundText
96 }105 }
97 }106 }
98 }107 }
99108
=== modified file 'Ubuntu/Settings/Menus/ProgressBarMenu.qml'
--- Ubuntu/Settings/Menus/ProgressBarMenu.qml 2013-10-04 10:04:18 +0000
+++ Ubuntu/Settings/Menus/ProgressBarMenu.qml 2014-09-25 11:35:47 +0000
@@ -17,17 +17,25 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 1.0 as ListItem
2222
23ListItem.Standard {23StandardMenu {
24 property alias indeterminate: progressBar.indeterminate24 id: menu
25 property alias minimumValue: progressBar.minimumValue25 property bool indeterminate: false
26 property alias maximumValue: progressBar.maximumValue26 property real minimumValue: 0.0
27 property alias value: progressBar.value27 property real maximumValue: 1.0
2828 property real value: 0.0
29 control: ProgressBar {29
30 id: progressBar30 component: Component {
31 width: units.gu(20)31 ProgressBar {
32 id: progressBar
33 width: units.gu(20)
34
35 indeterminate: menu.indeterminate
36 minimumValue: menu.minimumValue
37 maximumValue: menu.maximumValue
38 value: menu.value
39 }
32 }40 }
33}41}
3442
=== modified file 'Ubuntu/Settings/Menus/ProgressValueMenu.qml'
--- Ubuntu/Settings/Menus/ProgressValueMenu.qml 2013-10-04 10:04:18 +0000
+++ Ubuntu/Settings/Menus/ProgressValueMenu.qml 2014-09-25 11:35:47 +0000
@@ -18,19 +18,20 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.ListItems 0.1 as ListItem
2322
24ListItem.Standard {23StandardMenu {
25 id: menuItem24 id: menuItem
2625
27 property int value : 0.026 property int value : 0.0
2827
29 control: Label {28 component: Component {
30 id: progress29 Label {
31 objectName: "progress"30 id: progress
31 objectName: "progress"
3232
33 text: menuItem.value + " %"33 text: menuItem.value + " %"
34 fontSize: "medium"34 fontSize: "medium"
35 }
35 }36 }
36}37}
3738
=== modified file 'Ubuntu/Settings/Menus/SectionMenu.qml'
--- Ubuntu/Settings/Menus/SectionMenu.qml 2013-12-13 11:23:11 +0000
+++ Ubuntu/Settings/Menus/SectionMenu.qml 2014-09-25 11:35:47 +0000
@@ -18,8 +18,8 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.ListItems 0.1 as ListItem22import Ubuntu.Components.ListItems 1.0 as ListItem
2323
24ListItem.Header {24ListItem.Header {
25 id: menuItem25 id: menuItem
2626
=== modified file 'Ubuntu/Settings/Menus/SeparatorMenu.qml'
--- Ubuntu/Settings/Menus/SeparatorMenu.qml 2013-10-04 10:04:18 +0000
+++ Ubuntu/Settings/Menus/SeparatorMenu.qml 2014-09-25 11:35:47 +0000
@@ -1,11 +1,7 @@
1import QtQuick 2.01import QtQuick 2.0
2import Ubuntu.Components.ListItems 0.1 as ListItem2import Ubuntu.Components.ListItems 1.0 as ListItem
33
4ListItem.Empty {4ListItem.Empty {
5 implicitHeight: units.gu(1)5 __height: units.gu(1)
66 highlightWhenPressed: false
7 Rectangle {
8 color: Qt.rgba(0.0, 0, 0, 0.15)
9 anchors.fill: parent
10 }
11}7}
128
=== renamed file 'Ubuntu/Settings/Menus/HeroMessageMenu.qml' => 'Ubuntu/Settings/Menus/SimpleMessageMenu.qml'
--- Ubuntu/Settings/Menus/HeroMessageMenu.qml 2013-10-29 17:40:23 +0000
+++ Ubuntu/Settings/Menus/SimpleMessageMenu.qml 2014-09-25 11:35:47 +0000
@@ -18,75 +18,92 @@
18 * Olivier Tilloy <olivier.tilloy@canonical.com>18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.1
22import Ubuntu.Components 0.122import Ubuntu.Components 1.1
23import Ubuntu.Components.ListItems 0.1 as ListItem23import Ubuntu.Components.ListItems 1.0 as ListItem
24import Ubuntu.Settings.Components 0.1 as USC24import Ubuntu.Settings.Components 0.1 as USC
25import QtQuick.Layouts 1.1
2526
26ListItem.Empty {27ListItem.Empty {
27 id: menu28 id: menu
2829
29 property alias heroMessageHeader: __heroMessageHeader30 property alias title: messageHeader.title
30 property real collapsedHeight: heroMessageHeader.y + heroMessageHeader.bodyBottom + units.gu(2)31 property alias time: messageHeader.time
31 property real expandedHeight: collapsedHeight32 property alias body: messageHeader.body
3233
33 property url avatar34 property url avatar
34 property url appIcon35 property url icon
3536
36 signal appActivated37 signal iconActivated
37 signal dismissed38 signal dismissed
3839
39 implicitHeight: collapsedHeight40 property alias footer: footerLoader.sourceComponent
4041 property real _animationDuration: UbuntuAnimation.FastDuration
41 Rectangle {42
42 id: background43 __height: layout.implicitHeight + units.gu(3)
43 property real alpha: 0.044 clip: heightAnimation.running
4445
45 anchors.fill: parent46 ColumnLayout {
46 color: Qt.rgba(1.0, 1.0, 1.0, alpha)47 id: layout
47 z: -148
48 }49 anchors {
4950 left: parent.left
50 USC.HeroMessageHeader {51 right: parent.right
51 id: __heroMessageHeader52 leftMargin: units.gu(2)
5253 rightMargin: units.gu(2)
53 anchors.top: parent.top54 top: parent.top
54 anchors.left: parent.left55 topMargin: units.gu(1.5)
55 anchors.right: parent.right56 }
5657 spacing: units.gu(1.5)
57 avatar: menu.avatar != "" ? menu.avatar : "artwork/default_contact.png"58
58 appIcon: menu.appIcon != "" ? menu.appIcon : "artwork/default_app.svg"59 USC.MessageHeader {
59 icon: appIcon60 id: messageHeader
6061 Layout.fillWidth: true
61 state: menu.state62 Layout.alignment: Qt.AlignTop
6263
63 onAppIconClicked: {64 avatar: menu.avatar != "" ? menu.avatar : "image://theme/contact"
64 menu.appActivated();65 icon: menu.icon != "" ? menu.icon : "image://theme/message"
65 }66
66 }67 state: menu.state
68
69 onIconClicked: {
70 menu.iconActivated();
71 }
72 }
73
74 Loader {
75 id: footerLoader
76 visible: menu.state === "expanded"
77 opacity: 0.0
78 asynchronous: false
79 Layout.fillWidth: true
80 Layout.fillHeight: true
81 }
82 }
83
84 Behavior on height {
85 NumberAnimation {
86 id: heightAnimation
87 duration: _animationDuration
88 easing.type: Easing.OutQuad
89 }
90 }
91
92 onTriggered: if (!footer || !selected) messageHeader.shakeIcon();
6793
68 states: State {94 states: State {
69 name: "expanded"95 name: "expanded"
70 when: selected96 when: selected && footerLoader.status == Loader.Ready
7197
72 PropertyChanges {98 PropertyChanges {
73 target: menu99 target: footerLoader
74 implicitHeight: menu.expandedHeight100 opacity: 1.0
75 }
76 PropertyChanges {
77 target: background
78 alpha: 0.05
79 }101 }
80 }102 }
81103
82 transitions: Transition {104 transitions: Transition {
83 ParallelAnimation {105 ParallelAnimation {
84 NumberAnimation {106 PropertyAnimation { target: footerLoader; property: "opacity"; duration: _animationDuration }
85 properties: "opacity,implicitHeight"
86 duration: 200
87 easing.type: Easing.OutQuad
88 }
89 ColorAnimation {}
90 }107 }
91 }108 }
92109
93110
=== removed file 'Ubuntu/Settings/Menus/SimpleTextMessageMenu.qml'
--- Ubuntu/Settings/Menus/SimpleTextMessageMenu.qml 2013-12-13 16:50:22 +0000
+++ Ubuntu/Settings/Menus/SimpleTextMessageMenu.qml 1970-01-01 00:00:00 +0000
@@ -1,99 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23
24HeroMessageMenu {
25 id: menu
26
27 property string title: ""
28 property string time: ""
29 property string message: ""
30
31 property alias footer: footerLoader.sourceComponent
32
33 expandedHeight: collapsedHeight + fullMessage.height
34 heroMessageHeader.titleText.text: title
35 heroMessageHeader.subtitleText.text: time
36 heroMessageHeader.bodyText.text: message
37
38 Item {
39 id: fullMessage
40
41 anchors {
42 left: parent.left
43 leftMargin: units.gu(2)
44 right: parent.right
45 rightMargin: units.gu(2)
46 top: heroMessageHeader.bottom
47 }
48 height: childrenRect.height
49 opacity: 0.0
50 enabled: false
51
52 Label {
53 id: bodyText
54 anchors {
55 top: parent.top
56 left: parent.left
57 right: parent.right
58 }
59 wrapMode: Text.WordWrap
60 elide: Text.ElideRight
61 fontSize: "medium"
62 text: heroMessageHeader.bodyText.text
63 }
64
65 Loader {
66 id: footerLoader
67
68 anchors {
69 top: bodyText.bottom
70 topMargin: item ? units.gu(2) : 0
71 left: parent.left
72 right: parent.right
73 }
74 height: item ? units.gu(4) : 0
75 }
76
77 states: State {
78 name: "expanded"
79 when: menu.state === "expanded"
80
81 PropertyChanges {
82 target: heroMessageHeader.bodyText
83 opacity: 0.0
84 }
85
86 PropertyChanges {
87 target: fullMessage
88 opacity: 1.0
89 enabled: true
90 }
91 }
92 transitions: Transition {
93 NumberAnimation {
94 property: "opacity"
95 duration: 200
96 }
97 }
98 }
99}
1000
=== modified file 'Ubuntu/Settings/Menus/SliderMenu.qml'
--- Ubuntu/Settings/Menus/SliderMenu.qml 2014-05-27 14:36:33 +0000
+++ Ubuntu/Settings/Menus/SliderMenu.qml 2014-09-25 11:35:47 +0000
@@ -17,9 +17,8 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Settings.Components 0.1 as USC21import Ubuntu.Components.ListItems 1.0 as ListItem
22import Ubuntu.Components.ListItems 0.1 as ListItem
2322
24ListItem.Empty {23ListItem.Empty {
25 id: menu24 id: menu
@@ -126,10 +125,10 @@
126 }125 }
127 height: slider.height126 height: slider.height
128127
129 USC.IconVisual {128 Icon {
130 id: leftButton129 id: leftButton
131 objectName: "leftButton"130 objectName: "leftButton"
132 visible: status === Image.Ready131 visible: source != ""
133 anchors.left: row.left132 anchors.left: row.left
134 anchors.verticalCenter: row.verticalCenter133 anchors.verticalCenter: row.verticalCenter
135 height: slider.height - units.gu(2)134 height: slider.height - units.gu(2)
@@ -182,10 +181,10 @@
182 }181 }
183 }182 }
184183
185 USC.IconVisual {184 Icon {
186 id: rightButton185 id: rightButton
187 objectName: "rightButton"186 objectName: "rightButton"
188 visible: status === Image.Ready187 visible: source != ""
189 anchors.right: row.right188 anchors.right: row.right
190 anchors.verticalCenter: row.verticalCenter189 anchors.verticalCenter: row.verticalCenter
191 height: slider.height - units.gu(2)190 height: slider.height - units.gu(2)
192191
=== modified file 'Ubuntu/Settings/Menus/SnapDecisionMenu.qml'
--- Ubuntu/Settings/Menus/SnapDecisionMenu.qml 2013-10-29 17:40:23 +0000
+++ Ubuntu/Settings/Menus/SnapDecisionMenu.qml 2014-09-25 11:35:47 +0000
@@ -19,142 +19,80 @@
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.0
22import Ubuntu.Components 0.122import Ubuntu.Components 1.1
23import Ubuntu.Settings.Components 0.1 as USC23import Ubuntu.Settings.Components 0.1 as USC
24import QtQuick.Layouts 1.1
2425
25HeroMessageMenu {26SimpleMessageMenu {
26 id: menu27 id: menu
2728
28 property string title: ""29 property bool actionEnabled: true
29 property string time: ""30 property string actionButtonText: i18n.tr("Call back")
30 property string message: ""
31
32 property bool activateEnabled: true
33 property alias actionButtonText: actionButton.text
3431
35 property bool replyEnabled: true32 property bool replyEnabled: true
36 property alias replyMessages: quickreply.messages33 property string replyButtonText: i18n.tr("Send")
37 property alias replyButtonText: quickreply.buttonText34
3835 signal actionActivated
39 expandedHeight: collapsedHeight + buttons.height + quickreply.height
40 heroMessageHeader.titleText.text: title
41 heroMessageHeader.subtitleText.text: message
42 heroMessageHeader.bodyText.text: time
43
44 signal activated
45 signal replied(string value)36 signal replied(string value)
4637
47 Item {38 footer: Item {
48 id: buttons39 id: buttons
4940
50 anchors.left: parent.left41 implicitHeight: layout.implicitHeight
51 anchors.leftMargin: units.gu(2)42
52 anchors.right: parent.right43 ColumnLayout {
53 anchors.rightMargin: units.gu(2)44 id: layout
54 anchors.top: heroMessageHeader.bottom45 anchors {
55 anchors.topMargin: units.gu(1)46 left: parent.left
56 height: units.gu(4)47 right: parent.right
57 opacity: 0.048 }
5849 spacing: units.gu(1)
59 Button {50
60 objectName: "messageButton"51 RowLayout {
61 text: "Message"52 spacing: units.gu(2)
62 anchors.left: parent.left53
63 anchors.top: parent.top54 Button {
64 anchors.bottom: parent.bottom55 objectName: "messageButton"
65 width: (parent.width - units.gu(1)) / 256 text: i18n.tr("Message")
66 gradient: UbuntuColors.greyGradient57 Layout.fillWidth: true
6758
68 onClicked: {59 onClicked: {
69 if (quickreply.state === "") {60 if (reply.state === "") {
70 quickreply.state = "expanded";61 reply.state = "expanded";
71 } else {62 } else {
72 quickreply.state = "";63 reply.state = "";
73 }64 }
74 }65 }
75 }66 }
7667
77 Button {68 Button {
78 id: actionButton69 id: actionButton
79 objectName: "actionButton"70 objectName: "actionButton"
80 text: "Call back"71 enabled: menu.actionEnabled
81 anchors.right: parent.right72 text: actionButtonText
82 anchors.top: parent.top73 color: UbuntuColors.green
83 anchors.bottom: parent.bottom74 Layout.fillWidth: true
84 width: (parent.width - units.gu(1)) / 275
85 enabled: menu.activateEnabled76 onClicked: {
8677 menu.actionActivated();
87 onClicked: {78 }
88 menu.activated();79 }
89 }80 }
90 }81
9182 USC.ActionTextField {
92 states: State {83 id: reply
93 name: "expanded"84
94 when: menu.state === "expanded"85 Layout.fillWidth: true
9586 Layout.fillHeight: true
96 PropertyChanges {87 visible: state == "expanded"
97 target: buttons88
98 opacity: 1.089 activateEnabled: menu.replyEnabled
99 }90 buttonText: menu.replyButtonText
100 }91
101 transitions: Transition {92 onActivated: {
102 NumberAnimation {93 menu.replied(value);
103 property: "opacity"94 }
104 duration: 20095 }
105 easing.type: Easing.OutQuad
106 }
107 }
108 }
109
110 USC.QuickReply {
111 id: quickreply
112
113 onReplied: {
114 menu.replied(value);
115 }
116
117 messages: ""
118 buttonText: "Send"
119 anchors {
120 top: buttons.bottom
121 topMargin: units.gu(2)
122 left: parent.left
123 right: parent.right
124 }
125 height: 0
126 opacity: 0.0
127 enabled: false
128 replyEnabled: menu.replyEnabled
129 messageMargins: __contentsMargins
130
131 states: State {
132 name: "expanded"
133
134 PropertyChanges {
135 target: quickreply
136 height: expandedHeight + units.gu(2)
137 opacity: 1.0
138 }
139
140 PropertyChanges {
141 target: quickreply
142 enabled: true
143 }
144 }
145
146 transitions: Transition {
147 NumberAnimation {
148 properties: "opacity,height"
149 duration: 200
150 easing.type: Easing.OutQuad
151 }
152 }
153 }
154
155 onStateChanged: {
156 if (state === "") {
157 quickreply.state = "";
158 }96 }
159 }97 }
160}98}
16199
=== modified file 'Ubuntu/Settings/Menus/StandardMenu.qml'
--- Ubuntu/Settings/Menus/StandardMenu.qml 2014-07-01 12:15:17 +0000
+++ Ubuntu/Settings/Menus/StandardMenu.qml 2014-09-25 11:35:47 +0000
@@ -15,9 +15,8 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.1 as Components18import Ubuntu.Components 1.1
19import Ubuntu.Settings.Components 0.1 as USC19import Ubuntu.Components.ListItems 1.0 as ListItems
20import Ubuntu.Components.ListItems 0.1 as ListItems
21import QtQuick.Layouts 1.120import QtQuick.Layouts 1.1
2221
23ListItems.Empty {22ListItems.Empty {
@@ -27,9 +26,22 @@
27 property alias text: label.text26 property alias text: label.text
28 property alias iconColor: iconVisual.color27 property alias iconColor: iconVisual.color
29 property alias component: componentLoader.sourceComponent28 property alias component: componentLoader.sourceComponent
29 property alias foregroundColor: label.color
30 property alias backColor: overlay.color
31
32 Rectangle {
33 id: overlay
34 color: "transparent"
35 visible: color !== "transparent"
36 anchors {
37 left: parent.left
38 right: parent.right
39 top: parent.top
40 }
41 height: menu.height - menu.divider.height
42 }
3043
31 RowLayout {44 RowLayout {
32
33 anchors {45 anchors {
34 fill: parent46 fill: parent
35 leftMargin: menu.__contentsMargins47 leftMargin: menu.__contentsMargins
@@ -37,9 +49,9 @@
37 }49 }
38 spacing: menu.__contentsMargins50 spacing: menu.__contentsMargins
3951
40 USC.IconVisual {52 Icon {
41 id: iconVisual53 id: iconVisual
42 visible: status == Image.Ready54 visible: source != ""
43 color: Theme.palette.selected.backgroundText55 color: Theme.palette.selected.backgroundText
4456
45 readonly property real size: Math.min(units.gu(3), parent.height - menu.__contentsMargins)57 readonly property real size: Math.min(units.gu(3), parent.height - menu.__contentsMargins)
@@ -49,18 +61,22 @@
49 Layout.alignment: Qt.AlignVCenter61 Layout.alignment: Qt.AlignVCenter
50 }62 }
5163
52 Components.Label {64 Label {
53 id: label65 id: label
54 Layout.fillWidth: true66 Layout.fillWidth: true
55 Layout.alignment: Qt.AlignVCenter67 Layout.alignment: Qt.AlignVCenter
5668
57 elide: Text.ElideRight69 elide: Text.ElideRight
58 maximumLineCount: 170 maximumLineCount: 1
59 opacity: label.enabled ? 1.0 : 0.5
60 }71 }
6172
62 Loader {73 Loader {
63 id: componentLoader74 id: componentLoader
75 asynchronous: false
76 visible: status == Loader.Ready
77
78 Layout.preferredHeight: item ? item.height : 0
79 Layout.preferredWidth: item ? item.width : 0
64 }80 }
65 }81 }
66}82}
6783
=== modified file 'Ubuntu/Settings/Menus/SwitchMenu.qml'
--- Ubuntu/Settings/Menus/SwitchMenu.qml 2013-10-29 17:40:23 +0000
+++ Ubuntu/Settings/Menus/SwitchMenu.qml 2014-09-25 11:35:47 +0000
@@ -18,51 +18,52 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.ListItems 0.1 as ListItem
2322
24ListItem.Standard {23StandardMenu {
25 id: menu24 id: menu
2625
27 property bool checked: false26 property bool checked: false
28 iconFrame: false27
2928 onClicked: menu.checked = !menu.checked
30 control: Switch {29
31 id: switcher30 component: Component {
32 objectName: "switcher"31 Switch {
33 property bool enableCheckConnection: true32 id: switcher
3433 objectName: "switcher"
35 Component.onCompleted: {34 property bool enableCheckConnection: true
36 checked = menu.checked;35
37 }36 Component.onCompleted: {
3837 checked = menu.checked;
39 // FIXME : should use Checkbox.toggled signal
40 // lp:~nick-dedekind/ubuntu-ui-toolkit/checkbox.toggled
41 onCheckedChanged: {
42 if (!enableCheckConnection) {
43 return;
44 }38 }
45 var oldEnable = enableCheckConnection;39
46 enableCheckConnection = false;40 // FIXME : create a bi-directional feedback component
47
48 menu.checked = checked;
49 menu.triggered(menu.checked);
50
51 enableCheckConnection = oldEnable;
52 }
53
54 Connections {
55 target: menu
56 onCheckedChanged: {41 onCheckedChanged: {
57 if (!switcher.enableCheckConnection) {42 if (!enableCheckConnection) {
58 return;43 return;
59 }44 }
60 var oldEnable = switcher.enableCheckConnection;45 var oldEnable = enableCheckConnection;
61 switcher.enableCheckConnection = false;46 enableCheckConnection = false;
6247
63 switcher.checked = menu.checked;48 menu.checked = checked;
6449 menu.triggered(menu.checked);
65 switcher.enableCheckConnection = oldEnable;50
51 enableCheckConnection = oldEnable;
52 }
53
54 Connections {
55 target: menu
56 onCheckedChanged: {
57 if (!switcher.enableCheckConnection) {
58 return;
59 }
60 var oldEnable = switcher.enableCheckConnection;
61 switcher.enableCheckConnection = false;
62
63 switcher.checked = menu.checked;
64
65 switcher.enableCheckConnection = oldEnable;
66 }
66 }67 }
67 }68 }
68 }69 }
6970
=== modified file 'Ubuntu/Settings/Menus/TextMessageMenu.qml'
--- Ubuntu/Settings/Menus/TextMessageMenu.qml 2013-10-04 12:26:43 +0000
+++ Ubuntu/Settings/Menus/TextMessageMenu.qml 2014-09-25 11:35:47 +0000
@@ -19,19 +19,18 @@
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.0
22import Ubuntu.Components 0.122import Ubuntu.Components 1.1
23import Ubuntu.Settings.Components 0.1 as USC23import Ubuntu.Settings.Components 0.1 as USC
2424
25SimpleTextMessageMenu {25SimpleMessageMenu {
26 id: menu26 id: menu
2727
28 property bool replyEnabled: true28 property bool replyEnabled: true
29 property string replyButtonText: "Send"29 property string replyButtonText: i18n.tr("Send")
3030
31 signal replied(string value)31 signal replied(string value)
3232
33 footer: USC.ActionTextField {33 footer: USC.ActionTextField {
34 anchors.fill: parent
3534
36 activateEnabled: menu.replyEnabled35 activateEnabled: menu.replyEnabled
37 buttonText: menu.replyButtonText36 buttonText: menu.replyButtonText
3837
=== modified file 'Ubuntu/Settings/Menus/TimeZoneMenu.qml'
--- Ubuntu/Settings/Menus/TimeZoneMenu.qml 2013-10-04 10:04:18 +0000
+++ Ubuntu/Settings/Menus/TimeZoneMenu.qml 2014-09-25 11:35:47 +0000
@@ -17,17 +17,20 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 1.0 as ListItem
2222
23ListItem.Standard {23StandardMenu {
24 id: timeZoneMenu24 id: timeZoneMenu
2525
26 property alias city: timeZoneMenu.text26 property alias city: timeZoneMenu.text
27 property alias time: timeLabel.text27 property string time
2828
29 control: Label {29 component: Component {
30 id: timeLabel30 Label {
31 objectName: "timeLabel"31 id: timeLabel
32 objectName: "timeLabel"
33 text: time
34 }
32 }35 }
33}36}
3437
=== modified file 'Ubuntu/Settings/Menus/TransferMenu.qml'
--- Ubuntu/Settings/Menus/TransferMenu.qml 2014-07-04 17:27:20 +0000
+++ Ubuntu/Settings/Menus/TransferMenu.qml 2014-09-25 11:35:47 +0000
@@ -14,10 +14,11 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.1
18import Ubuntu.Components 0.1
19import Ubuntu.Components.ListItems 0.1 as ListItem
20import QtQuick.Layouts 1.118import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.1
20import Ubuntu.Components.ListItems 1.0 as ListItem
21import Ubuntu.Settings.Components 0.1
2122
22ListItem.Empty {23ListItem.Empty {
23 id: menu24 id: menu
@@ -30,7 +31,7 @@
3031
31 property alias maximum: progressBar.maximumValue32 property alias maximum: progressBar.maximumValue
3233
33 implicitHeight: row.height + units.gu(2)34 __height: row.height + units.gu(2)
3435
35 RowLayout {36 RowLayout {
36 id: row37 id: row
@@ -41,21 +42,23 @@
41 leftMargin: menu.__contentsMargins42 leftMargin: menu.__contentsMargins
42 rightMargin: menu.__contentsMargins43 rightMargin: menu.__contentsMargins
43 }44 }
4445 spacing: units.gu(2)
45 UbuntuShape {46
46 id: imageShape47 UbuntuShapeForItem {
47 Layout.preferredWidth: units.gu(5)48 Layout.preferredWidth: units.gu(6)
48 Layout.preferredHeight: units.gu(5)49 Layout.preferredHeight: units.gu(6)
4950
50 Layout.alignment: Qt.AlignTop51 image: icon
5152 Icon {
52 image: Image {53 id: icon
53 objectName: "icon"54 objectName: "icon"
54 id: icon55 anchors.fill: parent
5556
56 sourceSize {57 color: {
57 width: units.gu(5)58 if (String(source).match(/^image:\/\/theme/)) {
58 height: units.gu(5)59 return Theme.palette.selected.backgroundText;
60 }
61 return Qt.rgba(0.0, 0.0, 0.0, 0.0);
59 }62 }
60 }63 }
61 }64 }
@@ -70,6 +73,7 @@
7073
71 elide: Text.ElideRight74 elide: Text.ElideRight
72 maximumLineCount: 175 maximumLineCount: 1
76 font.weight: Font.DemiBold
73 }77 }
7478
75 ProgressBar {79 ProgressBar {
@@ -77,8 +81,9 @@
77 objectName: "progress"81 objectName: "progress"
78 visible: menu.active82 visible: menu.active
79 value: 0.083 value: 0.0
84 showProgressPercentage: false
8085
81 Layout.preferredHeight: units.gu(2)86 Layout.preferredHeight: units.gu(1)
82 Layout.fillWidth: true87 Layout.fillWidth: true
83 }88 }
8489
@@ -88,6 +93,7 @@
88 Layout.fillWidth: true93 Layout.fillWidth: true
89 visible: menu.active94 visible: menu.active
9095
96 fontSize: "x-small"
91 elide: Text.ElideRight97 elide: Text.ElideRight
92 maximumLineCount: 198 maximumLineCount: 1
93 }99 }
94100
=== modified file 'Ubuntu/Settings/Menus/UserSessionMenu.qml'
--- Ubuntu/Settings/Menus/UserSessionMenu.qml 2013-10-04 10:04:18 +0000
+++ Ubuntu/Settings/Menus/UserSessionMenu.qml 2014-09-25 11:35:47 +0000
@@ -17,29 +17,38 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 1.0 as ListItem
2222
23ListItem.Standard {23StandardMenu {
24 id: userSessionMenu24 id: userSessionMenu
2525
26 property alias name: userSessionMenu.text26 property alias name: userSessionMenu.text
27 property alias active: activeIcon.visible27 property bool active: false
2828
29 control: Rectangle {29 component: Component {
30 id: activeIcon30 Rectangle {
31 objectName: "activeIcon"31 id: activeIcon
32 width: checkMark.width + units.gu(1.5)32 objectName: "activeIcon"
33 height: checkMark.height + units.gu(1.5)33 width: checkMark.width + units.gu(1.5)
34 radius: width / 234 height: checkMark.height + units.gu(1.5)
35 antialiasing: true35 radius: width / 2
36 color: Theme.palette.normal.backgroundText36 antialiasing: true
37 visible: false37 color: Theme.palette.normal.backgroundText
3838 visible: userSessionMenu.active
39 Image {39
40 id: checkMark40 Image {
41 source: "artwork/CheckMark.png"41 id: checkMark
42 anchors.centerIn: parent42 source: "image://theme/tick"
43 height: units.gu(2)
44 width: height
45 anchors.centerIn: parent
46
47 sourceSize {
48 height: height
49 width: width
50 }
51 }
43 }52 }
44 }53 }
45}54}
4655
=== removed directory 'Ubuntu/Settings/Menus/artwork'
=== removed file 'Ubuntu/Settings/Menus/artwork/CMakeLists.txt'
--- Ubuntu/Settings/Menus/artwork/CMakeLists.txt 2014-06-27 09:35:26 +0000
+++ Ubuntu/Settings/Menus/artwork/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
1# export the artwork files.
2export_qmlfiles(Ubuntu.Settings.Menus.Art Ubuntu/Settings/Menus/artwork DESTINATION ${QT_IMPORTS_DIR})
30
=== removed file 'Ubuntu/Settings/Menus/artwork/CheckMark@18.png'
4Binary files Ubuntu/Settings/Menus/artwork/CheckMark@18.png 2013-09-25 08:54:58 +0000 and Ubuntu/Settings/Menus/artwork/CheckMark@18.png 1970-01-01 00:00:00 +0000 differ1Binary files Ubuntu/Settings/Menus/artwork/CheckMark@18.png 2013-09-25 08:54:58 +0000 and Ubuntu/Settings/Menus/artwork/CheckMark@18.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'Ubuntu/Settings/Menus/artwork/default_app.svg'
--- Ubuntu/Settings/Menus/artwork/default_app.svg 2013-10-04 09:48:04 +0000
+++ Ubuntu/Settings/Menus/artwork/default_app.svg 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3<svg id="svg15137" xmlns="http://www.w3.org/2000/svg" height="48" width="48" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink">
4 <defs id="defs15139">
5 <radialGradient id="radialGradient2612" gradientUnits="userSpaceOnUse" cy="4.625" cx="62.625" gradientTransform="matrix(1 0 0 .34118 0 3.0471)" r="10.625">
6 <stop id="stop8840" offset="0"/>
7 <stop id="stop8842" style="stop-opacity:0" offset="1"/>
8 </radialGradient>
9 <linearGradient id="linearGradient15133" y2=".24326" gradientUnits="userSpaceOnUse" x2="62.2" gradientTransform="matrix(2.1499 0 0 2.1499 -110.12 31.935)" y1="-12.489" x1="62.2">
10 <stop id="stop4875" style="stop-color:#fff" offset="0"/>
11 <stop id="stop4877" style="stop-color:#fff;stop-opacity:0" offset="1"/>
12 </linearGradient>
13 <radialGradient id="radialGradient15127" gradientUnits="userSpaceOnUse" cy="-8.7256" cx="62.2" gradientTransform="matrix(2.4129 0 0 2.413 -126.48 34.231)" r="9.7553">
14 <stop id="stop8649" style="stop-color:#8fb1dc" offset="0"/>
15 <stop id="stop8651" style="stop-color:#3465a4" offset="1"/>
16 </radialGradient>
17 <radialGradient id="radialGradient2418" gradientUnits="userSpaceOnUse" cy="24.149" cx="17.814" gradientTransform="matrix(-2.644 0 2.9365e-8 2.5344 78.725 -37.986)" r="9.125">
18 <stop id="stop4847" style="stop-color:#fff" offset="0"/>
19 <stop id="stop4849" style="stop-color:#b6b6b6" offset="1"/>
20 </radialGradient>
21 <radialGradient id="radialGradient5145" gradientUnits="userSpaceOnUse" cy="13.067" cx="23.86" gradientTransform="matrix(-1.5425 0 0 -.84553 60.718 23.829)" r="18.098">
22 <stop id="stop14112" style="stop-color:#557695" offset="0"/>
23 <stop id="stop14114" style="stop-color:#15395c" offset="1"/>
24 </radialGradient>
25 <radialGradient id="radialGradient5147" gradientUnits="userSpaceOnUse" cy="-3.442" cx="62.225" gradientTransform="matrix(1.1035 0 0 1.0265 -4.1555 -1.8158)" r="10.081">
26 <stop id="stop14118" style="stop-color:#9e9e9e" offset="0"/>
27 <stop id="stop14120" style="stop-color:#9e9e9e;stop-opacity:0" offset="1"/>
28 </radialGradient>
29 </defs>
30 <g id="layer1">
31 <path id="path8836" style="opacity:.4;fill-rule:evenodd;fill:url(#radialGradient2612)" d="m73.25 4.625a10.625 3.625 0 1 1 -21.25 0 10.625 3.625 0 1 1 21.25 0z" transform="matrix(2.1647 0 0 2.5637 -111.56 26.85)"/>
32 <g id="g15122" transform="translate(.79042 -.78563)">
33 <path id="path6495" style="stroke:#204a87;fill:url(#radialGradient15127)" d="m43.505 24.387c0 10.99-8.9091 19.899-19.897 19.899-10.989 0-19.898-8.9091-19.898-19.899 0-10.989 8.9086-19.897 19.898-19.897 10.988 0 19.897 8.9081 19.897 19.897z"/>
34 <path id="path6534" style="stroke:url(#radialGradient5147);stroke-width:1.1035;fill:url(#radialGradient5145)" d="m23.726 5.3141c-1.5283 0.12067-3.0328 0.36544-4.4919 0.84567-1.23 0.48843 0.88689-0.42988-0.37486-0.60468-0.75942-0.12994-1.0776 0.65251-1.7561 0.67046-0.7741 0.023841-1.3048 0.71572-2.0319 0.79898-0.26187 1.4432-0.59924-0.56894-0.83949 0.13173 0.19047 0.7212-0.07796 1.1928-0.63582 1.6119-0.60156 0.68249-0.03584 1.2934 0.54212 0.69395 0.2775-0.83446 1.1825-1.7618 2.0655-1.2049 0.8837 0.48448 1.7582 1.6525 2.4938 0.40935-0.75488-0.090735-1.0462-0.73637-1.4079-1.2096-0.40023 0.031761-2.0794-0.32019-1.0059-0.24024 0.5284-0.17249 1.549-0.68558 1.9239-0.66537-0.94013 0.49026 0.35015 0.81268 0.73202 1.2035 0.68671 0.20357 0.99776 1.0757 0.37414 1.527-0.80181 0.4162 0.05573 1.1017 0.221 1.6748 0.12828 0.99827 0.99623 0.43282 1.2716-0.18046 0.39803-1.1153 1.6733-1.0767 2.5958-1.5522 1.008-0.51754 1.0248-0.53575 1.5034 0.20195 0.36764 0.21151 1.5947-0.55825 0.78901-0.929-0.68957 0.03713-1.142 0.46029-0.56364-0.60801 0.13915-0.57404 0.6791-1.3235 0.58092-1.7937-0.662-0.2603-1.324-0.5207-1.986-0.7811zm-9.3732 3.6945c0.35612 0.3643 1.5564 1.0234 1.4368 0.11255-0.14419-0.61744-1.0418-0.62308-1.4368-0.11255zm18.165-0.44471c-0.82412 0.16922-1.6412 0.35467-2.292 0.92363 0.19457 0.7853-0.8341 0.89786-1.2851 1.3281-0.12036 0.25242-0.02467 1.8403 0.51105 1.1573 0.58162-0.77246 0.83368 0.40868 1.4478 0.52687 0.4451-0.14324 0.5002-1.1438 0.33275-1.6043 0.28525-0.46984 0.75058-1.1195 1.3539-1.0659-0.37419 0.57099-0.80163 2.0315 0.3911 1.4345 0.34518-0.006-0.93958 0.75452-1.0166 1.273-0.48258 0.51284-0.9934 0.90587-1.6905 0.50847-0.33355-0.28162-0.50305-1.0992-0.71414-0.17566 0.43341 0.73252-1.089 0.04718-1.0514 1.0356-0.31972 0.61514-0.89623 0.8671-1.563 0.91149 0.24198 0.19141 1.1924 1.3314 0.24953 1.1701-0.60352 0.06628-1.4857 0.40701-1.2414 1.1653-0.27486 0.9444 0.4249 0.70654 0.85522 1.2977 0.70116-0.19916 1.1488-0.62908 1.2634-1.3621 0.65618-0.19273 0.73557-0.93195 1.456-0.91702 0.7182-0.40381 0.88559 0.73738 1.5587 0.82181 0.07058 0.4087-0.33464 1.281 0.45659 0.4693 0.76441-0.55387-0.79512-1.2716-0.30963-1.4066 0.69099 0.22071 0.94006 0.87671 1.051 1.519 0.56306 0.9634 0.70185 0.44404 0.74672-0.40362 0.87723-0.39439 1.1473 1.641 2.3881 1.1397 0.92678 0.19174 0.59949 0.8304-0.01904 1.2203-0.50066 0.47112-1.3382 0.17338-1.9265-0.01558-0.56472-0.27756-1.3196-0.24813-1.6214 0.38347-0.46529-0.21764-0.94642-0.91135-1.4178-1.3118-1.1647-0.5139-2.4314-0.07571-3.5919 0.23946-0.99563 1.1632-2.1949 2.219-2.6236 3.7359-0.62778 0.63853 0.54336 1.0082-0.24392 1.556-0.6428 0.51279 0.10805 1.1629 0.2458 1.7527 0.60445 0.74395 1.6306 3.0723 2.5708 2.1452 0.52705-0.80245 0.81963 0.61582 1.4399-0.30194 0.4952-0.39949 0.9695 0.45802 1.6897 0.14331 0.69372 0.4284 0.56095 1.0433 0.27484 1.6928 0.15583 0.54087 0.93098 0.9344 0.62978 1.6677-0.27366 0.68309 0.58312 1.201 0.41038 1.7987-0.5748 1.1512-0.43928 2.5747 0.09386 3.7157 0.42668 1.0325 0.67699 2.1484 0.64366 3.2692 0.74277 0.2222 1.1367-0.72912 1.8776-0.51313 0.72333 0.09324 0.99191-0.82974 1.5008-1.2158 0.56704-0.46747-0.07223-1.1873 0.82794-1.5185 0.87331-0.42523-1.106-1.0213 0.0152-1.4024 0.46515-0.51761 1.4132-0.69776 1.6008-1.3735-0.33834-1.0398-0.21797-2.1801-0.16738-3.2436 0.32552-0.84167 0.72975-1.6312 1.4262-2.2272 0.28082-0.92669 0.94924-1.7777 0.88942-2.7709-1.6476 0.50399-1.1482-0.21491-0.22962-0.87318 0.63508-0.42199 1.4051-0.84564 1.7006-1.5617 0.14435-0.81048-0.45227-2.1297-1.0079-0.90496-0.24511-0.4707-1.1542-0.71744-1.113-1.3307-0.17659-1.2625 0.34462-0.14427 0.86051 0.10789 1.1146-0.60521 1.6818 1.7766 2.3893 0.35503-0.618-4.471-3.052-8.528-6.34-11.567-0.571-1.0949-0.921 0.75-1.501 0.68-0.464-0.485-1.33-1.1394-0.122-0.914 1.034-0.3028 0.333-0.7027-0.425-0.6842-0.574-0.0697-1.101-0.2706-1.635-0.4789zm-20.56 0.4447c-0.275 1.3534-2.0109 1.1954-2.6162 2.5304-2.9783 3.153-4.8166 7.302-5.32 11.598 0.26584 1.0071 1.1105 1.4908 1.9601 1.9373 0.72184 0.41932 1.7801 0.2342 2.1848 1.1124 0.45187 0.36983 0.93948 1.0997 1.5856 0.87722 0.93664-0.09099 0.36019 0.85823 0.19973 1.3392-0.059277 0.607-0.80778 0.99372-0.52016 1.5778-0.24136 0.66166-0.43304 1.3177 0.10262 1.8906 0.45551 0.83988 0.82632 1.7478 1.6708 2.2751 0.59217 0.49728 1.2625 1.1553 1.0304 1.9974-0.12338 0.68167 0.04306 1.3099 0.3725 1.908-0.11816 0.67146-0.36073 1.3584-0.4105 2.0183 0.87949 0.62206 2.6705 2.0606 2.8031 0.49489 0.50176-0.45161 0.5321-1.1784 1.3743-1.1804 0.3909-0.47777 0.52549-1.2283 0.81706-1.8117-0.42572-0.5384 0.16631-1.3697 0.8046-1.3477 0.81594 0.06128 0.78593-0.89448 1.1111-1.4232-0.0073-0.77224-0.38892-1.6471 0.30542-2.227 0.52242-0.47344 0.46827-1.1675 0.5498-1.8097-1.171-0.7244-2.712-1.0911-3.6386-2.0687-0.18364-0.76504-0.7598-1.0229-1.4925-1.0784-0.30936-0.43256-0.25697-1.4628-0.79753-1.5131-0.69628 0.13369-1.3857 0.24089-1.8917-0.3644-0.573-0.776-1.069 0.2-1.593 0.546-0.492 0.856-1.8683-0.043-1.7038-1.007 0.4839-1.334-1.6425 0.148-0.7699-1.425 0.4151-1.715-0.7067-0.396-1.2952-0.011-0.71822 0.0081-0.98953-0.70747-0.86146-1.3625-0.091117-0.78733 0.48283-1.1877 1.0669-1.5822 0.78161 0.12038 0.97989-0.56085 1.5654-0.4722 0.73603-0.03767 1.0049 0.66782 1.4232 1.1357 0.17514-0.66797-0.18345-1.6152 0.55606-1.9879 0.56414-0.42781 1.137-0.84927 1.2721-1.5904 0.13304-0.77598 1.2893-0.46761 1.4837-1.2526 0.26877-0.8206 1.5114-0.15823 1.7899-0.96804 0.8733-0.82086-0.27242-0.57178-0.89854-0.59806-1.2353 0.12695 0.1228-0.32763 0.58598-0.58155 0.68608 0.09073 1.3195-0.13384 1.9499-0.37629 0.08445 0.85843 0.24597 1.3112 0.68417 0.30788-0.85421-0.20211-0.11618-1.0402-0.95973-1.2614-0.66764 0.04697 0.0066-1.4189-0.81571-1.2577-1.0697 0.70782-0.11401-0.50251-0.9854-0.66347-0.68736-0.74222-0.85436 0.47657-1.2276 0.9183 0.24207 0.84702-0.79095 0.66525-0.97976 1.3606-0.41814 1.2534-0.24143-0.08931-0.74055-0.41035-0.61653-0.24732-1.3592-0.3784-1.3637-1.1899 0.82658-0.60512 2.0667-0.96189 2.5994-1.9148 0.3095-0.74008-0.26215-1.1445-0.96618-1.0889l-0.000005-2e-7zm14.675 1.642c-0.12491 0.65746 0.5475 1.009 0.30788 1.7104-0.21487 0.76842-0.27728 1.3789 0.68289 0.93046 0.99668-0.51183 0.36052-0.90148-0.03867-1.5728-0.27187-0.44613-0.24574-1.275-0.9521-1.0681zm-0.75259 1.0947c-0.79414-0.24012-0.61745 1.4493-0.12164 1.0118 0.7276-0.17916 0.23703-0.5252 0.12164-1.0118zm10.023 8.9969c0.95184 0.84444 1.277 2.0946 1.8858 3.1596 0.90428 0.39972 0.0415 1.0795 0.44521 1.5712 0.84897 0.92228-1.1752 0.24516-0.90606-0.67899-0.1971-1.2139-1.0559-2.044-1.4678-3.1045-0.04294-0.3526-0.38552-0.71788 0.04284-0.94732z"/>
35 <path id="path8655" style="opacity:.4;stroke:url(#linearGradient15133);fill:none" d="m42.409 24.387c0 10.384-8.4184 18.803-18.801 18.803-10.384 0-18.802-8.4184-18.802-18.803 0-10.384 8.418-18.801 18.802-18.801 10.383 0 18.801 8.4175 18.801 18.801z"/>
36 </g>
37 <g id="g2414" transform="matrix(.99991 -.013701 .013701 .99991 -.28870 .53585)">
38 <path id="path3970" style="stroke-linejoin:round;fill-rule:evenodd;stroke:#666;fill:url(#radialGradient2418)" d="m30.5 20.937 17 16.5-7.75 0.25s3.25 6.75 3.25 6.75c1 3-3.5 4.125-4.25 1.875l-3-6.75-5.5 5.875 0.25-24.5z"/>
39 <path id="path4853" style="opacity:.4;stroke:#fff;fill:none" d="m31.657 23.379 13.476 13.186-6.9219 0.27746l3.8721 7.7566c0.40273 1.6501-2.0283 2.4126-2.5071 1.1529l-3.6831-7.845-4.4247 4.7083 0.18907-19.236z"/>
40 </g>
41 </g>
42</svg>
430
=== removed file 'Ubuntu/Settings/Menus/artwork/default_contact.png'
44Binary files Ubuntu/Settings/Menus/artwork/default_contact.png 2013-10-04 09:48:04 +0000 and Ubuntu/Settings/Menus/artwork/default_contact.png 1970-01-01 00:00:00 +0000 differ1Binary files Ubuntu/Settings/Menus/artwork/default_contact.png 2013-10-04 09:48:04 +0000 and Ubuntu/Settings/Menus/artwork/default_contact.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'Ubuntu/Settings/Menus/artwork/secure.svg'
--- Ubuntu/Settings/Menus/artwork/secure.svg 2013-10-04 09:48:04 +0000
+++ Ubuntu/Settings/Menus/artwork/secure.svg 1970-01-01 00:00:00 +0000
@@ -1,71 +0,0 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 width="64"
13 height="64"
14 id="svg2986"
15 version="1.1"
16 inkscape:version="0.48.4 r9939"
17 sodipodi:docname="secure.svg">
18 <defs
19 id="defs2988" />
20 <sodipodi:namedview
21 id="base"
22 pagecolor="#ffffff"
23 bordercolor="#666666"
24 borderopacity="1.0"
25 inkscape:pageopacity="0.0"
26 inkscape:pageshadow="2"
27 inkscape:zoom="7.9180415"
28 inkscape:cx="7.5048745"
29 inkscape:cy="29.401628"
30 inkscape:current-layer="layer1"
31 showgrid="true"
32 inkscape:grid-bbox="true"
33 inkscape:document-units="px"
34 inkscape:snap-grids="false"
35 inkscape:window-width="1549"
36 inkscape:window-height="876"
37 inkscape:window-x="51"
38 inkscape:window-y="24"
39 inkscape:window-maximized="1">
40 <inkscape:grid
41 type="xygrid"
42 id="grid3012"
43 empspacing="5"
44 visible="true"
45 enabled="true"
46 snapvisiblegridlinesonly="true" />
47 </sodipodi:namedview>
48 <metadata
49 id="metadata2991">
50 <rdf:RDF>
51 <cc:Work
52 rdf:about="">
53 <dc:format>image/svg+xml</dc:format>
54 <dc:type
55 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
56 <dc:title />
57 </cc:Work>
58 </rdf:RDF>
59 </metadata>
60 <g
61 id="layer1"
62 inkscape:label="Layer 1"
63 inkscape:groupmode="layer"
64 transform="translate(0,32)">
65 <path
66 inkscape:connector-curvature="0"
67 d="M 29.999999,-18 C 25.568001,-18 22,-14.432 22,-10 v 6 h -2 c -1.107999,0 -2,0.892 -2,2 v 18 c 0,1.108 0.892001,2 2,2 h 24 c 1.108,0 2,-0.892 2,-2 V -2 c 0,-1.108 -0.892,-2 -2,-2 h -2 v -6 c 0,-4.432 -3.568001,-8 -8.000001,-8 h -4 z m 0,4 h 4 c 2.216,0 4,1.784 4,4 v 6 H 26.000001 v -6 c 0,-2.216 1.784,-4 3.999998,-4 z"
68 style="fill:#dfdbd2;fill-rule:evenodd"
69 id="path8" />
70 </g>
71</svg>
720
=== modified file 'Ubuntu/Settings/Menus/qmldir'
--- Ubuntu/Settings/Menus/qmldir 2014-07-04 14:06:04 +0000
+++ Ubuntu/Settings/Menus/qmldir 2014-09-25 11:35:47 +0000
@@ -14,7 +14,7 @@
14ProgressValueMenu 0.1 ProgressValueMenu.qml14ProgressValueMenu 0.1 ProgressValueMenu.qml
15SectionMenu 0.1 SectionMenu.qml15SectionMenu 0.1 SectionMenu.qml
16SeparatorMenu 0.1 SeparatorMenu.qml16SeparatorMenu 0.1 SeparatorMenu.qml
17SimpleTextMessageMenu 0.1 SimpleTextMessageMenu.qml17SimpleMessageMenu 0.1 SimpleMessageMenu.qml
18SliderMenu 0.1 SliderMenu.qml18SliderMenu 0.1 SliderMenu.qml
19SnapDecisionMenu 0.1 SnapDecisionMenu.qml19SnapDecisionMenu 0.1 SnapDecisionMenu.qml
20StandardMenu 0.1 StandardMenu.qml20StandardMenu 0.1 StandardMenu.qml
@@ -23,5 +23,3 @@
23TimeZoneMenu 0.1 TimeZoneMenu.qml23TimeZoneMenu 0.1 TimeZoneMenu.qml
24TransferMenu 0.1 TransferMenu.qml24TransferMenu 0.1 TransferMenu.qml
25UserSessionMenu 0.1 UserSessionMenu.qml25UserSessionMenu 0.1 UserSessionMenu.qml
26
27internal HeroMessageMenu HeroMessageMenu.qml
2826
=== modified file 'debian/changelog'
--- debian/changelog 2014-09-18 09:48:33 +0000
+++ debian/changelog 2014-09-25 11:35:47 +0000
@@ -5,6 +5,14 @@
55
6 -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 18 Sep 2014 09:48:32 +00006 -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 18 Sep 2014 09:48:32 +0000
77
8ubuntu-settings-components (0.4-0ubuntu1) UNRELEASED; urgency=medium
9
10 [ Nick Dedekind ]
11
12 * Updated components UI for design review
13
14 -- Nicholas Dedekind <nicholas.dedekind@gmail.com> Thu, 31 Jul 2014 17:57:51 +0100
15
8ubuntu-settings-components (0.3+14.10.20140708-0ubuntu1) utopic; urgency=medium16ubuntu-settings-components (0.3+14.10.20140708-0ubuntu1) utopic; urgency=medium
917
10 [ Nick Dedekind ]18 [ Nick Dedekind ]
1119
=== modified file 'debian/control'
--- debian/control 2014-07-07 15:53:39 +0000
+++ debian/control 2014-09-25 11:35:47 +0000
@@ -12,7 +12,7 @@
12 qtdeclarative5-dev-tools,12 qtdeclarative5-dev-tools,
13 qtdeclarative5-qtquick2-plugin,13 qtdeclarative5-qtquick2-plugin,
14 qtdeclarative5-test-plugin,14 qtdeclarative5-test-plugin,
15 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 0.1.48) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 0.1.48),15 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.1) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.1),
16 suru-icon-theme,16 suru-icon-theme,
17Standards-Version: 3.9.417Standards-Version: 3.9.4
18Homepage: https://launchpad.net/ubuntu-settings-components18Homepage: https://launchpad.net/ubuntu-settings-components
@@ -26,7 +26,7 @@
26Multi-Arch: same26Multi-Arch: same
27Pre-Depends: dpkg (>= 1.15.6~)27Pre-Depends: dpkg (>= 1.15.6~)
28Depends: qml-module-qtquick-layouts,28Depends: qml-module-qtquick-layouts,
29 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 0.1.48) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 0.1.48),29 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.1) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.1),
30 suru-icon-theme,30 suru-icon-theme,
31 ${misc:Depends},31 ${misc:Depends},
32 ${shlibs:Depends},32 ${shlibs:Depends},
3333
=== added directory 'examples'
=== added file 'examples/CMakeLists.txt'
--- examples/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ examples/CMakeLists.txt 2014-09-25 11:35:47 +0000
@@ -0,0 +1,2 @@
1file(GLOB QML_JS_FILES *.qml *.js)
2add_custom_target( ExampleQmlFiles SOURCES ${QML_JS_FILES} )
03
=== added file 'examples/MessageComponents.qml'
--- examples/MessageComponents.qml 1970-01-01 00:00:00 +0000
+++ examples/MessageComponents.qml 2014-09-25 11:35:47 +0000
@@ -0,0 +1,119 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by Andrea Cimitan <andrea.cimitan@canonical.com>
17 */
18
19import QtQuick 2.0
20import Ubuntu.Components 1.1
21import Ubuntu.Settings.Components 0.1
22import Ubuntu.Settings.Menus 0.1
23
24Item {
25 property string title: "MessageComponents"
26
27 width: units.gu(42)
28 height: units.gu(75)
29
30 ListModel {
31 id: model
32 ListElement {
33 type: "text"
34 title: "Text Message"
35 body: "I am a little teacup, short and stout. Here is my handle, and here is my spout. Who are you talking about my spout?! This should be truncated"
36 time: "Sat 31 Oct, 11:00"
37 icon: "image://theme/message"
38 avatar: "image://theme/contact"
39 }
40 ListElement {
41 type: "simple"
42 title: "Simple Text Message Simple"
43 body: "I happen to be tall and thin! But let's try a new line"
44 time: "Yesterday, 10:00"
45 icon: "image://theme/message"
46 avatar: "artwork/beach.jpg"
47 }
48 ListElement {
49 type: "snap"
50 title: "Snap Decision"
51 body: "My mother says I'm handsome!"
52 time: "10:30am"
53 icon: "image://theme/missed-call"
54 avatar: "artwork/night.jpg"
55 }
56 }
57
58 ListView {
59 model: model
60 anchors.fill: parent
61
62 cacheBuffer: 10000
63
64 delegate: Loader {
65 anchors {
66 left: parent.left
67 right: parent.right
68 }
69 asynchronous: true
70 sourceComponent: model.type === "simple" ? simple :
71 model.type === "text" ? text :
72 model.type === "snap" ? snap : undefined
73
74 Component {
75 id: simple
76 SimpleMessageMenu {
77 avatar: model.avatar
78 icon: model.icon
79 title: model.title
80 body: model.body
81 time: model.time
82 removable: true
83 }
84 }
85
86 Component {
87 id: text
88 TextMessageMenu {
89 avatar: model.avatar
90 icon: model.icon
91 title: model.title
92 body: model.body
93 time: model.time
94 removable: true
95
96 onTriggered: {
97 selected = !selected;
98 }
99 }
100 }
101
102 Component {
103 id: snap
104 SnapDecisionMenu {
105 avatar: model.avatar
106 icon: model.icon
107 title: model.title
108 body: model.body
109 time: model.time
110 removable: true
111
112 onTriggered: {
113 selected = !selected;
114 }
115 }
116 }
117 }
118 }
119}
0120
=== added file 'examples/OtherComponents.qml'
--- examples/OtherComponents.qml 1970-01-01 00:00:00 +0000
+++ examples/OtherComponents.qml 2014-09-25 11:35:47 +0000
@@ -0,0 +1,237 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by Andrea Cimitan <andrea.cimitan@canonical.com>
17 */
18
19import QtQuick 2.0
20import Ubuntu.Components 1.1
21import Ubuntu.Settings.Components 0.1
22import Ubuntu.Settings.Menus 0.1
23
24Item {
25 property string title: "Settings Components"
26
27 ListModel {
28 id: mediaPlayerModel
29 ListElement { song: "You're The First, The Last, My Everything"; artist: "Barry White"; album: "Hot Soul"; albumArt: "artwork/beach.jpg"}
30 ListElement { song: "Stony Ground"; artist: "Richard Thompson"; album: "Electric"; albumArt: "artwork/farm.jpg"}
31 ListElement { song: "Los Robots"; artist: "Kraftwerk"; album: "The Man-Machine"; albumArt: "artwork/insane.jpg"}
32 }
33
34 ListModel {
35 id: timeZoneModel
36 ListElement { city: "San Francisco"; time: "3:00am" }
37 ListElement { city: "London"; time: "11:00am" }
38 ListElement { city: "Rome"; time: "12:00am" }
39 }
40
41 ListModel {
42 id: eventModel
43 ListElement { icon: "image://theme/calendar"; eventColor: "yellow"; text: "Lunch with Lola"; time: "1:10 PM" }
44 ListElement { icon: "image://theme/calendar"; eventColor: "green"; text: "Gym"; time: "6:30 PM" }
45 ListElement { icon: "image://theme/calendar"; eventColor: "red"; text: "Birthday Party"; time: "9:00 PM" }
46 }
47
48 Flickable {
49 id: flickable
50
51 anchors.fill: parent
52 contentWidth: column.width
53 contentHeight: column.height
54
55 Column {
56 id: column
57
58 width: flickable.width
59 height: childrenRect.height
60
61 StandardMenu {
62 text: i18n.tr("Standard Menu\nLook at me, I'm a new line.")
63 }
64
65 StandardMenu {
66 iconSource: "image://theme/calendar"
67 iconColor: "red"
68 text: i18n.tr("Standard Menu")
69 component: Component {
70 Button {
71 text: "Press Me"
72 }
73 }
74 backColor: Qt.rgba(1,1,1,0.1)
75 }
76
77 SliderMenu {
78 id: slider
79 text: i18n.tr("Slider")
80 minimumValue: 0
81 maximumValue: 100
82 value: 20
83
84 minIcon: "image://theme/audio-volume-low"
85 maxIcon: "image://theme/audio-volume-high"
86 }
87
88 ProgressBarMenu {
89 text: i18n.tr("ProgressBar")
90 value: slider.value
91 minimumValue: 0
92 maximumValue: 100
93 }
94
95 ProgressValueMenu {
96 text: i18n.tr("ProgressValue")
97 value: slider.value
98 }
99
100 ButtonMenu {
101 text: i18n.tr("Button")
102 buttonText: i18n.tr("Hello world!")
103 }
104
105 CheckableMenu {
106 text: i18n.tr("Checkable")
107 checked: true
108 }
109
110 SwitchMenu {
111 text: i18n.tr("Switch")
112 checked: true
113 }
114
115 SectionMenu {
116 text: i18n.tr("Section Starts Here")
117 busy: true
118 }
119
120 SeparatorMenu {}
121
122 CalendarMenu {
123 id: calendar
124 }
125
126 UserSessionMenu {
127 name: i18n.tr("Lola Chang")
128 iconSource: "image://theme/contact"
129 active: true
130 }
131
132 MediaPlayerMenu {
133 id: mediaPlayer
134 property int index: 0
135
136 playerName: "Rhythmbox"
137 playerIcon: Qt.resolvedUrl("../tests/artwork/rhythmbox.png")
138 albumArt: mediaPlayerModel.get(index).albumArt;
139 song: mediaPlayerModel.get(index).song;
140 artist: mediaPlayerModel.get(index).artist;
141 album: mediaPlayerModel.get(index).album;
142 showTrack: mediaControl.playing
143 }
144
145 PlaybackItemMenu {
146 id: mediaControl
147 canPlay: true
148 canGoNext: mediaPlayer.index < mediaPlayerModel.count - 1
149 canGoPrevious: mediaPlayer.index > 0
150 playing: false
151
152 onPrevious: mediaPlayer.index = Math.max(mediaPlayer.index - 1, 0)
153 onNext: mediaPlayer.index = Math.min(mediaPlayer.index + 1, mediaPlayerModel.count - 1)
154 onPlay: { playing = !playing; }
155 }
156
157 AccessPointMenu {
158 active: true
159 secure: true
160 adHoc: false
161 signalStrength: 50
162 text: "Access Point"
163
164 onTriggered: active = !active
165 }
166
167 GroupedMessageMenu {
168 text: "Group Message"
169 count: "4100"
170 }
171
172 Column {
173 anchors {
174 left: parent.left
175 right: parent.right
176 }
177
178 Repeater {
179 model: timeZoneModel
180
181 TimeZoneMenu {
182 city: model.city
183 time: model.time
184 }
185 }
186 }
187
188 Column {
189 anchors {
190 left: parent.left
191 right: parent.right
192 }
193
194 Repeater {
195 model: eventModel
196
197 EventMenu {
198 iconSource: model.icon
199 text: model.text
200 eventColor: model.eventColor
201 time: model.time
202 enabled: false
203 }
204 }
205 }
206
207 Row {
208 anchors {
209 left: parent.left
210 right: parent.right
211 }
212
213 spacing: units.gu(1)
214
215 Label {
216 text: "StatusIcon"
217 anchors.verticalCenter: parent.verticalCenter
218 }
219
220 StatusIcon {
221 height: units.gu(5)
222 source: "image://theme/gps"
223 }
224
225 StatusIcon {
226 height: units.gu(5)
227 source: "image://theme/battery-caution"
228 }
229
230 StatusIcon {
231 height: units.gu(5)
232 source: "image://theme/missing,gpm-battery-000-charging"
233 }
234 }
235 }
236 }
237}
0238
=== renamed file 'SettingsComponents.qml' => 'examples/SettingsComponents.qml'
--- SettingsComponents.qml 2014-07-04 14:07:50 +0000
+++ examples/SettingsComponents.qml 2014-09-25 11:35:47 +0000
@@ -17,275 +17,50 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Settings.Components 0.121import Ubuntu.Settings.Components 0.1
22import Ubuntu.Settings.Menus 0.122import Ubuntu.Settings.Menus 0.1
2323
24MainView {24MainView {
25 id: mainView
25 // Note! applicationName needs to match the .desktop filename26 // Note! applicationName needs to match the .desktop filename
26 applicationName: "SettingsComponents"27 applicationName: "SettingsComponents"
2728
28 width: units.gu(42)29 width: units.gu(42)
29 height: units.gu(75)30 height: units.gu(75)
3031
31 ListModel {32 Component.onCompleted: {
32 id: mediaPlayerModel33 Theme.name = "Ubuntu.Components.Themes.SuruGradient"
33 ListElement { song: "Mine"; artist: "Taylor Swift"; album: "Speak Now"; albumArt: "tests/artwork/speak-now.jpg"}34 }
34 ListElement { song: "Stony Ground"; artist: "Richard Thompson"; album: "Electric"; albumArt: "tests/artwork/electric.jpg"}35
35 ListElement { song: "Los Robots"; artist: "Kraftwerk"; album: "The Man-Machine"; albumArt: "tests/artwork/the-man-machine.jpg"}36 ListModel {
36 }37 id: pages
3738 ListElement { source: "OtherComponents.qml" }
38 ListModel {39 ListElement { source: "MessageComponents.qml" }
39 id: timeZoneModel40 ListElement { source: "TransferComponents.qml" }
40 ListElement { city: "San Francisco"; time: "3:00am" }
41 ListElement { city: "London"; time: "11:00am" }
42 ListElement { city: "Rome"; time: "12:00am" }
43 }
44
45 ListModel {
46 id: eventModel
47 ListElement { icon: "image://theme/calendar"; eventColor: "yellow"; text: "Lunch with Lola"; time: "1:10 PM" }
48 ListElement { icon: "image://theme/calendar"; eventColor: "green"; text: "Gym"; time: "6:30 PM" }
49 ListElement { icon: "image://theme/calendar"; eventColor: "red"; text: "Birthday Party"; time: "9:00 PM" }
50 }41 }
5142
52 Page {43 Page {
53 title: "SettingsComponents"44 title: listView.currentItem ? listView.currentItem.item.title : "Components"
5445 clip: true
55 Flickable {46
56 id: flickable47 ListView {
5748 id: listView
49 model: pages
58 anchors.fill: parent50 anchors.fill: parent
59 contentWidth: column.width51
60 contentHeight: column.height52 orientation: ListView.Horizontal
6153 snapMode: ListView.SnapOneItem
62 Column {54 highlightRangeMode: ListView.StrictlyEnforceRange
63 id: column55 boundsBehavior: Flickable.StopAtBounds
6456
65 width: flickable.width57 delegate: Loader {
66 height: childrenRect.height58 width: ListView.view.width
6759 height: ListView.view.height
68 StandardMenu {60
69 text: i18n.tr("Standard Menu\nLook at me, I'm a new line.")61 source: model.source
70 }
71
72 StandardMenu {
73 iconSource: "image://theme/calendar"
74 iconColor: "red"
75 text: i18n.tr("Standard Menu")
76 component: Component {
77 Button {
78 text: "Press Me"
79 }
80 }
81 }
82
83
84 SliderMenu {
85 id: slider
86 text: i18n.tr("Slider")
87 minimumValue: 0
88 maximumValue: 100
89 value: 20
90
91 minIcon: "image://theme/audio-volume-low"
92 maxIcon: "image://theme/audio-volume-high"
93 }
94
95 ProgressBarMenu {
96 text: i18n.tr("ProgressBar")
97 value: slider.value
98 minimumValue: 0
99 maximumValue: 100
100 }
101
102 ProgressValueMenu {
103 text: i18n.tr("ProgressValue")
104 value: slider.value
105 }
106
107 ButtonMenu {
108 text: i18n.tr("Button")
109 buttonText: i18n.tr("Hello world!")
110 }
111
112 CheckableMenu {
113 text: i18n.tr("Checkable")
114 checked: true
115 }
116
117 SwitchMenu {
118 text: i18n.tr("Switch")
119 checked: true
120 }
121
122 SectionMenu {
123 text: i18n.tr("Section Starts Here")
124 busy: true
125 }
126
127 SeparatorMenu {}
128
129 CalendarMenu {
130 id: calendar
131 }
132
133 UserSessionMenu {
134 name: i18n.tr("Lola Chang")
135 iconSource: Qt.resolvedUrl("tests/artwork/avatar.png")
136 active: true
137 }
138
139 MediaPlayerMenu {
140 id: mediaPlayer
141 property int index: 0
142
143 playerName: "Rhythmbox"
144 playerIcon: Qt.resolvedUrl("tests/artwork/rhythmbox.png")
145 song: mediaPlayerModel.get(index).song;
146 artist: mediaPlayerModel.get(index).artist;
147 album: mediaPlayerModel.get(index).album;
148 albumArt: mediaPlayerModel.get(index).albumArt;
149 }
150
151 PlaybackItemMenu {
152 canPlay: true
153 canGoNext: true
154 canGoPrevious: true
155 playing: mediaPlayer.running
156
157 onPrevious: mediaPlayer.index = Math.max(mediaPlayer.index - 1, 0)
158 onNext: mediaPlayer.index = Math.min(mediaPlayer.index + 1, mediaPlayerModel.count - 1)
159 onPlay: { mediaPlayer.running = !mediaPlayer.running; }
160 }
161
162 TransferMenu {
163 text: "Video Downloading"
164 stateText: "3 minutes remaning"
165 iconSource: "tests/artwork/speak-now.jpg"
166 progress: 0.6
167 active: true
168 removable: true
169 confirmRemoval: true
170 }
171
172 TransferMenu {
173 text: "Video Downloading"
174 iconSource: "tests/artwork/speak-now.jpg"
175 progress: 0.6
176 active: false
177 removable: true
178 confirmRemoval: true
179 }
180
181 AccessPointMenu {
182 checked: true
183 secure: true
184 adHoc: false
185 signalStrength: 50
186 text: "Access Point"
187 }
188
189 GroupedMessageMenu {
190 text: "Group Message"
191 count: "4"
192 }
193
194 SnapDecisionMenu {
195 title: "Snap Decision"
196 time: "10:30am"
197 message: "My mother says I'm handsome!"
198
199 replyMessages: ["Yeah right", "Sure she did"]
200
201 onTriggered: {
202 selected = !selected;
203 }
204 }
205
206 SimpleTextMessageMenu {
207 title: "Simple Text Message"
208 time: "11am"
209 message: "I am a little teacup"
210
211 onTriggered: {
212 selected = !selected;
213 }
214 }
215
216 TextMessageMenu {
217 title: "Text Message"
218 time: "11am"
219 message: "I happen to be tall and thin!"
220
221 onTriggered: {
222 selected = !selected;
223 }
224 }
225
226 Column {
227 anchors {
228 left: parent.left
229 right: parent.right
230 }
231
232 Repeater {
233 model: timeZoneModel
234
235 TimeZoneMenu {
236 city: model.city
237 time: model.time
238 }
239 }
240 }
241
242 Column {
243 anchors {
244 left: parent.left
245 right: parent.right
246 }
247
248 Repeater {
249 model: eventModel
250
251 EventMenu {
252 iconSource: model.icon
253 text: model.text
254 eventColor: model.eventColor
255 time: model.time
256 }
257 }
258 }
259
260 Row {
261 anchors {
262 left: parent.left
263 right: parent.right
264 }
265
266 spacing: units.gu(1)
267
268 Label {
269 text: "StatusIcon"
270 anchors.verticalCenter: parent.verticalCenter
271 }
272
273 StatusIcon {
274 height: units.gu(5)
275 source: "image://theme/gps"
276 }
277
278 StatusIcon {
279 height: units.gu(5)
280 source: "image://theme/battery-caution"
281 }
282
283 StatusIcon {
284 height: units.gu(5)
285 source: "image://theme/missing,gpm-battery-000-charging"
286 }
287 }
288 }62 }
289 }63 }
64
290 }65 }
291}66}
29267
=== added file 'examples/TransferComponents.qml'
--- examples/TransferComponents.qml 1970-01-01 00:00:00 +0000
+++ examples/TransferComponents.qml 2014-09-25 11:35:47 +0000
@@ -0,0 +1,84 @@
1/*
2* Copyright 2014 Canonical Ltd.
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU Lesser General Public License as published by
6* the Free Software Foundation; version 3.
7*
8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU Lesser General Public License for more details.
12*
13* You should have received a copy of the GNU Lesser General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* Authored by Andrea Cimitan <andrea.cimitan@canonical.com>
17*/
18
19import QtQuick 2.0
20import Ubuntu.Components 1.1
21import Ubuntu.Settings.Components 0.1
22import Ubuntu.Settings.Menus 0.1
23
24Item {
25 property string title: "Transfer Components"
26
27 width: units.gu(42)
28 height: units.gu(75)
29
30 ListModel {
31 id: model
32 ListElement {
33 text: "File name here"
34 state: "Starting…"
35 progress: 0
36 image: "image://theme/video-x-generic-symbolic"
37 active: true
38 }
39 ListElement {
40 text: "proposition.pdf"
41 state: "10 seconds remaining"
42 progress: 0.7
43 image: "../tests/artwork/the-man-machine.jpg"
44 active: true
45 }
46 ListElement {
47 text: "electric.jpg"
48 state: "Failed, tap to retry"
49 progress: 1.0
50 image: "../tests/artwork/electric.jpg"
51 active: true
52 }
53 ListElement {
54 text: "clubbing-friday.jpg.jpg"
55 state: "no state"
56 progress: 0.4
57 image: "../tests/artwork/speak-now.jpg"
58 active: false
59 }
60 }
61
62 ListView {
63 model: model
64 anchors.fill: parent
65
66 cacheBuffer: 10000
67
68 delegate: Loader {
69 anchors {
70 left: parent.left
71 right: parent.right
72 }
73 asynchronous: true
74
75 sourceComponent: TransferMenu {
76 text: model.text
77 stateText: model.state
78 progress: model.progress
79 iconSource: model.image
80 active: model.active
81 }
82 }
83 }
84}
085
=== added directory 'examples/artwork'
=== added file 'examples/artwork/beach.jpg'
1Binary files examples/artwork/beach.jpg 1970-01-01 00:00:00 +0000 and examples/artwork/beach.jpg 2014-09-25 11:35:47 +0000 differ86Binary files examples/artwork/beach.jpg 1970-01-01 00:00:00 +0000 and examples/artwork/beach.jpg 2014-09-25 11:35:47 +0000 differ
=== added file 'examples/artwork/farm.jpg'
2Binary files examples/artwork/farm.jpg 1970-01-01 00:00:00 +0000 and examples/artwork/farm.jpg 2014-09-25 11:35:47 +0000 differ87Binary files examples/artwork/farm.jpg 1970-01-01 00:00:00 +0000 and examples/artwork/farm.jpg 2014-09-25 11:35:47 +0000 differ
=== added file 'examples/artwork/insane.jpg'
3Binary files examples/artwork/insane.jpg 1970-01-01 00:00:00 +0000 and examples/artwork/insane.jpg 2014-09-25 11:35:47 +0000 differ88Binary files examples/artwork/insane.jpg 1970-01-01 00:00:00 +0000 and examples/artwork/insane.jpg 2014-09-25 11:35:47 +0000 differ
=== added file 'examples/artwork/night.jpg'
4Binary files examples/artwork/night.jpg 1970-01-01 00:00:00 +0000 and examples/artwork/night.jpg 2014-09-25 11:35:47 +0000 differ89Binary files examples/artwork/night.jpg 1970-01-01 00:00:00 +0000 and examples/artwork/night.jpg 2014-09-25 11:35:47 +0000 differ
=== modified file 'runtests.sh'
--- runtests.sh 2013-10-04 10:52:27 +0000
+++ runtests.sh 2014-09-25 11:35:47 +0000
@@ -26,10 +26,10 @@
26# floating point operations and xml writing is natively supported.26# floating point operations and xml writing is natively supported.
2727
2828
29if test -e SettingsComponents.qml; then29if test -e runtests.sh; then
30 echo In-source build detected.30 echo In-source build detected.
31 SRCDIR=`pwd`31 SRCDIR=`pwd`
32elif test -e ../SettingsComponents.qml; then32elif test -e ../runtests.sh; then
33 echo Out-of-source build detected. Found source dir at ..33 echo Out-of-source build detected. Found source dir at ..
34 SRCDIR=`pwd`/..34 SRCDIR=`pwd`/..
35else35else
3636
=== modified file 'tests/qmltests/CMakeLists.txt'
--- tests/qmltests/CMakeLists.txt 2014-07-04 14:07:50 +0000
+++ tests/qmltests/CMakeLists.txt 2014-09-25 11:35:47 +0000
@@ -3,7 +3,7 @@
33
4set(qmltest_DEFAULT_TARGETS qmluitests)4set(qmltest_DEFAULT_TARGETS qmluitests)
5set(qmltest_DEFAULT_NO_ADD_TEST TRUE)5set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
6set(qmltest_DEFAULT_PROPERTIES "")6set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "LC_ALL=C")
77
8set(qmltest_DEFAULT_IMPORT_PATHS8set(qmltest_DEFAULT_IMPORT_PATHS
9 ${CMAKE_BINARY_DIR}9 ${CMAKE_BINARY_DIR}
@@ -24,7 +24,7 @@
24add_qml_test(Menus ProgressBarMenu)24add_qml_test(Menus ProgressBarMenu)
25add_qml_test(Menus ProgressValueMenu)25add_qml_test(Menus ProgressValueMenu)
26add_qml_test(Menus SectionMenu)26add_qml_test(Menus SectionMenu)
27add_qml_test(Menus SimpleTextMessageMenu)27add_qml_test(Menus SimpleMessageMenu)
28add_qml_test(Menus SliderMenu)28add_qml_test(Menus SliderMenu)
29add_qml_test(Menus SnapDecisionMenu)29add_qml_test(Menus SnapDecisionMenu)
30add_qml_test(Menus SwitchMenu)30add_qml_test(Menus SwitchMenu)
@@ -32,3 +32,4 @@
32add_qml_test(Menus TextMessageMenu)32add_qml_test(Menus TextMessageMenu)
33add_qml_test(Menus TimeZoneMenu)33add_qml_test(Menus TimeZoneMenu)
34add_qml_test(Menus TransferMenu)34add_qml_test(Menus TransferMenu)
35
3536
=== modified file 'tests/qmltests/Menus/tst_AccessPointMenu.qml'
--- tests/qmltests/Menus/tst_AccessPointMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_AccessPointMenu.qml 2014-09-25 11:35:47 +0000
@@ -46,7 +46,7 @@
46 id: accessPoint246 id: accessPoint2
47 anchors.top: accessPoint.bottom47 anchors.top: accessPoint.bottom
4848
49 checked: true49 active: true
50 secure: true50 secure: true
51 adHoc: true51 adHoc: true
52 signalStrength: 5052 signalStrength: 50
@@ -66,7 +66,7 @@
66 when: windowShown66 when: windowShown
6767
68 function init() {68 function init() {
69 accessPoint.checked = false;69 accessPoint.active = false;
70 accessPoint.secure = false;70 accessPoint.secure = false;
71 accessPoint.adHoc = false;71 accessPoint.adHoc = false;
72 accessPoint.signalStrength = 0;72 accessPoint.signalStrength = 0;
@@ -74,7 +74,7 @@
74 }74 }
7575
76 function test_activate() {76 function test_activate() {
77 mouseClick(accessPoint, accessPoint.width / 2, accessPoint.height / 2, Qt.LeftButton, Qt.NoModifier, 0);77 mouseClick(accessPoint, accessPoint.width / 2, accessPoint.height / 2);
78 compare(signalSpyTriggered.count > 0, true, "activate signal should have been triggered");78 compare(signalSpyTriggered.count > 0, true, "activate signal should have been triggered");
79 }79 }
8080
@@ -123,23 +123,5 @@
123 accessPoint.secure = false;123 accessPoint.secure = false;
124 compare(icon.visible, false, "Secure icon should not be visible when access point is not secure");124 compare(icon.visible, false, "Secure icon should not be visible when access point is not secure");
125 }125 }
126
127 function test_checkBox(data) {
128 var checkBox = findChild(accessPoint, "checkBox");
129 verify(checkBox !== undefined);
130
131 accessPoint.checked = true;
132 compare(checkBox.checked, true, "Checkbox should be checked when access point is checked");
133
134 accessPoint.checked = false;
135 compare(checkBox.checked, false, "Checkbox should not be checked when access point is not checked");
136 }
137
138 function test_checkBox_on_default_checked() {
139 var checkBox = findChild(accessPoint2, "checkBox");
140 verify(checkBox !== undefined);
141
142 compare(checkBox.checked, true, "Check box should be checked if default to checked")
143 }
144 }126 }
145}127}
146128
=== modified file 'tests/qmltests/Menus/tst_ButtonMenu.qml'
--- tests/qmltests/Menus/tst_ButtonMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_ButtonMenu.qml 2014-09-25 11:35:47 +0000
@@ -69,7 +69,7 @@
69 var button2 = findChild(buttonMenu2, "button");69 var button2 = findChild(buttonMenu2, "button");
70 verify(button !== undefined);70 verify(button !== undefined);
7171
72 mouseClick(button, button.width / 2, button.height / 2, Qt.LeftButton, Qt.NoModifier, 0);72 mouseClick(button, button.width / 2, button.height / 2);
73 compare(signalSpy.count > 0, true, "signal clicked not triggered");73 compare(signalSpy.count > 0, true, "signal clicked not triggered");
74 }74 }
75 }75 }
7676
=== modified file 'tests/qmltests/Menus/tst_CheckableMenu.qml'
--- tests/qmltests/Menus/tst_CheckableMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_CheckableMenu.qml 2014-09-25 11:35:47 +0000
@@ -73,12 +73,12 @@
73 var checkbox = findChild(checkMenu, "checkbox");73 var checkbox = findChild(checkMenu, "checkbox");
74 verify(checkbox !== undefined);74 verify(checkbox !== undefined);
7575
76 mouseClick(checkMenu, checkbox.width / 2, checkbox.height / 2, Qt.LeftButton, Qt.NoModifier, 0);76 mouseClick(checkMenu, checkbox.width / 2, checkbox.height / 2);
77 compare(signalSpyTriggered.count > 0, true, "signal checked not triggered on checkbox click");77 compare(signalSpyTriggered.count > 0, true, "signal checked not triggered on checkbox click");
78 }78 }
7979
80 function test_clickCheckMenu() {80 function test_clickCheckMenu() {
81 mouseClick(checkMenu, checkMenu.width / 2, checkMenu.height / 2, Qt.LeftButton, Qt.NoModifier, 0);81 mouseClick(checkMenu, checkMenu.width / 2, checkMenu.height / 2);
82 compare(signalSpyTriggered.count > 0, true, "signal checked not triggered on checkMenu click");82 compare(signalSpyTriggered.count > 0, true, "signal checked not triggered on checkMenu click");
83 }83 }
84 }84 }
8585
=== modified file 'tests/qmltests/Menus/tst_EventMenu.qml'
--- tests/qmltests/Menus/tst_EventMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_EventMenu.qml 2014-09-25 11:35:47 +0000
@@ -73,7 +73,7 @@
73 }73 }
7474
75 function test_triggered() {75 function test_triggered() {
76 mouseClick(eventMenu, eventMenu.width / 2, eventMenu.height / 2, Qt.LeftButton, Qt.NoModifier, 0);76 mouseClick(eventMenu, eventMenu.width / 2, eventMenu.height / 2);
77 compare(signalSpyTriggered.count > 0, true, "should have been triggered");77 compare(signalSpyTriggered.count > 0, true, "should have been triggered");
78 }78 }
79 }79 }
8080
=== modified file 'tests/qmltests/Menus/tst_GroupedMessageMenu.qml'
--- tests/qmltests/Menus/tst_GroupedMessageMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_GroupedMessageMenu.qml 2014-09-25 11:35:47 +0000
@@ -79,7 +79,7 @@
79 }79 }
8080
81 function test_triggered() {81 function test_triggered() {
82 mouseClick(messageMenu, messageMenu.width / 2, messageMenu.height / 2, Qt.LeftButton, Qt.NoModifier, 0);82 mouseClick(messageMenu, messageMenu.width / 2, messageMenu.height / 2);
83 compare(signalSpyTriggered.count > 0, true, "should have been triggered");83 compare(signalSpyTriggered.count > 0, true, "should have been triggered");
84 }84 }
8585
8686
=== modified file 'tests/qmltests/Menus/tst_MediaPlayerMenu.qml'
--- tests/qmltests/Menus/tst_MediaPlayerMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_MediaPlayerMenu.qml 2014-09-25 11:35:47 +0000
@@ -52,16 +52,16 @@
52 var player = findChild(mediaPlayerMenu, "player");52 var player = findChild(mediaPlayerMenu, "player");
53 var albumArt = findChild(mediaPlayerMenu, "albumArt");53 var albumArt = findChild(mediaPlayerMenu, "albumArt");
5454
55 var running = mediaPlayerMenu.running55 var showTrack = mediaPlayerMenu.showTrack
5656
57 compare(player.visible, !running, "player should be not visible when running");57 compare(player.visible, !showTrack, "player should be not visible when running");
58 compare(albumArt.visible, running, "albumn art should be visible when running");58 compare(albumArt.visible, showTrack, "albumn art should be visible when running");
5959
60 running = !running;60 showTrack = !showTrack;
61 mediaPlayerMenu.running = running;61 mediaPlayerMenu.showTrack = showTrack;
6262
63 compare(player.visible, !running, "player should be not visible when running");63 compare(player.visible, !showTrack, "player should be not visible when running");
64 compare(albumArt.visible, running, "albumn art should be visible when running");64 compare(albumArt.visible, showTrack, "albumn art should be visible when running");
65 }65 }
66 }66 }
67}67}
6868
=== modified file 'tests/qmltests/Menus/tst_PlaybackItemMenu.qml'
--- tests/qmltests/Menus/tst_PlaybackItemMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_PlaybackItemMenu.qml 2014-09-25 11:35:47 +0000
@@ -94,7 +94,7 @@
94 playbackItem[data.enableProp] = data.enableValue;94 playbackItem[data.enableProp] = data.enableValue;
9595
96 var button = findChild(playbackItem, data.objectName);96 var button = findChild(playbackItem, data.objectName);
97 mouseClick(button, button.width / 2, button.height / 2, Qt.LeftButton, Qt.NoModifier, 0);97 mouseClick(button, button.width / 2, button.height / 2);
9898
99 compare(data.signalSpy.count > 0, data.enableValue, data.enableValue ? "signal should be triggered" : "signal should not be triggered");99 compare(data.signalSpy.count > 0, data.enableValue, data.enableValue ? "signal should be triggered" : "signal should not be triggered");
100 }100 }
101101
=== renamed file 'tests/qmltests/Menus/tst_SimpleTextMessageMenu.qml' => 'tests/qmltests/Menus/tst_SimpleMessageMenu.qml'
--- tests/qmltests/Menus/tst_SimpleTextMessageMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_SimpleMessageMenu.qml 2014-09-25 11:35:47 +0000
@@ -38,22 +38,22 @@
38 width: flickable.width38 width: flickable.width
39 height: childrenRect.height39 height: childrenRect.height
4040
41 SimpleTextMessageMenu {41 SimpleMessageMenu {
42 id: messageMenu42 id: messageMenu
43 removable: false43 removable: false
4444
45 title: "Text Message"45 title: "Text Message"
46 body: "I am a little teapot"
46 time: "11:08am"47 time: "11:08am"
47 message: "I am a little teapot"
48 }48 }
4949
50 SimpleTextMessageMenu {50 SimpleMessageMenu {
51 id: messageMenuRemovable51 id: messageMenuRemovable
52 removable: true52 removable: true
53 anchors.top: messageMenu.bottom53 anchors.top: messageMenu.bottom
54 }54 }
5555
56 TextMessageMenu {56 SimpleMessageMenu {
57 id: messageMenuSelected57 id: messageMenuSelected
58 removable: true58 removable: true
59 anchors.top: messageMenuRemovable.bottom59 anchors.top: messageMenuRemovable.bottom
@@ -62,8 +62,8 @@
62 }62 }
6363
64 SignalSpy {64 SignalSpy {
65 id: signalSpyActivateApp65 id: signalSpyIconActivated
66 signalName: "appActivated"66 signalName: "iconActivated"
67 target: messageMenuSelected67 target: messageMenuSelected
68 }68 }
6969
@@ -78,7 +78,7 @@
78 when: windowShown78 when: windowShown
7979
80 function init() {80 function init() {
81 signalSpyActivateApp.clear();81 signalSpyIconActivated.clear();
82 signalSpyDismiss.clear();82 signalSpyDismiss.clear();
83 messageMenuSelected.selected = false;83 messageMenuSelected.selected = false;
84 }84 }
@@ -108,54 +108,61 @@
108 function test_time(data) {108 function test_time(data) {
109 messageMenu.time = data.time;109 messageMenu.time = data.time;
110110
111 var subtitle = findChild(messageMenu, "subtitle");111 var time = findChild(messageMenu, "time");
112 verify(subtitle !== undefined, "No subtitle");112 verify(time !== undefined, "No time");
113 compare(subtitle.text, data.time, "Time does not match set time.");113 compare(time.text, data.time, "Time does not match set time.");
114 }114 }
115115
116 function test_appIcon_data() {116 function test_avatar_data() {
117 return [117 return [
118 { appIcon: Qt.resolvedUrl("../../artwork/avatar.png") },118 { avatar: Qt.resolvedUrl("../../artwork/avatar.png") },
119 { appIcon: Qt.resolvedUrl("../../artwork/rhythmbox.png") },119 { avatar: Qt.resolvedUrl("../../artwork/rhythmbox.png") },
120 ];120 ];
121 }121 }
122122
123 function test_appIcon(data) {123 function test_avatar(data) {
124 messageMenu.appIcon = data.appIcon;124 messageMenu.avatar = data.avatar;
125125
126 var appIcon = findChild(messageMenu, "appIcon");126 var avatar = findChild(messageMenu, "avatar");
127 verify(appIcon !== undefined, "No app icon");127 verify(avatar !== undefined, "No avatar");
128 compare(appIcon.source, data.appIcon, "App Icon does not match set icon.");128 compare(avatar.source, data.avatar, "Avatar does not match set avatar.");
129 }129 }
130130
131 function test_message_data() {131 function test_icon_data() {
132 return [132 return [
133 { message: "This is a test." },133 { icon: Qt.resolvedUrl("../../artwork/avatar.png") },
134 { message: "Test is also a test." },134 { icon: Qt.resolvedUrl("../../artwork/rhythmbox.png") },
135 ];135 ];
136 }136 }
137137
138 function test_message(data) {138 function test_icon(data) {
139 messageMenu.message = data.message;139 messageMenu.icon = data.icon;
140
141 var icon = findChild(messageMenu, "icon");
142 verify(icon !== undefined, "No icon");
143 compare(icon.source, data.icon, "Icon does not match set icon.");
144 }
145
146 function test_body_data() {
147 return [
148 { body: "This is a test." },
149 { body: "Test is also a test." },
150 ];
151 }
152
153 function test_body(data) {
154 messageMenu.body = data.body;
140155
141 var body = findChild(messageMenu, "body");156 var body = findChild(messageMenu, "body");
142 verify(body !== undefined, "No body");157 verify(body !== undefined, "No body");
143 compare(body.text, data.message, "Message does not match set message.");158 compare(body.text, data.body, "Message does not match set message.");
144 }159 }
145160
146 function test_activateApp() {161 function test_iconActivated() {
147 var appIcon = findChild(messageMenuSelected, "appIcon");162 var icon = findChild(messageMenuSelected, "icon");
148163
149 mouseClick(appIcon, appIcon.width * 2, appIcon.height / 2, Qt.LeftButton, Qt.NoModifier, 0);164 mouseClick(icon, icon.width / 2, icon.height / 2);
150 compare(signalSpyActivateApp.count, 0, "activate app should not have been triggered");165 compare(signalSpyIconActivated.count > 0, true, "activate icon should have been triggered");
151
152 messageMenuSelected.selected = false;
153 mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
154 compare(signalSpyActivateApp.count, 0, "activate app should not have been triggered when not selected");
155
156 messageMenuSelected.selected = true;
157 mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
158 compare(signalSpyActivateApp.count > 0, true, "activate app should have been triggered when selected");
159 }166 }
160167
161 function test_dismiss() {168 function test_dismiss() {
162169
=== modified file 'tests/qmltests/Menus/tst_SnapDecisionMenu.qml'
--- tests/qmltests/Menus/tst_SnapDecisionMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_SnapDecisionMenu.qml 2014-09-25 11:35:47 +0000
@@ -43,14 +43,16 @@
43 removable: false43 removable: false
4444
45 title: "Text Message"45 title: "Text Message"
46 body: "I am a little teapot"
46 time: "11:08am"47 time: "11:08am"
47 message: "I am a little teapot"48 _animationDuration: 0
48 }49 }
4950
50 SnapDecisionMenu {51 SnapDecisionMenu {
51 id: messageMenuRemovable52 id: messageMenuRemovable
52 removable: true53 removable: true
53 anchors.top: messageMenu.bottom54 anchors.top: messageMenu.bottom
55 _animationDuration: 0
54 }56 }
5557
56 SnapDecisionMenu {58 SnapDecisionMenu {
@@ -58,6 +60,7 @@
58 removable: true60 removable: true
59 selected: true61 selected: true
60 anchors.top: messageMenuRemovable.bottom62 anchors.top: messageMenuRemovable.bottom
63 _animationDuration: 0
6164
62 onReplied: {65 onReplied: {
63 textMessageReply = value;66 textMessageReply = value;
@@ -69,8 +72,8 @@
69 property string textMessageReply: ""72 property string textMessageReply: ""
7073
71 SignalSpy {74 SignalSpy {
72 id: signalSpyActivateApp75 id: signalSpyIconActivated
73 signalName: "appActivated"76 signalName: "iconActivated"
74 target: messageMenuSelected77 target: messageMenuSelected
75 }78 }
7679
@@ -81,8 +84,8 @@
81 }84 }
8285
83 SignalSpy {86 SignalSpy {
84 id: signalSpyActivate87 id: signalSpyActionActivated
85 signalName: "activated"88 signalName: "actionActivated"
86 target: messageMenuSelected89 target: messageMenuSelected
87 }90 }
8891
@@ -97,9 +100,9 @@
97 when: windowShown100 when: windowShown
98101
99 function init() {102 function init() {
100 signalSpyActivateApp.clear();103 signalSpyIconActivated.clear();
101 signalSpyDismiss.clear();104 signalSpyDismiss.clear();
102 signalSpyActivate.clear();105 signalSpyActionActivated.clear();
103 signalSpyReply.clear();106 signalSpyReply.clear();
104 textMessageReply = "";107 textMessageReply = "";
105108
@@ -132,39 +135,71 @@
132 function test_time(data) {135 function test_time(data) {
133 messageMenu.time = data.time;136 messageMenu.time = data.time;
134137
138 var subtitle = findChild(messageMenu, "time");
139 verify(subtitle !== undefined, "No time");
140 compare(subtitle.text, data.time, "Time does not match set time.");
141 }
142
143 function test_avatar_data() {
144 return [
145 { avatar: Qt.resolvedUrl("../../artwork/avatar.png") },
146 { avatar: Qt.resolvedUrl("../../artwork/rhythmbox.png") },
147 ];
148 }
149
150 function test_avatar(data) {
151 messageMenu.avatar = data.avatar;
152
153 var avatar = findChild(messageMenu, "avatar");
154 verify(avatar !== undefined, "No avatar");
155 compare(avatar.source, data.avatar, "Avatar does not match set avatar.");
156 }
157
158 function test_icon_data() {
159 return [
160 { icon: Qt.resolvedUrl("../../artwork/avatar.png") },
161 { icon: Qt.resolvedUrl("../../artwork/rhythmbox.png") },
162 ];
163 }
164
165 function test_icon(data) {
166 messageMenu.icon = data.icon;
167
168 var icon = findChild(messageMenu, "icon");
169 verify(icon !== undefined, "No icon");
170 compare(icon.source, data.icon, "Icon does not match set icon.");
171 }
172
173 function test_body_data() {
174 return [
175 { body: "This is a test." },
176 { body: "Test is also a test." },
177 ];
178 }
179
180 function test_body(data) {
181 messageMenu.body = data.body;
182
135 var body = findChild(messageMenu, "body");183 var body = findChild(messageMenu, "body");
136 verify(body !== undefined, "No body");184 verify(body !== undefined, "No body");
137 compare(body.text, data.time, "Time does not match set time.");185 compare(body.text, data.body, "Message does not match set message.");
138 }186 }
139187
140 function test_appIcon_data() {188 function test_iconActivated() {
141 return [189 var icon = findChild(messageMenuSelected, "icon");
142 { appIcon: Qt.resolvedUrl("../../artwork/avatar.png") },190
143 { appIcon: Qt.resolvedUrl("../../artwork/rhythmbox.png") },191 mouseClick(icon, icon.width / 2, icon.height / 2);
144 ];192 compare(signalSpyIconActivated.count > 0, true, "activate icon should have been triggered");
145 }193 }
146194
147 function test_appIcon(data) {195 function test_dismiss() {
148 messageMenu.appIcon = data.appIcon;196 mouseFlick(messageMenuRemovable,
149197 messageMenuRemovable.width / 2,
150 var appIcon = findChild(messageMenu, "appIcon");198 messageMenuRemovable.height / 2,
151 verify(appIcon !== undefined, "No app icon");199 messageMenuRemovable.width,
152 compare(appIcon.source, data.appIcon, "App Icon does not match set icon.");200 messageMenuRemovable.height / 2,
153 }201 true, true, units.gu(1), 10);
154202 tryCompareFunction(function() { return signalSpyDismiss.count > 0; }, true);
155 function test_message_data() {
156 return [
157 { message: "This is a test." },
158 { message: "Test is also a test." },
159 ];
160 }
161
162 function test_message(data) {
163 messageMenu.message = data.message;
164
165 var subtitle = findChild(messageMenu, "subtitle");
166 verify(subtitle !== undefined, "No subtitle");
167 compare(subtitle.text, data.message, "Message does not match set message.");
168 }203 }
169204
170 function test_replyButtonText_data() {205 function test_replyButtonText_data() {
@@ -182,52 +217,27 @@
182 compare(button.text, data.buttonText, "Button text does not match set text.");217 compare(button.text, data.buttonText, "Button text does not match set text.");
183 }218 }
184219
185 function test_activateApp() {
186 var appIcon = findChild(messageMenuSelected, "appIcon");
187
188 mouseClick(appIcon, appIcon.width * 2, appIcon.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
189 compare(signalSpyActivateApp.count, 0, "activate app should not have been triggered");
190
191 messageMenuSelected.selected = false;
192 mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
193 compare(signalSpyActivateApp.count, 0, "activate app should not have been triggered when not selected");
194
195 messageMenuSelected.selected = true;
196 mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
197 compare(signalSpyActivateApp.count > 0, true, "activate app should have been triggered when selected");
198 }
199
200 function test_dismiss() {
201 mouseFlick(messageMenuRemovable,
202 messageMenuRemovable.width / 2,
203 messageMenuRemovable.height / 2,
204 messageMenuRemovable.width,
205 messageMenuRemovable.height / 2,
206 true, true, units.gu(1), 10);
207 tryCompareFunction(function() { return signalSpyDismiss.count > 0; }, true);
208 }
209
210 function test_activateEnabled() {220 function test_activateEnabled() {
211 messageMenuSelected.selected = true;221 messageMenuSelected.selected = true;
212 messageMenuSelected.activateEnabled = false;222 messageMenuSelected.actionEnabled = false;
213223
214 var actionButton = findChild(messageMenuSelected, "actionButton");224 var actionButton = findChild(messageMenuSelected, "actionButton");
215 verify(actionButton !== undefined, "Action button not found");225 verify(actionButton !== undefined, "Action button not found");
216226
217 compare(actionButton.enabled, false, "Action button should not be enabled when activateEnabled=false");227 compare(actionButton.enabled, false, "Action button should not be enabled when activateEnabled=false");
218 messageMenuSelected.activateEnabled = true228 messageMenuSelected.actionEnabled = true
219 compare(actionButton.enabled, true, "Action button should be enabled when activateEnabled=true");229 compare(actionButton.enabled, true, "Action button should be enabled when activateEnabled=true");
220 }230 }
221231
222 function test_activate() {232 function test_actionActivated() {
223 messageMenuSelected.selected = true;233 messageMenuSelected.selected = true;
224 messageMenuSelected.activateEnabled = true;234 messageMenuSelected.actionEnabled = true;
225235
226 var actionButton = findChild(messageMenuSelected, "actionButton");236 var actionButton = findChild(messageMenuSelected, "actionButton");
227 verify(actionButton !== undefined, "Action button not found");237 verify(actionButton !== undefined, "Action button not found");
228238
229 mouseClick(actionButton, actionButton.width / 2, actionButton.height / 2, Qt.LeftButton, Qt.NoModifier, 0);239 mouseClick(actionButton, actionButton.width / 2, actionButton.height / 2);
230 compare(signalSpyActivate.count > 0, true);240 compare(signalSpyActionActivated.count > 0, true);
231 }241 }
232242
233 function test_replyEnabled_data() {243 function test_replyEnabled_data() {
@@ -249,7 +259,7 @@
249259
250 var messageButton = findChild(messageMenuSelected, "messageButton");260 var messageButton = findChild(messageMenuSelected, "messageButton");
251 verify(messageButton !== undefined, "Message button not found");261 verify(messageButton !== undefined, "Message button not found");
252 mouseClick(messageButton, messageButton.width / 2, messageButton.height / 2, Qt.LeftButton, Qt.NoModifier, 300);262 mouseClick(messageButton, messageButton.width / 2, messageButton.height / 2);
253263
254 var sendButton = findChild(messageMenuSelected, "sendButton");264 var sendButton = findChild(messageMenuSelected, "sendButton");
255 verify(sendButton !== undefined, "Send button not found");265 verify(sendButton !== undefined, "Send button not found");
@@ -267,12 +277,12 @@
267277
268 var messageButton = findChild(messageMenuSelected, "messageButton");278 var messageButton = findChild(messageMenuSelected, "messageButton");
269 verify(messageButton !== undefined, "Message button not found");279 verify(messageButton !== undefined, "Message button not found");
270 mouseClick(messageButton, messageButton.width / 2, messageButton.height / 2, Qt.LeftButton, Qt.NoModifier, 300);280 mouseClick(messageButton, messageButton.width / 2, messageButton.height / 2);
271281
272 var sendButton = findChild(messageMenuSelected, "sendButton");282 var sendButton = findChild(messageMenuSelected, "sendButton");
273 verify(sendButton !== undefined, "Send button not found");283 verify(sendButton !== undefined, "Send button not found");
274284
275 mouseClick(sendButton, sendButton.width / 2, sendButton.height / 2, Qt.LeftButton, Qt.NoModifier, 0);285 mouseClick(sendButton, sendButton.width / 2, sendButton.height / 2);
276 compare(signalSpyReply.count > 0, true);286 compare(signalSpyReply.count > 0, true);
277 compare(textMessageReply, "reply1", "Text message did not reply with correct text.");287 compare(textMessageReply, "reply1", "Text message did not reply with correct text.");
278 }288 }
@@ -284,28 +294,5 @@
284 { tag: 'reply3', index: 2, expected: "reply3" }294 { tag: 'reply3', index: 2, expected: "reply3" }
285 ]295 ]
286 }296 }
287
288 function test_reply_with_message(data) {
289 messageMenuSelected.selected = true;
290 messageMenu.replyEnabled = true;
291 messageMenuSelected.replyMessages = [ "reply1", "reply2", "reply3", "reply4" ];
292
293 var messageButton = findChild(messageMenuSelected, "messageButton");
294 verify(messageButton !== undefined, "Message button not found");
295 mouseClick(messageButton, messageButton.width / 2, messageButton.height / 2, Qt.LeftButton, Qt.NoModifier, 300);
296
297 tryCompareFunction(function() { return messageMenuSelected.implicitHeight == messageMenuSelected.expandedHeight; }, true);
298
299 var replyMessage = findChild(messageMenuSelected, "replyMessage"+data.index);
300 verify(replyMessage !== undefined, "Reply message not found");
301 mouseClick(replyMessage, replyMessage.width / 2, replyMessage.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
302
303 var sendButton = findChild(messageMenuSelected, "sendButton");
304 verify(sendButton !== undefined, "Send button not found");
305
306 mouseClick(sendButton, sendButton.width / 2, sendButton.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
307 compare(signalSpyReply.count > 0, true);
308 compare(textMessageReply, data.expected, "Text message did not reply with correct text.");
309 }
310 }297 }
311}298}
312299
=== modified file 'tests/qmltests/Menus/tst_SwitchMenu.qml'
--- tests/qmltests/Menus/tst_SwitchMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_SwitchMenu.qml 2014-09-25 11:35:47 +0000
@@ -77,12 +77,12 @@
7777
78 function test_clickSwitchBox() {78 function test_clickSwitchBox() {
79 var switcher = findChild(switchMenu, "switcher");79 var switcher = findChild(switchMenu, "switcher");
80 mouseClick(switchMenu, switcher.width / 2, switcher.height / 2, Qt.LeftButton, Qt.NoModifier, 0);80 mouseClick(switchMenu, switcher.width / 2, switcher.height / 2);
81 compare(signalSpyTriggered.count > 0, true, "signal checked not triggered on switcher click");81 compare(signalSpyTriggered.count > 0, true, "signal checked not triggered on switcher click");
82 }82 }
8383
84 function test_clickSwitchMenu() {84 function test_clickSwitchMenu() {
85 mouseClick(switchMenu, switchMenu.width / 2, switchMenu.height / 2, Qt.LeftButton, Qt.NoModifier, 0);85 mouseClick(switchMenu, switchMenu.width / 2, switchMenu.height / 2);
86 compare(signalSpyTriggered.count > 0, true, "signal checked not triggered on switchMenu click");86 compare(signalSpyTriggered.count > 0, true, "signal checked not triggered on switchMenu click");
87 }87 }
88 }88 }
8989
=== modified file 'tests/qmltests/Menus/tst_TextMessageMenu.qml'
--- tests/qmltests/Menus/tst_TextMessageMenu.qml 2014-08-07 15:14:07 +0000
+++ tests/qmltests/Menus/tst_TextMessageMenu.qml 2014-09-25 11:35:47 +0000
@@ -43,20 +43,23 @@
43 removable: false43 removable: false
4444
45 title: "Text Message"45 title: "Text Message"
46 body: "I am a little teapot"
46 time: "11:08am"47 time: "11:08am"
47 message: "I am a little teapot"48 _animationDuration: 0
48 }49 }
4950
50 TextMessageMenu {51 TextMessageMenu {
51 id: messageMenuRemovable52 id: messageMenuRemovable
52 removable: true53 removable: true
53 anchors.top: messageMenu.bottom54 anchors.top: messageMenu.bottom
55 _animationDuration: 0
54 }56 }
5557
56 TextMessageMenu {58 TextMessageMenu {
57 id: messageMenuSelected59 id: messageMenuSelected
58 removable: true60 removable: true
59 anchors.top: messageMenuRemovable.bottom61 anchors.top: messageMenuRemovable.bottom
62 _animationDuration: 0
6063
61 onReplied: {64 onReplied: {
62 textMessageReply = value;65 textMessageReply = value;
@@ -68,8 +71,8 @@
68 property string textMessageReply: ""71 property string textMessageReply: ""
6972
70 SignalSpy {73 SignalSpy {
71 id: signalSpyActivateApp74 id: signalSpyIconActivated
72 signalName: "appActivated"75 signalName: "iconActivated"
73 target: messageMenuSelected76 target: messageMenuSelected
74 }77 }
7578
@@ -90,7 +93,7 @@
90 when: windowShown93 when: windowShown
9194
92 function init() {95 function init() {
93 signalSpyActivateApp.clear();96 signalSpyIconActivated.clear();
94 signalSpyDismiss.clear();97 signalSpyDismiss.clear();
95 signalSpyReply.clear();98 signalSpyReply.clear();
96 textMessageReply = "";99 textMessageReply = "";
@@ -124,39 +127,71 @@
124 function test_time(data) {127 function test_time(data) {
125 messageMenu.time = data.time;128 messageMenu.time = data.time;
126129
127 var subtitle = findChild(messageMenu, "subtitle");130 var subtitle = findChild(messageMenu, "time");
128 verify(subtitle !== undefined, "No subtitle");131 verify(subtitle !== undefined, "No time");
129 compare(subtitle.text, data.time, "Time does not match set time.");132 compare(subtitle.text, data.time, "Time does not match set time.");
130 }133 }
131134
132 function test_appIcon_data() {135 function test_avatar_data() {
133 return [136 return [
134 { appIcon: Qt.resolvedUrl("../../artwork/avatar.png") },137 { avatar: Qt.resolvedUrl("../../artwork/avatar.png") },
135 { appIcon: Qt.resolvedUrl("../../artwork/rhythmbox.png") },138 { avatar: Qt.resolvedUrl("../../artwork/rhythmbox.png") },
136 ];139 ];
137 }140 }
138141
139 function test_appIcon(data) {142 function test_avatar(data) {
140 messageMenu.appIcon = data.appIcon;143 messageMenu.avatar = data.avatar;
141144
142 var appIcon = findChild(messageMenu, "appIcon");145 var avatar = findChild(messageMenu, "avatar");
143 verify(appIcon !== undefined, "No app icon");146 verify(avatar !== undefined, "No avatar");
144 compare(appIcon.source, data.appIcon, "App Icon does not match set icon.");147 compare(avatar.source, data.avatar, "Avatar does not match set avatar.");
145 }148 }
146149
147 function test_message_data() {150 function test_icon_data() {
148 return [151 return [
149 { message: "This is a test." },152 { icon: Qt.resolvedUrl("../../artwork/avatar.png") },
150 { message: "Test is also a test." },153 { icon: Qt.resolvedUrl("../../artwork/rhythmbox.png") },
151 ];154 ];
152 }155 }
153156
154 function test_message(data) {157 function test_icon(data) {
155 messageMenu.message = data.message;158 messageMenu.icon = data.icon;
159
160 var icon = findChild(messageMenu, "icon");
161 verify(icon !== undefined, "No icon");
162 compare(icon.source, data.icon, "Icon does not match set icon.");
163 }
164
165 function test_body_data() {
166 return [
167 { body: "This is a test." },
168 { body: "Test is also a test." },
169 ];
170 }
171
172 function test_body(data) {
173 messageMenu.body = data.body;
156174
157 var body = findChild(messageMenu, "body");175 var body = findChild(messageMenu, "body");
158 verify(body !== undefined, "No body");176 verify(body !== undefined, "No body");
159 compare(body.text, data.message, "Message does not match set message.");177 compare(body.text, data.body, "Message does not match set message.");
178 }
179
180 function test_iconActivated() {
181 var icon = findChild(messageMenuSelected, "icon");
182
183 mouseClick(icon, icon.width / 2, icon.height / 2);
184 compare(signalSpyIconActivated.count > 0, true, "activate icon should have been triggered");
185 }
186
187 function test_dismiss() {
188 mouseFlick(messageMenuRemovable,
189 messageMenuRemovable.width / 2,
190 messageMenuRemovable.height / 2,
191 messageMenuRemovable.width,
192 messageMenuRemovable.height / 2,
193 true, true, units.gu(1), 10);
194 tryCompareFunction(function() { return signalSpyDismiss.count > 0; }, true);
160 }195 }
161196
162 function test_replyButtonText_data() {197 function test_replyButtonText_data() {
@@ -174,31 +209,6 @@
174 compare(button.text, data.buttonText, "Button text does not match set text.");209 compare(button.text, data.buttonText, "Button text does not match set text.");
175 }210 }
176211
177 function test_activateApp() {
178 var appIcon = findChild(messageMenuSelected, "appIcon");
179
180 mouseClick(appIcon, appIcon.width * 2, appIcon.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
181 compare(signalSpyActivateApp.count, 0, "activate app should not have been triggered");
182
183 messageMenuSelected.selected = false;
184 mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
185 compare(signalSpyActivateApp.count, 0, "activate app should not have been triggered when not selected");
186
187 messageMenuSelected.selected = true;
188 mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2, Qt.LeftButton, Qt.NoModifier, 0);
189 compare(signalSpyActivateApp.count > 0, true, "activate app should have been triggered when selected");
190 }
191
192 function test_dismiss() {
193 mouseFlick(messageMenuRemovable,
194 messageMenuRemovable.width / 2,
195 messageMenuRemovable.height / 2,
196 messageMenuRemovable.width,
197 messageMenuRemovable.height / 2,
198 true, true, units.gu(1), 10);
199 tryCompareFunction(function() { return signalSpyDismiss.count > 0; }, true);
200 }
201
202 function test_replyEnabled_data() {212 function test_replyEnabled_data() {
203 return [213 return [
204 { tag: 'disabledNoReply', enabled: false, reply: "", expected: false},214 { tag: 'disabledNoReply', enabled: false, reply: "", expected: false},
@@ -234,7 +244,7 @@
234 var sendButton = findChild(messageMenuSelected, "sendButton");244 var sendButton = findChild(messageMenuSelected, "sendButton");
235 verify(sendButton !== undefined, "Send button not found");245 verify(sendButton !== undefined, "Send button not found");
236246
237 mouseClick(sendButton, sendButton.width / 2, sendButton.height / 2, Qt.LeftButton, Qt.NoModifier, 0);247 mouseClick(sendButton, sendButton.width / 2, sendButton.height / 2);
238 compare(signalSpyReply.count > 0, true);248 compare(signalSpyReply.count > 0, true);
239 compare(textMessageReply, "reply1", "Text message did not reply with correct text.");249 compare(textMessageReply, "reply1", "Text message did not reply with correct text.");
240 }250 }
241251
=== modified file 'tests/utils/modules/Ubuntu/Test/UbuntuTestCase.qml'
--- tests/utils/modules/Ubuntu/Test/UbuntuTestCase.qml 2013-10-04 10:10:47 +0000
+++ tests/utils/modules/Ubuntu/Test/UbuntuTestCase.qml 2014-09-25 11:35:47 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtTest 1.017import QtTest 1.0
18import Ubuntu.Components 0.118import Ubuntu.Components 1.1
19import Ubuntu.Test 0.1 as UT19import Ubuntu.Test 0.1 as UT
2020
21TestCase {21TestCase {

Subscribers

People subscribed via source and target branches

to all changes: