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
1=== modified file 'app/common/ColorDialog.qml'
2--- app/common/ColorDialog.qml 2015-04-13 21:03:47 +0000
3+++ app/common/ColorDialog.qml 2015-08-03 11:33:33 +0000
4@@ -24,7 +24,7 @@
5
6 title: i18n.tr("Pick a color")
7
8- property var colors: ["#fdfdfd", "#e9674d", "#f0a250", "#eec34f", "#aea79f", "#95c253", "#8bbee2", "#e46f8e"]
9+ property var colors: ["#95c253", "#e9674d", "#f0a250", "#eec34f", "#aea79f", "#8bbee2", "#e46f8e"]
10 property color selectedColor: colors[0]
11
12 property bool showTick: true
13
14=== removed file 'app/common/PageBackground.qml'
15--- app/common/PageBackground.qml 2015-04-13 21:03:47 +0000
16+++ app/common/PageBackground.qml 1970-01-01 00:00:00 +0000
17@@ -1,25 +0,0 @@
18-import QtQuick 2.0
19-
20-// Background
21-Rectangle {
22- id: bg
23- anchors.fill: parent
24- z: -10; opacity: 0.5
25-
26- property bool __parentPageAboutToBeClosed: false
27-
28- /* MainView clips its content, so that it does not overlap the header.
29- We need to bypass this, using another Rectangle that specifically overlap the header. */
30- Rectangle {
31- parent: root.header
32- z: -10; opacity: 0.5
33-
34- width: root.width
35- height: root.header.height
36- color: bg.color
37-
38- // FIXME: Header background should progressively change opacity to 0.0 when the BottomEdge page is dismissed.
39- visible: !bg.__parentPageAboutToBeClosed
40- }
41-}
42-
43
44=== modified file 'app/common/PageWithBottomEdge.qml'
45--- app/common/PageWithBottomEdge.qml 2015-04-13 21:03:47 +0000
46+++ app/common/PageWithBottomEdge.qml 2015-08-03 11:33:33 +0000
47@@ -71,6 +71,9 @@
48 property alias bottomEdgePageComponent: edgeLoader.sourceComponent
49 property alias bottomEdgePageSource: edgeLoader.source
50 property alias bottomEdgeTitle: tipLabel.text
51+ property alias bottomEdgeIconName: tipIcon.name
52+ property alias bottomEdgeIconSource: tipIcon.source
53+ property alias bottomEdgeColor: tip.color
54 property bool bottomEdgeEnabled: true
55 property int bottomEdgeExpandThreshold: page.height * 0.2
56 property int bottomEdgeExposedArea: bottomEdge.state !== "expanded" ? (page.height - bottomEdge.y - bottomEdge.tipHeight) : _areaWhenExpanded
57@@ -183,6 +186,27 @@
58 verticalAlignment: Text.AlignVCenter
59 horizontalAlignment: Text.AlignHCenter
60 opacity: tip.hidden ? 0.0 : 1.0
61+ color: ColorUtils.luminance(tip.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
62+ visible: text
63+
64+ Behavior on opacity {
65+ UbuntuNumberAnimation {
66+ duration: UbuntuAnimation.SnapDuration
67+ }
68+ }
69+ }
70+ Icon {
71+ id: tipIcon
72+ anchors {
73+ top: parent.top
74+ horizontalCenter: parent.horizontalCenter
75+ topMargin: units.gu(0.5)
76+ }
77+ height: bottomEdge.tipHeight - units.gu(0.5)
78+ visible: source.length > 0 || name.length > 0
79+ opacity: tip.hidden ? 0.0 : 1.0
80+ color: ColorUtils.luminance(tip.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
81+
82 Behavior on opacity {
83 UbuntuNumberAnimation {
84 duration: UbuntuAnimation.SnapDuration
85
86=== modified file 'app/main.qml'
87--- app/main.qml 2015-04-13 21:06:51 +0000
88+++ app/main.qml 2015-08-03 11:33:33 +0000
89@@ -34,6 +34,9 @@
90
91 anchorToKeyboard: true
92
93+ property color headerBackgroundColor: "#95c253"
94+ readonly property color defaulteaderBackgroundColor: "#95c253"
95+
96 // Use GridView to display data. This setting is used by any page that provides data from models.
97 property bool useGridView: true
98
99@@ -54,6 +57,10 @@
100 var toast = component.createObject(root, {"text" : text});
101 }
102
103+ Component.onCompleted: {
104+ header.style = Qt.createComponent(Qt.resolvedUrl("theme/PageHeadStyle.qml"))
105+ }
106+
107 /*
108 Not now, but in the future:
109 TODO: Layout convergence
110
111=== added directory 'app/theme'
112=== added file 'app/theme/OverflowPanel.qml'
113--- app/theme/OverflowPanel.qml 1970-01-01 00:00:00 +0000
114+++ app/theme/OverflowPanel.qml 2015-08-03 11:33:33 +0000
115@@ -0,0 +1,22 @@
116+/*
117+ * Copyright 2014 Canonical Ltd.
118+ *
119+ * This program is free software; you can redistribute it and/or modify
120+ * it under the terms of the GNU Lesser General Public License as published by
121+ * the Free Software Foundation; version 3.
122+ *
123+ * This program is distributed in the hope that it will be useful,
124+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
125+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
126+ * GNU Lesser General Public License for more details.
127+ *
128+ * You should have received a copy of the GNU Lesser General Public License
129+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
130+ */
131+
132+import QtQuick 2.3
133+import Ubuntu.Components.Popups 1.0
134+
135+Popover {
136+ property bool square: true
137+}
138
139=== added file 'app/theme/PageHeadButton.qml'
140--- app/theme/PageHeadButton.qml 1970-01-01 00:00:00 +0000
141+++ app/theme/PageHeadButton.qml 2015-08-03 11:33:33 +0000
142@@ -0,0 +1,70 @@
143+/*
144+ * Copyright 2014 Canonical Ltd.
145+ *
146+ * This program is free software; you can redistribute it and/or modify
147+ * it under the terms of the GNU Lesser General Public License as published by
148+ * the Free Software Foundation; version 3.
149+ *
150+ * This program is distributed in the hope that it will be useful,
151+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
152+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
153+ * GNU Lesser General Public License for more details.
154+ *
155+ * You should have received a copy of the GNU Lesser General Public License
156+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
157+ */
158+
159+import QtQuick 2.3
160+import Ubuntu.Components 1.1
161+
162+AbstractButton {
163+ id: button
164+
165+ property real iconWidth: units.gu(2.5)
166+ property real iconHeight: iconWidth
167+
168+ width: visible ? units.gu(5) : 0
169+ height: parent ? parent.height : undefined
170+
171+ property alias color: icon.color
172+
173+ Rectangle {
174+ visible: button.pressed
175+ anchors.fill: parent
176+ color: Theme.palette.selected.background
177+ }
178+
179+ Icon {
180+ id: icon
181+ anchors {
182+ centerIn: parent
183+ }
184+ // prevent trying to render the icon with an invalid source
185+ // when the button is invisible by setting width and height to 0
186+ width: visible ? button.iconWidth : 0
187+ height: visible ? button.iconHeight : 0
188+ source: button.iconSource
189+ color: Qt.rgba(0, 0, 0, 0)
190+ opacity: button.enabled ? 1.0 : 0.3
191+ }
192+
193+ Component {
194+ id: labelComponent
195+ Label {
196+ id: label
197+ objectName: button.objectName + "_label"
198+ color: button.color
199+ opacity: button.enabled ? 1.0 : 0.3
200+ text: button.text
201+ fontSize: "xx-small"
202+ }
203+ }
204+ Loader {
205+ anchors {
206+ top: icon.bottom
207+ topMargin: units.gu(0.5)
208+ horizontalCenter: parent.horizontalCenter
209+ }
210+ sourceComponent: button.state === "IconAndLabel" ? labelComponent : null
211+ }
212+}
213
214=== added file 'app/theme/PageHeadStyle.qml'
215--- app/theme/PageHeadStyle.qml 1970-01-01 00:00:00 +0000
216+++ app/theme/PageHeadStyle.qml 2015-08-03 11:33:33 +0000
217@@ -0,0 +1,552 @@
218+/*
219+ * Copyright 2014 Canonical Ltd.
220+ * Copyright 2015 Stefano Verzegnassi <verzegnassi.stefano@gmail.com>
221+ *
222+ * This program is free software; you can redistribute it and/or modify
223+ * it under the terms of the GNU Lesser General Public License as published by
224+ * the Free Software Foundation; version 3.
225+ *
226+ * This program is distributed in the hope that it will be useful,
227+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
228+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
229+ * GNU Lesser General Public License for more details.
230+ *
231+ * You should have received a copy of the GNU Lesser General Public License
232+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
233+ */
234+
235+import QtQuick 2.3
236+import Ubuntu.Components 1.1
237+import Ubuntu.Components.Popups 1.0
238+import Ubuntu.Components.ListItems 1.0 as ListItem
239+import Ubuntu.Components.Styles 1.1 as Style
240+
241+Style.PageHeadStyle {
242+ id: headerStyle
243+
244+ contentHeight: units.gu(7)
245+ fontWeight: Font.Light
246+ fontSize: "x-large"
247+ textLeftMargin: units.gu(2)
248+ maximumNumberOfActions: 3
249+
250+ property color buttonColor: ColorUtils.luminance(bg.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
251+ property color titleColor: ColorUtils.luminance(bg.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
252+ property color panelBackgroundColor: UbuntuColors.orange
253+ property color panelHighlightColor: Theme.palette.selected.background
254+ property color panelForegroundColor: ColorUtils.luminance(bg.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
255+ property color sectionColor: ColorUtils.luminance(bg.color) >= 0.85 ? UbuntuColors.darkGrey : "#FFFFFF"
256+ property color sectionHighlightColor: Theme.palette.selected.background
257+
258+ implicitHeight: headerStyle.contentHeight + divider.height
259+
260+ Rectangle {
261+ id: bg
262+ anchors.fill: parent
263+ color: root.headerBackgroundColor
264+
265+ Image {
266+ anchors {
267+ right: parent.right
268+ top: parent.top
269+ bottom: parent.bottom
270+ }
271+ width: units.gu(20)
272+
273+ fillMode: Image.PreserveAspectCrop
274+ source: Qt.resolvedUrl("origami.png")
275+ }
276+ }
277+
278+ Item {
279+ id: divider
280+ anchors {
281+ bottom: parent.bottom
282+ left: parent.left
283+ right: parent.right
284+ }
285+
286+ height: sectionsRow.visible ? units.gu(3) : 0
287+ property PageHeadSections sections: styledItem.config.sections
288+
289+ Row {
290+ id: sectionsRow
291+
292+ anchors {
293+ verticalCenter: parent.verticalCenter
294+ left: parent.left; right: parent.right
295+ leftMargin: units.gu(2)
296+ rightMargin: units.gu(2)
297+ }
298+
299+ height: parent.height
300+ enabled: divider.sections.enabled
301+ visible: divider.sections.model !== undefined
302+ opacity: enabled ? 1.0 : 0.5
303+
304+ Repeater {
305+ id: sectionsRepeater
306+ model: divider.sections.model
307+ delegate: SectionButton {}
308+ }
309+ }
310+ }
311+
312+ states: [
313+ State {
314+ name: "IN"
315+ PropertyChanges {
316+ target: allContents
317+ opacity: 1.0
318+ }
319+ },
320+ State {
321+ name: "OUT"
322+ PropertyChanges {
323+ target: allContents
324+ opacity: 0.0
325+ }
326+ }
327+ ]
328+
329+ function animateOut() {
330+ state = "OUT";
331+ }
332+ function animateIn() {
333+ state = "IN";
334+ }
335+
336+ signal animateOutFinished()
337+ signal animateInFinished()
338+
339+ transitions: [
340+ Transition {
341+ id: transitionOut
342+ from: "IN"
343+ to: "OUT"
344+ SequentialAnimation {
345+ ParallelAnimation {
346+ UbuntuNumberAnimation {
347+ target: allContents
348+ property: "opacity"
349+ from: 1.0
350+ to: 0.0
351+ }
352+ UbuntuNumberAnimation {
353+ target: leftAnchor
354+ properties: "anchors.leftMargin"
355+ from: 0.0
356+ to: -units.gu(5)
357+ }
358+ UbuntuNumberAnimation {
359+ target: rightAnchor
360+ properties: "anchors.rightMargin"
361+ from: 0
362+ to: -units.gu(5)
363+ }
364+ }
365+ ScriptAction {
366+ script: headerStyle.animateOutFinished()
367+ }
368+ }
369+ },
370+ Transition {
371+ id: transitionIn
372+ from: "OUT"
373+ to: "IN"
374+ SequentialAnimation {
375+ ParallelAnimation {
376+ UbuntuNumberAnimation {
377+ target: allContents
378+ property: "opacity"
379+ from: 0.0
380+ to: 1.0
381+ }
382+ UbuntuNumberAnimation {
383+ target: leftAnchor
384+ properties: "anchors.leftMargin"
385+ from: -units.gu(5)
386+ to: 0
387+ }
388+ UbuntuNumberAnimation {
389+ target: rightAnchor
390+ properties: "anchors.rightMargin"
391+ from: -units.gu(5)
392+ to: 0
393+ }
394+ }
395+ ScriptAction {
396+ script: headerStyle.animateInFinished()
397+ }
398+ }
399+ }
400+ ]
401+
402+ Item {
403+ id: allContents
404+ anchors.fill: parent
405+
406+ Item {
407+ id: leftAnchor
408+ anchors {
409+ top: parent.top
410+ bottom: parent.bottom
411+ left: parent.left
412+ leftMargin: 0
413+ }
414+ width: 0
415+ }
416+ Item {
417+ id: rightAnchor
418+ anchors {
419+ top: parent.top
420+ bottom: parent.bottom
421+ right: parent.right
422+ rightMargin: 0
423+ }
424+ width: 0
425+ }
426+
427+ Item {
428+ id: leftButtonContainer
429+ anchors {
430+ left: leftAnchor.right
431+ top: parent.top
432+ leftMargin: width > 0 ? units.gu(1) : 0
433+ }
434+ width: childrenRect.width
435+ height: headerStyle.contentHeight
436+
437+ PageHeadButton {
438+ id: customBackButton
439+ objectName: "customBackButton"
440+ action: styledItem.config.backAction
441+ visible: null !== styledItem.config.backAction &&
442+ styledItem.config.backAction.visible
443+ color: headerStyle.panelForegroundColor
444+ }
445+
446+ PageHeadButton {
447+ id: backButton
448+ objectName: "backButton"
449+
450+ iconName: "back"
451+ visible: styledItem.pageStack !== null &&
452+ styledItem.pageStack !== undefined &&
453+ styledItem.pageStack.depth > 1 &&
454+ !styledItem.config.backAction
455+
456+ text: "back"
457+ color: headerStyle.panelForegroundColor
458+
459+ onTriggered: {
460+ styledItem.pageStack.pop();
461+ }
462+ }
463+
464+ PageHeadButton {
465+ id: tabsButton
466+ objectName: "tabsButton"
467+
468+ iconName: "navigation-menu"
469+ visible: styledItem.tabsModel !== null &&
470+ styledItem.tabsModel !== undefined &&
471+ !backButton.visible &&
472+ !customBackButton.visible
473+ text: visible ? styledItem.tabsModel.count + " tabs" : ""
474+ color: headerStyle.buttonColor
475+
476+ onTriggered: PopupUtils.open(tabsPopoverComponent, tabsButton)
477+
478+ Component {
479+ id: tabsPopoverComponent
480+
481+ OverflowPanel {
482+ id: tabsPopover
483+ objectName: "tabsPopover"
484+ callerMargin: -units.gu(1) + units.dp(4)
485+ contentWidth: units.gu(20)
486+
487+ Binding {
488+ target: tabsPopover.__foreground.__styleInstance
489+ property: "color"
490+ value: headerStyle.panelBackgroundColor
491+ when: tabsPopover.__foreground &&
492+ tabsPopover.__foreground.__styleInstance
493+ }
494+
495+ Column {
496+ anchors {
497+ left: parent.left
498+ top: parent.top
499+ right: parent.right
500+ }
501+ Repeater {
502+ model: styledItem.tabsModel
503+ AbstractButton {
504+ objectName: "tabButton" + index
505+ onClicked: {
506+ styledItem.tabsModel.selectedIndex = index;
507+ tabsPopover.hide();
508+ }
509+ implicitHeight: units.gu(6) + bottomDividerLine.height
510+ width: parent ? parent.width : units.gu(31)
511+
512+ Rectangle {
513+ visible: parent.pressed
514+ anchors {
515+ left: parent.left
516+ right: parent.right
517+ top: parent.top
518+ }
519+ height: parent.height - bottomDividerLine.height
520+ color: headerStyle.panelHighlightColor
521+ }
522+
523+ Label {
524+ anchors {
525+ verticalCenter: parent.verticalCenter
526+ verticalCenterOffset: units.dp(-1)
527+ left: parent.left
528+ leftMargin: units.gu(2)
529+ right: parent.right
530+ }
531+ fontSize: "medium"
532+ elide: Text.ElideRight
533+ text: tab.title // FIXME: only "title" doesn't work with i18n.tr(). Why not?
534+ color: headerStyle.panelForegroundColor
535+ }
536+
537+ ListItem.ThinDivider {
538+ id: bottomDividerLine
539+ anchors.bottom: parent.bottom
540+ visible: index < styledItem.tabsModel.count - 1
541+ }
542+ }
543+ }
544+ }
545+ }
546+ }
547+ }
548+ }
549+
550+ Item {
551+ id: foreground
552+ anchors {
553+ left: leftButtonContainer.right
554+ top: parent.top
555+ // don't keep a margin if there is already a button with spacing
556+ leftMargin: leftButtonContainer.width > 0 ? 0 : headerStyle.textLeftMargin
557+ }
558+ width: parent.width - anchors.leftMargin
559+ - leftButtonContainer.anchors.leftMargin - leftButtonContainer.width
560+ - actionsContainer.anchors.rightMargin - actionsContainer.width
561+ height: headerStyle.contentHeight
562+
563+ Label {
564+ objectName: "header_title_label"
565+ LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
566+ visible: !contentsContainer.visible && styledItem.config.preset === ""
567+ anchors {
568+ left: parent.left
569+ right: parent.right
570+ verticalCenter: parent.verticalCenter
571+ }
572+ text: styledItem.title
573+ font.weight: headerStyle.fontWeight
574+ fontSize: headerStyle.fontSize
575+ color: headerStyle.titleColor
576+ elide: Text.ElideRight
577+ }
578+
579+ Item {
580+ // This Item is used to make the custom header item invisible
581+ // when styledItem.contents is unset and its parent is not updated
582+ // when the bindings below is no longer active
583+ id: contentsContainer
584+ anchors.fill: parent
585+ visible: styledItem.contents || styledItem.config.contents
586+ }
587+ Binding {
588+ target: styledItem.contents
589+ property: "anchors.fill"
590+ value: contentsContainer
591+ when: styledItem.contents
592+ }
593+ Binding {
594+ target: styledItem.contents
595+ property: "parent"
596+ value: contentsContainer
597+ when: styledItem.contents
598+ }
599+ Binding {
600+ target: styledItem.config.contents
601+ property: "parent"
602+ value: contentsContainer
603+ when: styledItem.config.contents && !styledItem.contents
604+ }
605+ }
606+
607+ Row {
608+ id: actionsContainer
609+
610+ property var visibleActions: getVisibleActions(styledItem.config.actions)
611+ function getVisibleActions(actions) {
612+ var visibleActionList = [];
613+ for (var i in actions) {
614+ var action = actions[i];
615+ if (action && action.hasOwnProperty("visible") && action.visible) {
616+ visibleActionList.push(action);
617+ }
618+ }
619+ return visibleActionList;
620+ }
621+
622+ QtObject {
623+ id: numberOfSlots
624+ property int requested: actionsContainer.visibleActions.length
625+ property int left: tabsButton.visible || backButton.visible ||
626+ customBackButton.visible ? 1 : 0
627+ property int right: headerStyle.maximumNumberOfActions - left
628+ property int overflow: actionsOverflowButton.visible ? 1 : 0
629+ property int used: Math.min(right - overflow, requested)
630+ }
631+
632+ anchors {
633+ top: parent.top
634+ right: rightAnchor.left
635+ rightMargin: actionsContainer.width > 0 ? units.gu(1) : 0
636+ }
637+ width: childrenRect.width
638+ height: headerStyle.contentHeight
639+
640+ Repeater {
641+ model: numberOfSlots.used
642+ PageHeadButton {
643+ id: actionButton
644+ objectName: action.objectName + "_header_button"
645+ action: actionsContainer.visibleActions[index]
646+ color: headerStyle.buttonColor
647+ state: styledItem.config.preset === "select" ?
648+ "IconAndLabel" : ""
649+ }
650+ }
651+
652+ PageHeadButton {
653+ id: actionsOverflowButton
654+ objectName: "actions_overflow_button"
655+ visible: numberOfSlots.requested > numberOfSlots.right
656+ // Ensure resetting of X when this button is not visible to avoid
657+ // miscalculation of actionsContainer.width. Fixes bug #1408481.
658+ onVisibleChanged: if (!visible) x = 0
659+ iconName: "contextual-menu"
660+ color: headerStyle.buttonColor
661+ height: actionsContainer.height
662+ onTriggered: PopupUtils.open(actionsOverflowPopoverComponent, actionsOverflowButton)
663+
664+ Component {
665+ id: actionsOverflowPopoverComponent
666+
667+ OverflowPanel {
668+ id: actionsOverflowPopover
669+ objectName: "actions_overflow_popover"
670+ callerMargin: -units.gu(1) + units.dp(4)
671+ contentWidth: units.gu(20)
672+
673+ Binding {
674+ target: actionsOverflowPopover.__foreground.__styleInstance
675+ property: "color"
676+ value: headerStyle.panelBackgroundColor
677+ when: actionsOverflowPopover.__foreground &&
678+ actionsOverflowPopover.__foreground.__styleInstance
679+ }
680+
681+ // Ensure the popover closes when actions change and
682+ // the list item below may be destroyed before its
683+ // onClicked is executed. See bug
684+ // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1326963
685+ Connections {
686+ target: styledItem.config
687+ onActionsChanged: {
688+ actionsOverflowPopover.hide();
689+ }
690+ }
691+ Connections {
692+ target: styledItem
693+ onConfigChanged: {
694+ actionsOverflowPopover.hide();
695+ }
696+ }
697+
698+ Column {
699+ anchors {
700+ left: parent.left
701+ top: parent.top
702+ right: parent.right
703+ }
704+ Repeater {
705+ id: overflowRepeater
706+ model: numberOfSlots.requested - numberOfSlots.used
707+ AbstractButton {
708+ action: actionsContainer.visibleActions[numberOfSlots.used + index]
709+ objectName: action.objectName + "_header_overflow_button"
710+ onClicked: actionsOverflowPopover.hide()
711+ implicitHeight: units.gu(6) + bottomDividerLine.height
712+ width: parent ? parent.width : units.gu(31)
713+
714+ Rectangle {
715+ visible: parent.pressed
716+ anchors {
717+ left: parent.left
718+ right: parent.right
719+ top: parent.top
720+ }
721+ height: parent.height - bottomDividerLine.height
722+ color: headerStyle.panelHighlightColor
723+ }
724+
725+ Icon {
726+ id: actionIcon
727+ source: action.iconSource
728+ color: headerStyle.panelForegroundColor
729+ anchors {
730+ verticalCenter: parent.verticalCenter
731+ verticalCenterOffset: units.dp(-1)
732+ left: parent.left
733+ leftMargin: units.gu(2)
734+ }
735+ width: units.gu(2)
736+ height: units.gu(2)
737+ opacity: action.enabled ? 1.0 : 0.5
738+ }
739+
740+ Label {
741+ anchors {
742+ verticalCenter: parent.verticalCenter
743+ verticalCenterOffset: units.dp(-1)
744+ left: actionIcon.right
745+ leftMargin: units.gu(2)
746+ right: parent.right
747+ }
748+ fontSize: "small"
749+ elide: Text.ElideRight
750+ text: action.text
751+ color: headerStyle.panelForegroundColor
752+ opacity: action.enabled ? 1.0 : 0.5
753+ }
754+
755+ ListItem.ThinDivider {
756+ id: bottomDividerLine
757+ anchors.bottom: parent.bottom
758+ visible: index !== overflowRepeater.count - 1
759+ }
760+ }
761+ }
762+ }
763+ }
764+ }
765+ }
766+ }
767+ }
768+}
769+
770
771=== added file 'app/theme/SectionButton.qml'
772--- app/theme/SectionButton.qml 1970-01-01 00:00:00 +0000
773+++ app/theme/SectionButton.qml 2015-08-03 11:33:33 +0000
774@@ -0,0 +1,52 @@
775+/* Copyright (C) 2014-2015 Dan Chapman <dpniel@ubuntu.com>
776+ Copyright (C) 2015 Stefano Verzegnassi <verzegnassi.stefano@gmail.com>
777+
778+ This file is part of Dekko email client for Ubuntu Devices/
779+
780+ This program is free software; you can redistribute it and/or
781+ modify it under the terms of the GNU General Public License as
782+ published by the Free Software Foundation; either version 2 of
783+ the License or (at your option) version 3
784+
785+ This program is distributed in the hope that it will be useful,
786+ but WITHOUT ANY WARRANTY; without even the implied warranty of
787+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
788+ GNU General Public License for more details.
789+
790+ You should have received a copy of the GNU General Public License
791+ along with this program. If not, see <http://www.gnu.org/licenses/>.
792+*/
793+
794+import QtQuick 2.3
795+import Ubuntu.Components 1.1
796+
797+AbstractButton {
798+ id: sectionButton
799+
800+ width: sectionsRow.width / sectionsRepeater.count
801+ height: divider.height
802+
803+ anchors.verticalCenter: parent ? parent.verticalCenter : undefined
804+ enabled: sectionsRow.enabled
805+
806+ property bool selected: index === divider.sections.selectedIndex
807+ onClicked: divider.sections.selectedIndex = index;
808+
809+ Label {
810+ text: modelData
811+ color: headerStyle.sectionColor
812+ opacity: sectionButton.selected ? 1.0 : 0.65
813+
814+ anchors.horizontalCenter: parent.horizontalCenter
815+ anchors.top: parent.top
816+ }
817+
818+ Rectangle {
819+ color: headerStyle.sectionColor
820+ opacity: sectionButton.selected ? 1.0 : 0.65
821+
822+ height: units.gu(0.3)
823+ width: parent.width
824+ anchors.bottom: parent.bottom
825+ }
826+}
827
828=== added file 'app/theme/origami.png'
829Binary 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
830=== added file 'app/theme/parent_theme'
831--- app/theme/parent_theme 1970-01-01 00:00:00 +0000
832+++ app/theme/parent_theme 2015-08-03 11:33:33 +0000
833@@ -0,0 +1,1 @@
834+Ubuntu.Components.Themes.Ambiance
835
836=== modified file 'app/ui/EditMemoPage.qml'
837--- app/ui/EditMemoPage.qml 2015-04-13 21:03:47 +0000
838+++ app/ui/EditMemoPage.qml 2015-08-03 11:33:33 +0000
839@@ -44,9 +44,6 @@
840 head.backAction: editMemo ? backEditMemo : backNewMemo
841 head.actions: [colorToolAction, deleteMemo, saveMemo]
842
843- // Background
844- PageBackground { id: bg }
845-
846 // flickable property needs to be explicitly set, to avoid a binding loop for memoPage.height
847 flickable: flickable
848 Flickable {
849@@ -138,7 +135,7 @@
850
851 title.text = memoObj.contents.title
852 desc.text = memoObj.contents.text
853- bg.color = memoObj.contents.color
854+ root.headerBackgroundColor = memoObj.contents.color
855
856 // Append list items provided by NoteModel
857 listManager.model.clear()
858@@ -157,7 +154,7 @@
859 desc.textReallyChanged.connect(updateNote)
860 listManager.listChanged.connect(updateNote)
861 picsView.picsModelChanged.connect(updateNote)
862- bg.colorChanged.connect(updateNote)
863+ root.headerBackgroundColorChanged.connect(updateNote)
864
865 updateLabel.refresh()
866 }
867@@ -172,7 +169,7 @@
868 obj.contents.title = title.text
869 obj.contents.text = desc.text
870 // The char '#' from the hex color is not correctly parse by JSON. We add an empty string, so that it works well.
871- obj.contents.color = "" + bg.color
872+ obj.contents.color = "" + root.headerBackgroundColor
873 obj.contents.list = listManager.exportModel()
874 obj.contents.pictures = picsView.exportModel()
875
876@@ -185,7 +182,7 @@
877 function addNote() {
878 notes.addNote(title.text,
879 desc.text,
880- "" + bg.color, // The char '#' from the hex color is not correctly parse by JSON. We add an empty string, so that it works well.
881+ "" + root.headerBackgroundColor, // The char '#' from the hex color is not correctly parse by JSON. We add an empty string, so that it works well.
882 listManager.exportModel(),
883 picsView.exportModel())
884 pageStack.pop()
885@@ -270,7 +267,7 @@
886 text: i18n.tr("Cancel")
887 gradient: UbuntuColors.greyGradient
888 onClicked: deleteDialog.hide()
889- visible: !emptyMemo
890+ visible: !deleteDialog.emptyMemo
891 }
892 Button {
893 text: i18n.tr("Delete")
894@@ -278,7 +275,7 @@
895 onClicked: {
896 deleteDialog.hide()
897 pageStack.pop();
898- pageStack.push(mainPage)
899+ pageStack.push(Qt.resolvedUrl("MainPage.qml"))
900 notes.deleteNote(index)
901
902 root.showNotification(i18n.tr("Memo deleted!"))
903@@ -316,10 +313,10 @@
904 ColorDialog {
905 id: colorDialog
906
907- selectedColor: bg.color
908+ selectedColor: root.headerBackgroundColor
909 onColorPicked: {
910 if (isChanged)
911- bg.color = selectedColor
912+ root.headerBackgroundColor = selectedColor
913
914 PopupUtils.close(colorDialog)
915 }
916
917=== modified file 'app/ui/MainPage.qml'
918--- app/ui/MainPage.qml 2015-04-26 17:08:56 +0000
919+++ app/ui/MainPage.qml 2015-08-03 11:33:33 +0000
920@@ -278,8 +278,17 @@
921 }
922 }
923
924- bottomEdgeTitle: i18n.tr("New memo")
925+ //bottomEdgeTitle: i18n.tr("New memo")
926+ bottomEdgeIconName: "note-new"
927+ bottomEdgeColor: "#95c253"
928 bottomEdgePageComponent: EditMemoPage {}
929 // Disable bottomEdge when MultiSelectionHandler is active
930 bottomEdgeEnabled: mainPage.state !== "multiSelection"
931+
932+ onVisibleChanged: {
933+ if (visible) {
934+ // Restore default color
935+ root.headerBackgroundColor = root.defaulteaderBackgroundColor
936+ }
937+ }
938 }
939
940=== modified file 'copyright'
941--- copyright 2015-01-17 20:25:00 +0000
942+++ copyright 2015-08-03 11:33:33 +0000
943@@ -7,30 +7,50 @@
944 Copyright: 2014-2015, Stefano Verzegnassi
945 License: GPL-3
946
947-Files: components/PageWithBottomEdge.qml
948+Files: app/components/PageWithBottomEdge.qml
949 Copyright: 2014, Canonical Ltd.
950 License: GPL-3
951
952-Files: ubuntucomponents/TextInputPopover.qml
953- ubuntucomponents/TextCursor.qml
954+Files: app/ubuntucomponents/TextInputPopover.qml
955+ app/ubuntucomponents/TextCursor.qml
956 Copyright: 2012, Canonical Ltd.
957 License: LGPL-3
958
959-Files: ubuntucomponents/TextField.qml
960+Files: app/ubuntucomponents/TextField.qml
961 Copyright: 2012, Canonical Ltd.
962 License: LGPL-3
963 Note: There are some changed to this file
964
965-Files: ubuntucomponents/InputHandler.qml
966+Files: app/ubuntucomponents/InputHandler.qml
967 Copyright: 2014, Canonical Ltd.
968 License: LGPL-3
969 Note: There are some changed to this file
970
971-Files: components/HorizontalFlowListView.qml
972+Files: app/components/HorizontalFlowListView.qml
973 Copyright: 2012, Ruediger Gad
974 2014, Stefano Verzegnassi
975 License: LGPL-3+
976
977+Files: app/theme/*
978+Copyright: 2014, Canonical Ltd.
979+License: LGPL-3
980+
981+Files: app/theme/PageHeadStyle.qml
982+Copyright: 2014, Canonical Ltd.
983+ 2015, Stefano Verzegnassi
984+License: LGPL-3
985+
986+Files: app/theme/SectionButton.qml
987+Copyright: 2014-2015 Dan Chapman
988+ 2015 Stefano Verzegnassi
989+License: GPL-2 or GPL-3
990+
991+Files: app/theme/origami.png
992+Copyright: 2015 Stefano Verzegnassi
993+License: GPL-2+
994+Note: This is a derivative work of "Ubuntu-UI-Toolkit" from Kevin Feyder, released under the terms of GNU GPL v2 (or later).
995+See https://github.com/halfsail/Ubuntu-UI-Tookit for further informations.
996+
997 Files: img/palette.svg
998 Copyright: 2014, Stefano Verzegnassi
999 License: CC-BY-SA-3.0
1000@@ -73,6 +93,20 @@
1001 You should have received a copy of the GNU Lesser General Public License
1002 along with this program. If not, see <http://www.gnu.org/licenses/>.
1003
1004+License: GPL-2 or GPL-3
1005+ This program is free software; you can redistribute it and/or
1006+ modify it under the terms of the GNU General Public License as
1007+ published by the Free Software Foundation; either version 2 of
1008+ the License or (at your option) version 3
1009+ .
1010+ This program is distributed in the hope that it will be useful,
1011+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1012+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1013+ GNU General Public License for more details.
1014+ .
1015+ You should have received a copy of the GNU General Public License
1016+ along with this program. If not, see <http://www.gnu.org/licenses/>.
1017+
1018 License: CC-BY-SA-3.0
1019 This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
1020 Unported License. To view a copy of this license, visit
1021
1022=== modified file 'po/quick-memo.pot'
1023--- po/quick-memo.pot 2015-04-26 17:08:56 +0000
1024+++ po/quick-memo.pot 2015-08-03 11:33:33 +0000
1025@@ -8,7 +8,7 @@
1026 msgstr ""
1027 "Project-Id-Version: \n"
1028 "Report-Msgid-Bugs-To: \n"
1029-"POT-Creation-Date: 2015-04-26 19:07+0200\n"
1030+"POT-Creation-Date: 2015-06-16 01:23+0200\n"
1031 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1032 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1033 "Language-Team: LANGUAGE <LL@li.org>\n"
1034@@ -27,8 +27,8 @@
1035 msgstr ""
1036
1037 #: ../app/common/ColorDialog.qml:151
1038-#: ../app/mainPage/MultiSelectionHandler.qml:33 ../app/ui/EditMemoPage.qml:270
1039-#: ../app/ui/EditMemoPage.qml:298 ../app/ui/MainPage.qml:263
1040+#: ../app/mainPage/MultiSelectionHandler.qml:33 ../app/ui/EditMemoPage.qml:267
1041+#: ../app/ui/EditMemoPage.qml:295 ../app/ui/MainPage.qml:263
1042 msgid "Cancel"
1043 msgstr ""
1044
1045@@ -47,7 +47,7 @@
1046
1047 #. TRANSLATORS: This is a custom text for the "enter" key of
1048 #. the on-screen keyboard (max 4 char, so it's not elided)
1049-#: ../app/editPage/ListManager.qml:289 ../app/ui/EditMemoPage.qml:85
1050+#: ../app/editPage/ListManager.qml:289 ../app/ui/EditMemoPage.qml:82
1051 msgid "Next"
1052 msgstr ""
1053
1054@@ -113,79 +113,79 @@
1055 msgid "Add a new memo"
1056 msgstr ""
1057
1058-#: ../app/ui/EditMemoPage.qml:79
1059+#: ../app/ui/EditMemoPage.qml:76
1060 msgid "No title"
1061 msgstr ""
1062
1063-#: ../app/ui/EditMemoPage.qml:93
1064+#: ../app/ui/EditMemoPage.qml:90
1065 msgid "No description"
1066 msgstr ""
1067
1068-#: ../app/ui/EditMemoPage.qml:114
1069+#: ../app/ui/EditMemoPage.qml:111
1070 #, qt-format
1071 msgid "Last update: %1"
1072 msgstr ""
1073
1074-#: ../app/ui/EditMemoPage.qml:193
1075+#: ../app/ui/EditMemoPage.qml:190
1076 msgid "Memo saved!"
1077 msgstr ""
1078
1079-#: ../app/ui/EditMemoPage.qml:199
1080+#: ../app/ui/EditMemoPage.qml:196
1081 msgid "Save"
1082 msgstr ""
1083
1084-#: ../app/ui/EditMemoPage.qml:208 ../app/ui/EditMemoPage.qml:266
1085+#: ../app/ui/EditMemoPage.qml:205 ../app/ui/EditMemoPage.qml:263
1086 #: ../app/ui/MainPage.qml:220 ../app/ui/MainPage.qml:259
1087 msgid "Delete memo"
1088 msgid_plural "Delete memos"
1089 msgstr[0] ""
1090 msgstr[1] ""
1091
1092-#: ../app/ui/EditMemoPage.qml:215 ../app/ui/MainPage.qml:213
1093+#: ../app/ui/EditMemoPage.qml:212 ../app/ui/MainPage.qml:213
1094 msgid "Change memo color"
1095 msgstr ""
1096
1097-#: ../app/ui/EditMemoPage.qml:240 ../app/ui/MainPage.qml:248
1098+#: ../app/ui/EditMemoPage.qml:237 ../app/ui/MainPage.qml:248
1099 msgid "Memo updated!"
1100 msgid_plural "Memos updated!"
1101 msgstr[0] ""
1102 msgstr[1] ""
1103
1104-#: ../app/ui/EditMemoPage.qml:255
1105+#: ../app/ui/EditMemoPage.qml:252
1106 msgid "Memo aborted!"
1107 msgstr ""
1108
1109-#: ../app/ui/EditMemoPage.qml:266
1110+#: ../app/ui/EditMemoPage.qml:263
1111 msgid "Empty memo"
1112 msgstr ""
1113
1114-#: ../app/ui/EditMemoPage.qml:267
1115+#: ../app/ui/EditMemoPage.qml:264
1116 msgid "This memo has no content."
1117 msgstr ""
1118
1119-#: ../app/ui/EditMemoPage.qml:267 ../app/ui/MainPage.qml:260
1120+#: ../app/ui/EditMemoPage.qml:264 ../app/ui/MainPage.qml:260
1121 msgid "Are you sure?"
1122 msgstr ""
1123
1124-#: ../app/ui/EditMemoPage.qml:276 ../app/ui/MainPage.qml:268
1125+#: ../app/ui/EditMemoPage.qml:273 ../app/ui/MainPage.qml:268
1126 msgid "Delete"
1127 msgstr ""
1128
1129-#: ../app/ui/EditMemoPage.qml:284 ../app/ui/MainPage.qml:275
1130+#: ../app/ui/EditMemoPage.qml:281 ../app/ui/MainPage.qml:275
1131 msgid "Memo deleted!"
1132 msgid_plural "Memos deleted!"
1133 msgstr[0] ""
1134 msgstr[1] ""
1135
1136-#: ../app/ui/EditMemoPage.qml:294
1137+#: ../app/ui/EditMemoPage.qml:291
1138 msgid "Discard changes?"
1139 msgstr ""
1140
1141-#: ../app/ui/EditMemoPage.qml:295
1142+#: ../app/ui/EditMemoPage.qml:292
1143 msgid "Your memo will be PERMANENTLY lost."
1144 msgstr ""
1145
1146-#: ../app/ui/EditMemoPage.qml:303
1147+#: ../app/ui/EditMemoPage.qml:300
1148 msgid "Go back!"
1149 msgstr ""
1150

Subscribers

People subscribed via source and target branches

to all changes: