on xenial help sign in
Small fixlets
2abfc99Albert Astals
qml/Dash/ScopesList.qml+1
@@ -87,6 +87,7 @@ Item {
87 clip: true
87 clip: true
88 contentWidth: root.width
88 contentWidth: root.width
89 contentHeight: column.height
89 contentHeight: column.height
90+ onContentHeightChanged: returnToBounds();
90 Column {
91 Column {
91 id: column
92 id: column
92 Repeater {
93 Repeater {
qml/Dash/ScopesListCategory.qml+14−14
@@ -35,7 +35,7 @@ Item {
35 signal requestScopeMoveTo(string scopeId, int index)
35 signal requestScopeMoveTo(string scopeId, int index)
36 signal requestActivate(var result)
36 signal requestActivate(var result)
37
37
38− implicitHeight: childrenRect.height
38+ implicitHeight: visible ? childrenRect.height : 0
39
39
40 ListItems.Header {
40 ListItems.Header {
41 id: header
41 id: header
@@ -88,14 +88,19 @@ Item {
88 root.requestActivate(result);
88 root.requestActivate(result);
89 }
89 }
90 }
90 }
91+ onPressAndHold: {
92+ if (!editMode) {
93+ root.requestEditMode();
94+ }
95+ }
91 onRequestFavorite: root.requestFavorite(model.scopeId, favorite);
96 onRequestFavorite: root.requestFavorite(model.scopeId, favorite);
92− onPressed: {
97+ onHandlePressed: {
93 if (editMode) {
98 if (editMode) {
94− drag.target = dragItem;
99+ handle.drag.target = dragItem;
95− drag.maximumX = units.gu(1);
100+ handle.drag.maximumX = units.gu(1);
96− drag.minimumX = units.gu(1);
101+ handle.drag.minimumX = units.gu(1);
97− drag.minimumY = list.y - dragItem.height / 2;
102+ handle.drag.minimumY = list.y - dragItem.height / 2;
98− drag.maximumY = list.y + list.height - dragItem.height / 2
103+ handle.drag.maximumY = list.y + list.height - dragItem.height / 2
99 dragItem.icon = icon;
104 dragItem.icon = icon;
100 dragItem.text = text;
105 dragItem.text = text;
101 dragItem.subtext = subtext;
106 dragItem.subtext = subtext;
@@ -106,14 +111,9 @@ Item {
106 dragItem.loaderToShrink = loader;
111 dragItem.loaderToShrink = loader;
107 }
112 }
108 }
113 }
109− onPressAndHold: {
114+ onHandleReleased: {
110− if (!editMode) {
111− root.requestEditMode();
112− }
113− }
114− onReleased: {
115 if (dragItem.visible) {
115 if (dragItem.visible) {
116− drag.target = undefined;
116+ handle.drag.target = undefined;
117 dragItem.visible = false;
117 dragItem.visible = false;
118 if (dragMarker.visible && dragMarker.index != index) {
118 if (dragMarker.visible && dragMarker.index != index) {
119 root.requestScopeMoveTo(model.scopeId, dragMarker.index);
119 root.requestScopeMoveTo(model.scopeId, dragMarker.index);
qml/Dash/ScopesListCategoryItem.qml+8−3
@@ -19,7 +19,11 @@ import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.1
19import Ubuntu.Components 1.1
20
20
21MouseArea {
21MouseArea {
22+ id: root
23+
22 signal requestFavorite(string scopeId, bool favorite)
24 signal requestFavorite(string scopeId, bool favorite)
25+ signal handlePressed(var handle)
26+ signal handleReleased(var handle)
23
27
24 property alias icon: shapeImage.source
28 property alias icon: shapeImage.source
25 property alias text: titleLabel.text
29 property alias text: titleLabel.text
@@ -77,14 +81,15 @@ MouseArea {
77 height: parent.height
81 height: parent.height
78 width: height
82 width: height
79 anchors.right: parent.right
83 anchors.right: parent.right
80− enabled: !editMode
81− visible: !hideChildren
82− onClicked: root.requestFavorite(model.scopeId, !isFavorite);
84+ onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);
85+ onPressed: if (editMode) root.handlePressed(starArea);
86+ onReleased: if (editMode) root.handleReleased(starArea);
83 Icon {
87 Icon {
84 id: star
88 id: star
85 anchors.centerIn: parent
89 anchors.centerIn: parent
86 height: units.gu(2)
90 height: units.gu(2)
87 width: units.gu(2)
91 width: units.gu(2)
92+ visible: !hideChildren
88 // TODO is view-grid-symbolic what we really want here? Looks good but seems semantically wrong
93 // TODO is view-grid-symbolic what we really want here? Looks good but seems semantically wrong
89 source: editMode ? "image://theme/view-grid-symbolic" : isFavorite ? "image://theme/starred" : "image://theme/non-starred"
94 source: editMode ? "image://theme/view-grid-symbolic" : isFavorite ? "image://theme/starred" : "image://theme/non-starred"
90 }
95 }