on xenial help sign in
Foundations for the edit mode
cf3695cAlbert Astals
qml/Dash/PageHeader.qml+2−1
@@ -28,6 +28,7 @@ Item {
28 implicitHeight: headerContainer.height + bottomContainer.height + (showSignatureLine ? units.gu(2) : 0)
28 implicitHeight: headerContainer.height + bottomContainer.height + (showSignatureLine ? units.gu(2) : 0)
29
29
30 property bool showBackButton: false
30 property bool showBackButton: false
31+ property bool backIsClose: false
31 property string title
32 property string title
32
33
33 property bool storeEntryEnabled: false
34 property bool storeEntryEnabled: false
@@ -249,7 +250,7 @@ Item {
249 property var config: PageHeadConfiguration {
250 property var config: PageHeadConfiguration {
250 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : Theme.palette.normal.baseText
251 foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : Theme.palette.normal.baseText
251 backAction: Action {
252 backAction: Action {
252− iconName: "back"
253+ iconName: backIsClose ? "close" : "back"
253 visible: root.showBackButton
254 visible: root.showBackButton
254 onTriggered: root.backClicked()
255 onTriggered: root.backClicked()
255 }
256 }
qml/Dash/ScopesList.qml+14−3
@@ -31,6 +31,8 @@ Item {
31 signal storeClicked()
31 signal storeClicked()
32 signal requestFavorite(string scopeId, bool favorite)
32 signal requestFavorite(string scopeId, bool favorite)
33
33
34+ state: "browse"
35+
34 ScopeStyle {
36 ScopeStyle {
35 id: scopeStyle
37 id: scopeStyle
36 style: { "foreground-color" : "gray",
38 style: { "foreground-color" : "gray",
@@ -62,9 +64,16 @@ Item {
62 title: i18n.tr("My Feeds")
64 title: i18n.tr("My Feeds")
63 width: parent.width
65 width: parent.width
64 showBackButton: true
66 showBackButton: true
67+ backIsClose: root.state == "edit"
65− storeEntryEnabled: true
68+ storeEntryEnabled: root.state == "browse"
66− searchEntryEnabled: true
69+ searchEntryEnabled: root.state == "browse"
70+ onBackClicked: {
71+ if (backIsClose) {
72+ root.state = "browse"
73+ } else {
67− onBackClicked: root.backClicked()
74+ root.backClicked()
75+ }
76+ }
68 onStoreClicked: root.storeClicked();
77 onStoreClicked: root.storeClicked();
69 }
78 }
70
79
@@ -91,10 +100,12 @@ Item {
91 item.isFavoriteFeeds = index == 0;
100 item.isFavoriteFeeds = index == 0;
92 item.scopeStyle = scopeStyle;
101 item.scopeStyle = scopeStyle;
93 item.model = Qt.binding(function() { return results });
102 item.model = Qt.binding(function() { return results });
103+ item.editMode = Qt.binding(function() { return root.state == "edit" });
94 }
104 }
95 Connections {
105 Connections {
96 target: item
106 target: item
97 onRequestFavorite: root.requestFavorite(scopeId, favorite)
107 onRequestFavorite: root.requestFavorite(scopeId, favorite)
108+ onRequestEditMode: root.state = "edit";
98 }
109 }
99 }
110 }
100 }
111 }
qml/Dash/ScopesListCategory.qml+7−2
@@ -25,8 +25,10 @@ Item {
25 property alias model: list.model
25 property alias model: list.model
26 property var scopeStyle
26 property var scopeStyle
27 property bool isFavoriteFeeds: false
27 property bool isFavoriteFeeds: false
28+ property bool editMode: false
28
29
29 signal requestFavorite(string scopeId, bool favorite)
30 signal requestFavorite(string scopeId, bool favorite)
31+ signal requestEditMode()
30
32
31 implicitHeight: childrenRect.height
33 implicitHeight: childrenRect.height
32
34
@@ -58,7 +60,7 @@ Item {
58 asynchronous: true
60 asynchronous: true
59 width: root.width
61 width: root.width
60 height: units.gu(6)
62 height: units.gu(6)
61− sourceComponent: Item {
63+ sourceComponent: MouseArea {
62 width: root.width
64 width: root.width
63 UbuntuShape {
65 UbuntuShape {
64 id: shape
66 id: shape
@@ -100,12 +102,15 @@ Item {
100 height: units.gu(2)
102 height: units.gu(2)
101 width: units.gu(2)
103 width: units.gu(2)
102 visible: model.scopeId != "clickscope"
104 visible: model.scopeId != "clickscope"
105+ // TODO is view-grid-symbolic what we really want here? Looks good but seems semantically wrong
103− source: isFavoriteFeeds ? "image://theme/starred" : "image://theme/non-starred"
106+ source: editMode ? "image://theme/view-grid-symbolic" : isFavoriteFeeds ? "image://theme/starred" : "image://theme/non-starred"
104 MouseArea {
107 MouseArea {
105 anchors.fill: parent
108 anchors.fill: parent
106 onClicked: root.requestFavorite(model.scopeId, !isFavoriteFeeds);
109 onClicked: root.requestFavorite(model.scopeId, !isFavoriteFeeds);
107 }
110 }
108 }
111 }
112+
113+ onPressAndHold: root.requestEditMode();
109 }
114 }
110 }
115 }
111 }
116 }