Merge lp:~verzegnassi-stefano/quick-memo/new-theme into lp:quick-memo

Proposed by Stefano Verzegnassi
Status: Merged
Merged at revision: 68
Proposed branch: lp:~verzegnassi-stefano/quick-memo/new-theme
Merge into: lp:quick-memo
Diff against target: 1149 lines (+808/-65)
13 files modified
app/common/ColorDialog.qml (+1/-1)
app/common/PageBackground.qml (+0/-25)
app/common/PageWithBottomEdge.qml (+24/-0)
app/main.qml (+7/-0)
app/theme/OverflowPanel.qml (+22/-0)
app/theme/PageHeadButton.qml (+70/-0)
app/theme/PageHeadStyle.qml (+552/-0)
app/theme/SectionButton.qml (+52/-0)
app/theme/parent_theme (+1/-0)
app/ui/EditMemoPage.qml (+8/-11)
app/ui/MainPage.qml (+10/-1)
copyright (+40/-6)
po/quick-memo.pot (+21/-21)
To merge this branch: bzr merge lp:~verzegnassi-stefano/quick-memo/new-theme
Reviewer Review Type Date Requested Status
Stefano Verzegnassi Pending
Review via email: mp+262027@code.launchpad.net

Commit message

Use the new header style with a colored background and the origami style

Description of the change

Use the new header style with a colored background and the origami style

To post a comment you must log in.
68. By Stefano Verzegnassi

* Use icon for bottomEdge tip
* Small fixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'app/common/ColorDialog.qml'
--- app/common/ColorDialog.qml 2015-04-13 21:03:47 +0000
+++ app/common/ColorDialog.qml 2015-08-03 11:33:33 +0000
@@ -24,7 +24,7 @@
2424
25 title: i18n.tr("Pick a color")25 title: i18n.tr("Pick a color")
2626
27 property var colors: ["#fdfdfd", "#e9674d", "#f0a250", "#eec34f", "#aea79f", "#95c253", "#8bbee2", "#e46f8e"]27 property var colors: ["#95c253", "#e9674d", "#f0a250", "#eec34f", "#aea79f", "#8bbee2", "#e46f8e"]
28 property color selectedColor: colors[0]28 property color selectedColor: colors[0]
2929
30 property bool showTick: true30 property bool showTick: true
3131
=== removed file 'app/common/PageBackground.qml'
--- app/common/PageBackground.qml 2015-04-13 21:03:47 +0000
+++ app/common/PageBackground.qml 1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
1import QtQuick 2.0
2
3// Background
4Rectangle {
5 id: bg
6 anchors.fill: parent
7 z: -10; opacity: 0.5
8
9 property bool __parentPageAboutToBeClosed: false
10
11 /* MainView clips its content, so that it does not overlap the header.
12 We need to bypass this, using another Rectangle that specifically overlap the header. */
13 Rectangle {
14 parent: root.header
15 z: -10; opacity: 0.5
16
17 width: root.width
18 height: root.header.height
19 color: bg.color
20
21 // FIXME: Header background should progressively change opacity to 0.0 when the BottomEdge page is dismissed.
22 visible: !bg.__parentPageAboutToBeClosed
23 }
24}
25
260
=== modified file 'app/common/PageWithBottomEdge.qml'
--- app/common/PageWithBottomEdge.qml 2015-04-13 21:03:47 +0000
+++ app/common/PageWithBottomEdge.qml 2015-08-03 11:33:33 +0000
@@ -71,6 +71,9 @@
71 property alias bottomEdgePageComponent: edgeLoader.sourceComponent71 property alias bottomEdgePageComponent: edgeLoader.sourceComponent
72 property alias bottomEdgePageSource: edgeLoader.source72 property alias bottomEdgePageSource: edgeLoader.source
73 property alias bottomEdgeTitle: tipLabel.text73 property alias bottomEdgeTitle: tipLabel.text
74 property alias bottomEdgeIconName: tipIcon.name
75 property alias bottomEdgeIconSource: tipIcon.source
76 property alias bottomEdgeColor: tip.color
74 property bool bottomEdgeEnabled: true77 property bool bottomEdgeEnabled: true
75 property int bottomEdgeExpandThreshold: page.height * 0.278 property int bottomEdgeExpandThreshold: page.height * 0.2
76 property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdge.tipHeight) : _areaWhenExpanded79 property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdge.tipHeight) : _areaWhenExpanded
@@ -183,6 +186,27 @@
183 verticalAlignment: Text.AlignVCenter186 verticalAlignment: Text.AlignVCenter
184 horizontalAlignment: Text.AlignHCenter187 horizontalAlignment: Text.AlignHCenter
185 opacity: tip.hidden ? 0.0 : 1.0188 opacity: tip.hidden ? 0.0 : 1.0
189 color: ColorUtils.luminance(tip.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
190 visible: text
191
192 Behavior on opacity {
193 UbuntuNumberAnimation {
194 duration: UbuntuAnimation.SnapDuration
195 }
196 }
197 }
198 Icon {
199 id: tipIcon
200 anchors {
201 top: parent.top
202 horizontalCenter: parent.horizontalCenter
203 topMargin: units.gu(0.5)
204 }
205 height: bottomEdge.tipHeight - units.gu(0.5)
206 visible: source.length > 0 || name.length > 0
207 opacity: tip.hidden ? 0.0 : 1.0
208 color: ColorUtils.luminance(tip.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
209
186 Behavior on opacity {210 Behavior on opacity {
187 UbuntuNumberAnimation {211 UbuntuNumberAnimation {
188 duration: UbuntuAnimation.SnapDuration212 duration: UbuntuAnimation.SnapDuration
189213
=== modified file 'app/main.qml'
--- app/main.qml 2015-04-13 21:06:51 +0000
+++ app/main.qml 2015-08-03 11:33:33 +0000
@@ -34,6 +34,9 @@
3434
35 anchorToKeyboard: true35 anchorToKeyboard: true
3636
37 property color headerBackgroundColor: "#95c253"
38 readonly property color defaulteaderBackgroundColor: "#95c253"
39
37 // Use GridView to display data. This setting is used by any page that provides data from models.40 // Use GridView to display data. This setting is used by any page that provides data from models.
38 property bool useGridView: true41 property bool useGridView: true
3942
@@ -54,6 +57,10 @@
54 var toast = component.createObject(root, {"text" : text});57 var toast = component.createObject(root, {"text" : text});
55 }58 }
5659
60 Component.onCompleted: {
61 header.style = Qt.createComponent(Qt.resolvedUrl("theme/PageHeadStyle.qml"))
62 }
63
57/*64/*
58 Not now, but in the future:65 Not now, but in the future:
59 TODO: Layout convergence66 TODO: Layout convergence
6067
=== added directory 'app/theme'
=== added file 'app/theme/OverflowPanel.qml'
--- app/theme/OverflowPanel.qml 1970-01-01 00:00:00 +0000
+++ app/theme/OverflowPanel.qml 2015-08-03 11:33:33 +0000
@@ -0,0 +1,22 @@
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
17import QtQuick 2.3
18import Ubuntu.Components.Popups 1.0
19
20Popover {
21 property bool square: true
22}
023
=== added file 'app/theme/PageHeadButton.qml'
--- app/theme/PageHeadButton.qml 1970-01-01 00:00:00 +0000
+++ app/theme/PageHeadButton.qml 2015-08-03 11:33:33 +0000
@@ -0,0 +1,70 @@
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
17import QtQuick 2.3
18import Ubuntu.Components 1.1
19
20AbstractButton {
21 id: button
22
23 property real iconWidth: units.gu(2.5)
24 property real iconHeight: iconWidth
25
26 width: visible ? units.gu(5) : 0
27 height: parent ? parent.height : undefined
28
29 property alias color: icon.color
30
31 Rectangle {
32 visible: button.pressed
33 anchors.fill: parent
34 color: Theme.palette.selected.background
35 }
36
37 Icon {
38 id: icon
39 anchors {
40 centerIn: parent
41 }
42 // prevent trying to render the icon with an invalid source
43 // when the button is invisible by setting width and height to 0
44 width: visible ? button.iconWidth : 0
45 height: visible ? button.iconHeight : 0
46 source: button.iconSource
47 color: Qt.rgba(0, 0, 0, 0)
48 opacity: button.enabled ? 1.0 : 0.3
49 }
50
51 Component {
52 id: labelComponent
53 Label {
54 id: label
55 objectName: button.objectName + "_label"
56 color: button.color
57 opacity: button.enabled ? 1.0 : 0.3
58 text: button.text
59 fontSize: "xx-small"
60 }
61 }
62 Loader {
63 anchors {
64 top: icon.bottom
65 topMargin: units.gu(0.5)
66 horizontalCenter: parent.horizontalCenter
67 }
68 sourceComponent: button.state === "IconAndLabel" ? labelComponent : null
69 }
70}
071
=== added file 'app/theme/PageHeadStyle.qml'
--- app/theme/PageHeadStyle.qml 1970-01-01 00:00:00 +0000
+++ app/theme/PageHeadStyle.qml 2015-08-03 11:33:33 +0000
@@ -0,0 +1,552 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 * Copyright 2015 Stefano Verzegnassi <verzegnassi.stefano@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.3
19import Ubuntu.Components 1.1
20import Ubuntu.Components.Popups 1.0
21import Ubuntu.Components.ListItems 1.0 as ListItem
22import Ubuntu.Components.Styles 1.1 as Style
23
24Style.PageHeadStyle {
25 id: headerStyle
26
27 contentHeight: units.gu(7)
28 fontWeight: Font.Light
29 fontSize: "x-large"
30 textLeftMargin: units.gu(2)
31 maximumNumberOfActions: 3
32
33 property color buttonColor: ColorUtils.luminance(bg.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
34 property color titleColor: ColorUtils.luminance(bg.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
35 property color panelBackgroundColor: UbuntuColors.orange
36 property color panelHighlightColor: Theme.palette.selected.background
37 property color panelForegroundColor: ColorUtils.luminance(bg.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
38 property color sectionColor: ColorUtils.luminance(bg.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
39 property color sectionHighlightColor: Theme.palette.selected.background
40
41 implicitHeight: headerStyle.contentHeight + divider.height
42
43 Rectangle {
44 id: bg
45 anchors.fill: parent
46 color: root.headerBackgroundColor
47
48 Image {
49 anchors {
50 right: parent.right
51 top: parent.top
52 bottom: parent.bottom
53 }
54 width: units.gu(20)
55
56 fillMode: Image.PreserveAspectCrop
57 source: Qt.resolvedUrl("origami.png")
58 }
59 }
60
61 Item {
62 id: divider
63 anchors {
64 bottom: parent.bottom
65 left: parent.left
66 right: parent.right
67 }
68
69 height: sectionsRow.visible ? units.gu(3) : 0
70 property PageHeadSections sections: styledItem.config.sections
71
72 Row {
73 id: sectionsRow
74
75 anchors {
76 verticalCenter: parent.verticalCenter
77 left: parent.left; right: parent.right
78 leftMargin: units.gu(2)
79 rightMargin: units.gu(2)
80 }
81
82 height: parent.height
83 enabled: divider.sections.enabled
84 visible: divider.sections.model !== undefined
85 opacity: enabled ? 1.0 : 0.5
86
87 Repeater {
88 id: sectionsRepeater
89 model: divider.sections.model
90 delegate: SectionButton {}
91 }
92 }
93 }
94
95 states: [
96 State {
97 name: "IN"
98 PropertyChanges {
99 target: allContents
100 opacity: 1.0
101 }
102 },
103 State {
104 name: "OUT"
105 PropertyChanges {
106 target: allContents
107 opacity: 0.0
108 }
109 }
110 ]
111
112 function animateOut() {
113 state = "OUT";
114 }
115 function animateIn() {
116 state = "IN";
117 }
118
119 signal animateOutFinished()
120 signal animateInFinished()
121
122 transitions: [
123 Transition {
124 id: transitionOut
125 from: "IN"
126 to: "OUT"
127 SequentialAnimation {
128 ParallelAnimation {
129 UbuntuNumberAnimation {
130 target: allContents
131 property: "opacity"
132 from: 1.0
133 to: 0.0
134 }
135 UbuntuNumberAnimation {
136 target: leftAnchor
137 properties: "anchors.leftMargin"
138 from: 0.0
139 to: -units.gu(5)
140 }
141 UbuntuNumberAnimation {
142 target: rightAnchor
143 properties: "anchors.rightMargin"
144 from: 0
145 to: -units.gu(5)
146 }
147 }
148 ScriptAction {
149 script: headerStyle.animateOutFinished()
150 }
151 }
152 },
153 Transition {
154 id: transitionIn
155 from: "OUT"
156 to: "IN"
157 SequentialAnimation {
158 ParallelAnimation {
159 UbuntuNumberAnimation {
160 target: allContents
161 property: "opacity"
162 from: 0.0
163 to: 1.0
164 }
165 UbuntuNumberAnimation {
166 target: leftAnchor
167 properties: "anchors.leftMargin"
168 from: -units.gu(5)
169 to: 0
170 }
171 UbuntuNumberAnimation {
172 target: rightAnchor
173 properties: "anchors.rightMargin"
174 from: -units.gu(5)
175 to: 0
176 }
177 }
178 ScriptAction {
179 script: headerStyle.animateInFinished()
180 }
181 }
182 }
183 ]
184
185 Item {
186 id: allContents
187 anchors.fill: parent
188
189 Item {
190 id: leftAnchor
191 anchors {
192 top: parent.top
193 bottom: parent.bottom
194 left: parent.left
195 leftMargin: 0
196 }
197 width: 0
198 }
199 Item {
200 id: rightAnchor
201 anchors {
202 top: parent.top
203 bottom: parent.bottom
204 right: parent.right
205 rightMargin: 0
206 }
207 width: 0
208 }
209
210 Item {
211 id: leftButtonContainer
212 anchors {
213 left: leftAnchor.right
214 top: parent.top
215 leftMargin: width > 0 ? units.gu(1) : 0
216 }
217 width: childrenRect.width
218 height: headerStyle.contentHeight
219
220 PageHeadButton {
221 id: customBackButton
222 objectName: "customBackButton"
223 action: styledItem.config.backAction
224 visible: null !== styledItem.config.backAction &&
225 styledItem.config.backAction.visible
226 color: headerStyle.panelForegroundColor
227 }
228
229 PageHeadButton {
230 id: backButton
231 objectName: "backButton"
232
233 iconName: "back"
234 visible: styledItem.pageStack !== null &&
235 styledItem.pageStack !== undefined &&
236 styledItem.pageStack.depth > 1 &&
237 !styledItem.config.backAction
238
239 text: "back"
240 color: headerStyle.panelForegroundColor
241
242 onTriggered: {
243 styledItem.pageStack.pop();
244 }
245 }
246
247 PageHeadButton {
248 id: tabsButton
249 objectName: "tabsButton"
250
251 iconName: "navigation-menu"
252 visible: styledItem.tabsModel !== null &&
253 styledItem.tabsModel !== undefined &&
254 !backButton.visible &&
255 !customBackButton.visible
256 text: visible ? styledItem.tabsModel.count + " tabs" : ""
257 color: headerStyle.buttonColor
258
259 onTriggered: PopupUtils.open(tabsPopoverComponent, tabsButton)
260
261 Component {
262 id: tabsPopoverComponent
263
264 OverflowPanel {
265 id: tabsPopover
266 objectName: "tabsPopover"
267 callerMargin: -units.gu(1) + units.dp(4)
268 contentWidth: units.gu(20)
269
270 Binding {
271 target: tabsPopover.__foreground.__styleInstance
272 property: "color"
273 value: headerStyle.panelBackgroundColor
274 when: tabsPopover.__foreground &&
275 tabsPopover.__foreground.__styleInstance
276 }
277
278 Column {
279 anchors {
280 left: parent.left
281 top: parent.top
282 right: parent.right
283 }
284 Repeater {
285 model: styledItem.tabsModel
286 AbstractButton {
287 objectName: "tabButton" + index
288 onClicked: {
289 styledItem.tabsModel.selectedIndex = index;
290 tabsPopover.hide();
291 }
292 implicitHeight: units.gu(6) + bottomDividerLine.height
293 width: parent ? parent.width : units.gu(31)
294
295 Rectangle {
296 visible: parent.pressed
297 anchors {
298 left: parent.left
299 right: parent.right
300 top: parent.top
301 }
302 height: parent.height - bottomDividerLine.height
303 color: headerStyle.panelHighlightColor
304 }
305
306 Label {
307 anchors {
308 verticalCenter: parent.verticalCenter
309 verticalCenterOffset: units.dp(-1)
310 left: parent.left
311 leftMargin: units.gu(2)
312 right: parent.right
313 }
314 fontSize: "medium"
315 elide: Text.ElideRight
316 text: tab.title // FIXME: only "title" doesn't work with i18n.tr(). Why not?
317 color: headerStyle.panelForegroundColor
318 }
319
320 ListItem.ThinDivider {
321 id: bottomDividerLine
322 anchors.bottom: parent.bottom
323 visible: index < styledItem.tabsModel.count - 1
324 }
325 }
326 }
327 }
328 }
329 }
330 }
331 }
332
333 Item {
334 id: foreground
335 anchors {
336 left: leftButtonContainer.right
337 top: parent.top
338 // don't keep a margin if there is already a button with spacing
339 leftMargin: leftButtonContainer.width > 0 ? 0 : headerStyle.textLeftMargin
340 }
341 width: parent.width - anchors.leftMargin
342 - leftButtonContainer.anchors.leftMargin - leftButtonContainer.width
343 - actionsContainer.anchors.rightMargin - actionsContainer.width
344 height: headerStyle.contentHeight
345
346 Label {
347 objectName: "header_title_label"
348 LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
349 visible: !contentsContainer.visible && styledItem.config.preset === ""
350 anchors {
351 left: parent.left
352 right: parent.right
353 verticalCenter: parent.verticalCenter
354 }
355 text: styledItem.title
356 font.weight: headerStyle.fontWeight
357 fontSize: headerStyle.fontSize
358 color: headerStyle.titleColor
359 elide: Text.ElideRight
360 }
361
362 Item {
363 // This Item is used to make the custom header item invisible
364 // when styledItem.contents is unset and its parent is not updated
365 // when the bindings below is no longer active
366 id: contentsContainer
367 anchors.fill: parent
368 visible: styledItem.contents || styledItem.config.contents
369 }
370 Binding {
371 target: styledItem.contents
372 property: "anchors.fill"
373 value: contentsContainer
374 when: styledItem.contents
375 }
376 Binding {
377 target: styledItem.contents
378 property: "parent"
379 value: contentsContainer
380 when: styledItem.contents
381 }
382 Binding {
383 target: styledItem.config.contents
384 property: "parent"
385 value: contentsContainer
386 when: styledItem.config.contents && !styledItem.contents
387 }
388 }
389
390 Row {
391 id: actionsContainer
392
393 property var visibleActions: getVisibleActions(styledItem.config.actions)
394 function getVisibleActions(actions) {
395 var visibleActionList = [];
396 for (var i in actions) {
397 var action = actions[i];
398 if (action && action.hasOwnProperty("visible") && action.visible) {
399 visibleActionList.push(action);
400 }
401 }
402 return visibleActionList;
403 }
404
405 QtObject {
406 id: numberOfSlots
407 property int requested: actionsContainer.visibleActions.length
408 property int left: tabsButton.visible || backButton.visible ||
409 customBackButton.visible ? 1 : 0
410 property int right: headerStyle.maximumNumberOfActions - left
411 property int overflow: actionsOverflowButton.visible ? 1 : 0
412 property int used: Math.min(right - overflow, requested)
413 }
414
415 anchors {
416 top: parent.top
417 right: rightAnchor.left
418 rightMargin: actionsContainer.width > 0 ? units.gu(1) : 0
419 }
420 width: childrenRect.width
421 height: headerStyle.contentHeight
422
423 Repeater {
424 model: numberOfSlots.used
425 PageHeadButton {
426 id: actionButton
427 objectName: action.objectName + "_header_button"
428 action: actionsContainer.visibleActions[index]
429 color: headerStyle.buttonColor
430 state: styledItem.config.preset === "select" ?
431 "IconAndLabel" : ""
432 }
433 }
434
435 PageHeadButton {
436 id: actionsOverflowButton
437 objectName: "actions_overflow_button"
438 visible: numberOfSlots.requested > numberOfSlots.right
439 // Ensure resetting of X when this button is not visible to avoid
440 // miscalculation of actionsContainer.width. Fixes bug #1408481.
441 onVisibleChanged: if (!visible) x = 0
442 iconName: "contextual-menu"
443 color: headerStyle.buttonColor
444 height: actionsContainer.height
445 onTriggered: PopupUtils.open(actionsOverflowPopoverComponent, actionsOverflowButton)
446
447 Component {
448 id: actionsOverflowPopoverComponent
449
450 OverflowPanel {
451 id: actionsOverflowPopover
452 objectName: "actions_overflow_popover"
453 callerMargin: -units.gu(1) + units.dp(4)
454 contentWidth: units.gu(20)
455
456 Binding {
457 target: actionsOverflowPopover.__foreground.__styleInstance
458 property: "color"
459 value: headerStyle.panelBackgroundColor
460 when: actionsOverflowPopover.__foreground &&
461 actionsOverflowPopover.__foreground.__styleInstance
462 }
463
464 // Ensure the popover closes when actions change and
465 // the list item below may be destroyed before its
466 // onClicked is executed. See bug
467 // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1326963
468 Connections {
469 target: styledItem.config
470 onActionsChanged: {
471 actionsOverflowPopover.hide();
472 }
473 }
474 Connections {
475 target: styledItem
476 onConfigChanged: {
477 actionsOverflowPopover.hide();
478 }
479 }
480
481 Column {
482 anchors {
483 left: parent.left
484 top: parent.top
485 right: parent.right
486 }
487 Repeater {
488 id: overflowRepeater
489 model: numberOfSlots.requested - numberOfSlots.used
490 AbstractButton {
491 action: actionsContainer.visibleActions[numberOfSlots.used + index]
492 objectName: action.objectName + "_header_overflow_button"
493 onClicked: actionsOverflowPopover.hide()
494 implicitHeight: units.gu(6) + bottomDividerLine.height
495 width: parent ? parent.width : units.gu(31)
496
497 Rectangle {
498 visible: parent.pressed
499 anchors {
500 left: parent.left
501 right: parent.right
502 top: parent.top
503 }
504 height: parent.height - bottomDividerLine.height
505 color: headerStyle.panelHighlightColor
506 }
507
508 Icon {
509 id: actionIcon
510 source: action.iconSource
511 color: headerStyle.panelForegroundColor
512 anchors {
513 verticalCenter: parent.verticalCenter
514 verticalCenterOffset: units.dp(-1)
515 left: parent.left
516 leftMargin: units.gu(2)
517 }
518 width: units.gu(2)
519 height: units.gu(2)
520 opacity: action.enabled ? 1.0 : 0.5
521 }
522
523 Label {
524 anchors {
525 verticalCenter: parent.verticalCenter
526 verticalCenterOffset: units.dp(-1)
527 left: actionIcon.right
528 leftMargin: units.gu(2)
529 right: parent.right
530 }
531 fontSize: "small"
532 elide: Text.ElideRight
533 text: action.text
534 color: headerStyle.panelForegroundColor
535 opacity: action.enabled ? 1.0 : 0.5
536 }
537
538 ListItem.ThinDivider {
539 id: bottomDividerLine
540 anchors.bottom: parent.bottom
541 visible: index !== overflowRepeater.count - 1
542 }
543 }
544 }
545 }
546 }
547 }
548 }
549 }
550 }
551}
552
0553
=== added file 'app/theme/SectionButton.qml'
--- app/theme/SectionButton.qml 1970-01-01 00:00:00 +0000
+++ app/theme/SectionButton.qml 2015-08-03 11:33:33 +0000
@@ -0,0 +1,52 @@
1/* Copyright (C) 2014-2015 Dan Chapman <dpniel@ubuntu.com>
2 Copyright (C) 2015 Stefano Verzegnassi <verzegnassi.stefano@gmail.com>
3
4 This file is part of Dekko email client for Ubuntu Devices/
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of
9 the License or (at your option) version 3
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20import QtQuick 2.3
21import Ubuntu.Components 1.1
22
23AbstractButton {
24 id: sectionButton
25
26 width: sectionsRow.width / sectionsRepeater.count
27 height: divider.height
28
29 anchors.verticalCenter: parent ? parent.verticalCenter : undefined
30 enabled: sectionsRow.enabled
31
32 property bool selected: index === divider.sections.selectedIndex
33 onClicked: divider.sections.selectedIndex = index;
34
35 Label {
36 text: modelData
37 color: headerStyle.sectionColor
38 opacity: sectionButton.selected ? 1.0 : 0.65
39
40 anchors.horizontalCenter: parent.horizontalCenter
41 anchors.top: parent.top
42 }
43
44 Rectangle {
45 color: headerStyle.sectionColor
46 opacity: sectionButton.selected ? 1.0 : 0.65
47
48 height: units.gu(0.3)
49 width: parent.width
50 anchors.bottom: parent.bottom
51 }
52}
053
=== added file 'app/theme/origami.png'
1Binary files app/theme/origami.png 1970-01-01 00:00:00 +0000 and app/theme/origami.png 2015-08-03 11:33:33 +0000 differ54Binary files app/theme/origami.png 1970-01-01 00:00:00 +0000 and app/theme/origami.png 2015-08-03 11:33:33 +0000 differ
=== added file 'app/theme/parent_theme'
--- app/theme/parent_theme 1970-01-01 00:00:00 +0000
+++ app/theme/parent_theme 2015-08-03 11:33:33 +0000
@@ -0,0 +1,1 @@
1Ubuntu.Components.Themes.Ambiance
02
=== modified file 'app/ui/EditMemoPage.qml'
--- app/ui/EditMemoPage.qml 2015-04-13 21:03:47 +0000
+++ app/ui/EditMemoPage.qml 2015-08-03 11:33:33 +0000
@@ -44,9 +44,6 @@
44 head.backAction: editMemo ? backEditMemo : backNewMemo44 head.backAction: editMemo ? backEditMemo : backNewMemo
45 head.actions: [colorToolAction, deleteMemo, saveMemo]45 head.actions: [colorToolAction, deleteMemo, saveMemo]
4646
47 // Background
48 PageBackground { id: bg }
49
50 // flickable property needs to be explicitly set, to avoid a binding loop for memoPage.height47 // flickable property needs to be explicitly set, to avoid a binding loop for memoPage.height
51 flickable: flickable48 flickable: flickable
52 Flickable {49 Flickable {
@@ -138,7 +135,7 @@
138135
139 title.text = memoObj.contents.title136 title.text = memoObj.contents.title
140 desc.text = memoObj.contents.text137 desc.text = memoObj.contents.text
141 bg.color = memoObj.contents.color138 root.headerBackgroundColor = memoObj.contents.color
142139
143 // Append list items provided by NoteModel140 // Append list items provided by NoteModel
144 listManager.model.clear()141 listManager.model.clear()
@@ -157,7 +154,7 @@
157 desc.textReallyChanged.connect(updateNote)154 desc.textReallyChanged.connect(updateNote)
158 listManager.listChanged.connect(updateNote)155 listManager.listChanged.connect(updateNote)
159 picsView.picsModelChanged.connect(updateNote)156 picsView.picsModelChanged.connect(updateNote)
160 bg.colorChanged.connect(updateNote)157 root.headerBackgroundColorChanged.connect(updateNote)
161158
162 updateLabel.refresh()159 updateLabel.refresh()
163 }160 }
@@ -172,7 +169,7 @@
172 obj.contents.title = title.text169 obj.contents.title = title.text
173 obj.contents.text = desc.text170 obj.contents.text = desc.text
174 // The char '#' from the hex color is not correctly parse by JSON. We add an empty string, so that it works well.171 // The char '#' from the hex color is not correctly parse by JSON. We add an empty string, so that it works well.
175 obj.contents.color = "" + bg.color172 obj.contents.color = "" + root.headerBackgroundColor
176 obj.contents.list = listManager.exportModel()173 obj.contents.list = listManager.exportModel()
177 obj.contents.pictures = picsView.exportModel()174 obj.contents.pictures = picsView.exportModel()
178175
@@ -185,7 +182,7 @@
185 function addNote() {182 function addNote() {
186 notes.addNote(title.text,183 notes.addNote(title.text,
187 desc.text,184 desc.text,
188 "" + bg.color, // The char '#' from the hex color is not correctly parse by JSON. We add an empty string, so that it works well.185 "" + root.headerBackgroundColor, // The char '#' from the hex color is not correctly parse by JSON. We add an empty string, so that it works well.
189 listManager.exportModel(),186 listManager.exportModel(),
190 picsView.exportModel())187 picsView.exportModel())
191 pageStack.pop()188 pageStack.pop()
@@ -270,7 +267,7 @@
270 text: i18n.tr("Cancel")267 text: i18n.tr("Cancel")
271 gradient: UbuntuColors.greyGradient268 gradient: UbuntuColors.greyGradient
272 onClicked: deleteDialog.hide()269 onClicked: deleteDialog.hide()
273 visible: !emptyMemo270 visible: !deleteDialog.emptyMemo
274 }271 }
275 Button {272 Button {
276 text: i18n.tr("Delete")273 text: i18n.tr("Delete")
@@ -278,7 +275,7 @@
278 onClicked: {275 onClicked: {
279 deleteDialog.hide()276 deleteDialog.hide()
280 pageStack.pop();277 pageStack.pop();
281 pageStack.push(mainPage)278 pageStack.push(Qt.resolvedUrl("MainPage.qml"))
282 notes.deleteNote(index)279 notes.deleteNote(index)
283280
284 root.showNotification(i18n.tr("Memo deleted!"))281 root.showNotification(i18n.tr("Memo deleted!"))
@@ -316,10 +313,10 @@
316 ColorDialog {313 ColorDialog {
317 id: colorDialog314 id: colorDialog
318315
319 selectedColor: bg.color316 selectedColor: root.headerBackgroundColor
320 onColorPicked: {317 onColorPicked: {
321 if (isChanged)318 if (isChanged)
322 bg.color = selectedColor319 root.headerBackgroundColor = selectedColor
323320
324 PopupUtils.close(colorDialog)321 PopupUtils.close(colorDialog)
325 }322 }
326323
=== modified file 'app/ui/MainPage.qml'
--- app/ui/MainPage.qml 2015-04-26 17:08:56 +0000
+++ app/ui/MainPage.qml 2015-08-03 11:33:33 +0000
@@ -278,8 +278,17 @@
278 }278 }
279 }279 }
280280
281 bottomEdgeTitle: i18n.tr("New memo")281 //bottomEdgeTitle: i18n.tr("New memo")
282 bottomEdgeIconName: "note-new"
283 bottomEdgeColor: "#95c253"
282 bottomEdgePageComponent: EditMemoPage {}284 bottomEdgePageComponent: EditMemoPage {}
283 // Disable bottomEdge when MultiSelectionHandler is active285 // Disable bottomEdge when MultiSelectionHandler is active
284 bottomEdgeEnabled: mainPage.state !== "multiSelection"286 bottomEdgeEnabled: mainPage.state !== "multiSelection"
287
288 onVisibleChanged: {
289 if (visible) {
290 // Restore default color
291 root.headerBackgroundColor = root.defaulteaderBackgroundColor
292 }
293 }
285}294}
286295
=== modified file 'copyright'
--- copyright 2015-01-17 20:25:00 +0000
+++ copyright 2015-08-03 11:33:33 +0000
@@ -7,30 +7,50 @@
7Copyright: 2014-2015, Stefano Verzegnassi7Copyright: 2014-2015, Stefano Verzegnassi
8License: GPL-38License: GPL-3
99
10Files: components/PageWithBottomEdge.qml10Files: app/components/PageWithBottomEdge.qml
11Copyright: 2014, Canonical Ltd.11Copyright: 2014, Canonical Ltd.
12License: GPL-312License: GPL-3
1313
14Files: ubuntucomponents/TextInputPopover.qml14Files: app/ubuntucomponents/TextInputPopover.qml
15 ubuntucomponents/TextCursor.qml15 app/ubuntucomponents/TextCursor.qml
16Copyright: 2012, Canonical Ltd.16Copyright: 2012, Canonical Ltd.
17License: LGPL-317License: LGPL-3
1818
19Files: ubuntucomponents/TextField.qml19Files: app/ubuntucomponents/TextField.qml
20Copyright: 2012, Canonical Ltd.20Copyright: 2012, Canonical Ltd.
21License: LGPL-321License: LGPL-3
22Note: There are some changed to this file22Note: There are some changed to this file
2323
24Files: ubuntucomponents/InputHandler.qml24Files: app/ubuntucomponents/InputHandler.qml
25Copyright: 2014, Canonical Ltd.25Copyright: 2014, Canonical Ltd.
26License: LGPL-326License: LGPL-3
27Note: There are some changed to this file27Note: There are some changed to this file
2828
29Files: components/HorizontalFlowListView.qml29Files: app/components/HorizontalFlowListView.qml
30Copyright: 2012, Ruediger Gad30Copyright: 2012, Ruediger Gad
31 2014, Stefano Verzegnassi31 2014, Stefano Verzegnassi
32License: LGPL-3+32License: LGPL-3+
3333
34Files: app/theme/*
35Copyright: 2014, Canonical Ltd.
36License: LGPL-3
37
38Files: app/theme/PageHeadStyle.qml
39Copyright: 2014, Canonical Ltd.
40 2015, Stefano Verzegnassi
41License: LGPL-3
42
43Files: app/theme/SectionButton.qml
44Copyright: 2014-2015 Dan Chapman
45 2015 Stefano Verzegnassi
46License: GPL-2 or GPL-3
47
48Files: app/theme/origami.png
49Copyright: 2015 Stefano Verzegnassi
50License: GPL-2+
51Note: This is a derivative work of "Ubuntu-UI-Toolkit" from Kevin Feyder, released under the terms of GNU GPL v2 (or later).
52See https://github.com/halfsail/Ubuntu-UI-Tookit for further informations.
53
34Files: img/palette.svg54Files: img/palette.svg
35Copyright: 2014, Stefano Verzegnassi55Copyright: 2014, Stefano Verzegnassi
36License: CC-BY-SA-3.056License: CC-BY-SA-3.0
@@ -73,6 +93,20 @@
73 You should have received a copy of the GNU Lesser General Public License93 You should have received a copy of the GNU Lesser General Public License
74 along with this program. If not, see <http://www.gnu.org/licenses/>.94 along with this program. If not, see <http://www.gnu.org/licenses/>.
7595
96License: GPL-2 or GPL-3
97 This program is free software; you can redistribute it and/or
98 modify it under the terms of the GNU General Public License as
99 published by the Free Software Foundation; either version 2 of
100 the License or (at your option) version 3
101 .
102 This program is distributed in the hope that it will be useful,
103 but WITHOUT ANY WARRANTY; without even the implied warranty of
104 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
105 GNU General Public License for more details.
106 .
107 You should have received a copy of the GNU General Public License
108 along with this program. If not, see <http://www.gnu.org/licenses/>.
109
76License: CC-BY-SA-3.0110License: CC-BY-SA-3.0
77 This work is licensed under the Creative Commons Attribution-ShareAlike 3.0111 This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
78 Unported License. To view a copy of this license, visit112 Unported License. To view a copy of this license, visit
79113
=== modified file 'po/quick-memo.pot'
--- po/quick-memo.pot 2015-04-26 17:08:56 +0000
+++ po/quick-memo.pot 2015-08-03 11:33:33 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2015-04-26 19:07+0200\n"11"POT-Creation-Date: 2015-06-16 01:23+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -27,8 +27,8 @@
27msgstr ""27msgstr ""
2828
29#: ../app/common/ColorDialog.qml:15129#: ../app/common/ColorDialog.qml:151
30#: ../app/mainPage/MultiSelectionHandler.qml:33 ../app/ui/EditMemoPage.qml:27030#: ../app/mainPage/MultiSelectionHandler.qml:33 ../app/ui/EditMemoPage.qml:267
31#: ../app/ui/EditMemoPage.qml:298 ../app/ui/MainPage.qml:26331#: ../app/ui/EditMemoPage.qml:295 ../app/ui/MainPage.qml:263
32msgid "Cancel"32msgid "Cancel"
33msgstr ""33msgstr ""
3434
@@ -47,7 +47,7 @@
4747
48#. TRANSLATORS: This is a custom text for the "enter" key of48#. TRANSLATORS: This is a custom text for the "enter" key of
49#. the on-screen keyboard (max 4 char, so it's not elided)49#. the on-screen keyboard (max 4 char, so it's not elided)
50#: ../app/editPage/ListManager.qml:289 ../app/ui/EditMemoPage.qml:8550#: ../app/editPage/ListManager.qml:289 ../app/ui/EditMemoPage.qml:82
51msgid "Next"51msgid "Next"
52msgstr ""52msgstr ""
5353
@@ -113,79 +113,79 @@
113msgid "Add a new memo"113msgid "Add a new memo"
114msgstr ""114msgstr ""
115115
116#: ../app/ui/EditMemoPage.qml:79116#: ../app/ui/EditMemoPage.qml:76
117msgid "No title"117msgid "No title"
118msgstr ""118msgstr ""
119119
120#: ../app/ui/EditMemoPage.qml:93120#: ../app/ui/EditMemoPage.qml:90
121msgid "No description"121msgid "No description"
122msgstr ""122msgstr ""
123123
124#: ../app/ui/EditMemoPage.qml:114124#: ../app/ui/EditMemoPage.qml:111
125#, qt-format125#, qt-format
126msgid "Last update: %1"126msgid "Last update: %1"
127msgstr ""127msgstr ""
128128
129#: ../app/ui/EditMemoPage.qml:193129#: ../app/ui/EditMemoPage.qml:190
130msgid "Memo saved!"130msgid "Memo saved!"
131msgstr ""131msgstr ""
132132
133#: ../app/ui/EditMemoPage.qml:199133#: ../app/ui/EditMemoPage.qml:196
134msgid "Save"134msgid "Save"
135msgstr ""135msgstr ""
136136
137#: ../app/ui/EditMemoPage.qml:208 ../app/ui/EditMemoPage.qml:266137#: ../app/ui/EditMemoPage.qml:205 ../app/ui/EditMemoPage.qml:263
138#: ../app/ui/MainPage.qml:220 ../app/ui/MainPage.qml:259138#: ../app/ui/MainPage.qml:220 ../app/ui/MainPage.qml:259
139msgid "Delete memo"139msgid "Delete memo"
140msgid_plural "Delete memos"140msgid_plural "Delete memos"
141msgstr[0] ""141msgstr[0] ""
142msgstr[1] ""142msgstr[1] ""
143143
144#: ../app/ui/EditMemoPage.qml:215 ../app/ui/MainPage.qml:213144#: ../app/ui/EditMemoPage.qml:212 ../app/ui/MainPage.qml:213
145msgid "Change memo color"145msgid "Change memo color"
146msgstr ""146msgstr ""
147147
148#: ../app/ui/EditMemoPage.qml:240 ../app/ui/MainPage.qml:248148#: ../app/ui/EditMemoPage.qml:237 ../app/ui/MainPage.qml:248
149msgid "Memo updated!"149msgid "Memo updated!"
150msgid_plural "Memos updated!"150msgid_plural "Memos updated!"
151msgstr[0] ""151msgstr[0] ""
152msgstr[1] ""152msgstr[1] ""
153153
154#: ../app/ui/EditMemoPage.qml:255154#: ../app/ui/EditMemoPage.qml:252
155msgid "Memo aborted!"155msgid "Memo aborted!"
156msgstr ""156msgstr ""
157157
158#: ../app/ui/EditMemoPage.qml:266158#: ../app/ui/EditMemoPage.qml:263
159msgid "Empty memo"159msgid "Empty memo"
160msgstr ""160msgstr ""
161161
162#: ../app/ui/EditMemoPage.qml:267162#: ../app/ui/EditMemoPage.qml:264
163msgid "This memo has no content."163msgid "This memo has no content."
164msgstr ""164msgstr ""
165165
166#: ../app/ui/EditMemoPage.qml:267 ../app/ui/MainPage.qml:260166#: ../app/ui/EditMemoPage.qml:264 ../app/ui/MainPage.qml:260
167msgid "Are you sure?"167msgid "Are you sure?"
168msgstr ""168msgstr ""
169169
170#: ../app/ui/EditMemoPage.qml:276 ../app/ui/MainPage.qml:268170#: ../app/ui/EditMemoPage.qml:273 ../app/ui/MainPage.qml:268
171msgid "Delete"171msgid "Delete"
172msgstr ""172msgstr ""
173173
174#: ../app/ui/EditMemoPage.qml:284 ../app/ui/MainPage.qml:275174#: ../app/ui/EditMemoPage.qml:281 ../app/ui/MainPage.qml:275
175msgid "Memo deleted!"175msgid "Memo deleted!"
176msgid_plural "Memos deleted!"176msgid_plural "Memos deleted!"
177msgstr[0] ""177msgstr[0] ""
178msgstr[1] ""178msgstr[1] ""
179179
180#: ../app/ui/EditMemoPage.qml:294180#: ../app/ui/EditMemoPage.qml:291
181msgid "Discard changes?"181msgid "Discard changes?"
182msgstr ""182msgstr ""
183183
184#: ../app/ui/EditMemoPage.qml:295184#: ../app/ui/EditMemoPage.qml:292
185msgid "Your memo will be PERMANENTLY lost."185msgid "Your memo will be PERMANENTLY lost."
186msgstr ""186msgstr ""
187187
188#: ../app/ui/EditMemoPage.qml:303188#: ../app/ui/EditMemoPage.qml:300
189msgid "Go back!"189msgid "Go back!"
190msgstr ""190msgstr ""
191191

Subscribers

People subscribed via source and target branches

to all changes: