on xenial help sign in
clicking on scope opens it
commit82b74fc860591d9c3407a648d3c07712fd5b0a7e authorAlbert Astals <albert.astals@canonical.com> dateFri 26 Sep 2014, 15:54 (12 years ago) parent75b7da2
3 files changed+31−17
qml/Dash/Dash.qml+21−5 qml/Dash/ScopesList.qml+6−9 qml/Dash/ScopesListCategory.qml+4−3
qml/Dash/Dash.qml+21−5
@@ -96,8 +96,6 @@ Showable {
9696 DashContent {
9797 id: dashContent
9898
99− property var scopeThatOpenedScope: null
100−
10199 objectName: "dashContent"
102100 width: dash.width
103101 height: dash.height
@@ -107,7 +105,7 @@ Showable {
107105 dash.setCurrentScope(scopeId, true, false);
108106 }
109107 onOpenScope: {
110− scopeThatOpenedScope = currentScope;
108+ scopeItem.scopeThatOpenedScope = currentScope;
111109 scopeItem.scope = scope;
112110 x = -width;
113111 }
@@ -124,7 +122,7 @@ Showable {
124122 duration: bottomEdgeController.progress != 0 ? 0 : UbuntuAnimation.FastDuration
125123 onRunningChanged: {
126124 if (!running && dashContent.x == 0) {
127− dashContent.scopeThatOpenedScope.closeScope(scopeItem.scope);
125+ scopeItem.scopeThatOpenedScope.closeScope(scopeItem.scope);
128126 scopeItem.scope = null;
129127 }
130128 }
@@ -169,6 +167,22 @@ Showable {
169167 property: "isActive"
170168 value: bottomEdgeController.progress === 1
171169 }
170+
171+ Connections {
172+ target: scopesList.scope
173+ onOpenScope: {
174+ bottomEdgeController.enableAnimation = true;
175+ bottomEdgeController.progress = 0;
176+ scopeItem.scopeThatOpenedScope = scopesList.scope;
177+ scopeItem.scope = scope;
178+ dashContent.x = -dashContent.width;
179+ }
180+ onGotoScope: {
181+ bottomEdgeController.enableAnimation = true;
182+ bottomEdgeController.progress = 0;
183+ dashContent.gotoScope(scopeId);
184+ }
185+ }
172186 }
173187
174188 DashBackground
@@ -184,6 +198,8 @@ Showable {
184198 id: scopeItem
185199 objectName: "dashTempScopeItem"
186200
201+ property var scopeThatOpenedScope: null
202+
187203 x: dashContent.x + width
188204 y: dashContent.y
189205 width: parent.width
@@ -295,7 +311,7 @@ Showable {
295311 enabled: !dashContent.subPageShown &&
296312 dashContent.currentScope &&
297313 dashContent.currentScope.searchQuery == "" &&
298− !scopeItem.subPageShown &&
314+ !scopeItem.scope &&
299315 (bottomEdgeController.progress == 0 || dragging)
300316
301317 readonly property real fullMovement: dash.height
qml/Dash/ScopesList.qml+6−9
@@ -101,20 +101,17 @@ Item {
101101 model: scope ? scope.categories : null
102102
103103 delegate: Loader {
104− source: "ScopesListCategory.qml";
105104 asynchronous: true
106105 width: root.width
107− onLoaded: {
108− item.isFavoriteFeeds = index == 0;
109− item.scopeStyle = scopeStyle;
110− item.model = Qt.binding(function() { return results });
111− item.editMode = Qt.binding(function() { return root.state == "edit" });
112− }
113− Connections {
114− target: item
106+ sourceComponent: ScopesListCategory {
107+ scopeStyle: scopeStyle;
108+ model: results
109+ editMode: root.state == "edit"
110+
115111 onRequestFavorite: root.requestFavorite(scopeId, favorite);
116112 onRequestEditMode: root.state = "edit";
117113 onRequestScopeMoveTo: root.requestFavoriteMoveTo(scopeId, index);
114+ onRequestActivate: root.scope.activate(result);
118115 }
119116 }
120117 }
qml/Dash/ScopesListCategory.qml+4−3
@@ -24,14 +24,14 @@ Item {
2424
2525 property alias model: list.model
2626 property var scopeStyle
27− property bool isFavoriteFeeds: false
2827 property bool editMode: false
2928
30− visible: !editMode || isFavoriteFeeds
29+ visible: !editMode || categoryId == "favorites"
3130
3231 signal requestFavorite(string scopeId, bool favorite)
3332 signal requestEditMode()
3433 signal requestScopeMoveTo(string scopeId, int index)
34+ signal requestActivate(var result)
3535
3636 implicitHeight: childrenRect.height
3737
@@ -76,8 +76,9 @@ Item {
7676
7777 icon: model.art || ""
7878 text: model.title || ""
79− showStar: model.scopeId != "clickscope"
79+ showStar: model.scopeId != "clickscope" && (categoryId == "favorites" || categoryId == "other")
8080
81+ onClicked: root.requestActivate(result);
8182 onRequestFavorite: root.requestFavorite(model.scopeId, favorite);
8283 onPressAndHold: {
8384 if (!editMode) {