on xenial help sign in
Hide the categoryView if it's out of view
140f13fAlbert Astals
plugins/Dash/CardCreator.js+2−2
@@ -78,8 +78,8 @@ var kArtShapeHolderCode = 'Item { \n\
78 width = root.fixedArtShapeSize.width; \n\
78 width = root.fixedArtShapeSize.width; \n\
79 height = root.fixedArtShapeSize.height; \n\
79 height = root.fixedArtShapeSize.height; \n\
80 } else { \n\
80 } else { \n\
81− width = Qt.binding(function() { return !visible ? 0 : image.width }); \n\
81+ width = Qt.binding(function() { return image.status != Image.Ready ? 0 : image.width }); \n\
82− height = Qt.binding(function() { return !visible ? 0 : image.height }); \n\
82+ height = Qt.binding(function() { return image.status != Image.Ready ? 0 : image.height }); \n\
83 } \n\
83 } \n\
84 } \n\
84 } \n\
85 image: Image { \n\
85 image: Image { \n\
qml/Dash/DashNavigation.qml+2−2
@@ -34,9 +34,9 @@ AbstractButton {
34 // Are we drilling down the tree or up?
34 // Are we drilling down the tree or up?
35 property bool isGoingBack: false
35 property bool isGoingBack: false
36
36
37− visible: root.currentNavigation != null
37+ visible: height != 0
38
38
39− height: visible ? units.gu(5) : 0
39+ height: root.currentNavigation != null ? units.gu(5) : 0
40
40
41 onClicked: {
41 onClicked: {
42 navigationListView.updateMaxHeight();
42 navigationListView.updateMaxHeight();
qml/Dash/GenericScopeView.qml+4−2
@@ -142,6 +142,7 @@ FocusScope {
142 objectName: "categoryListView"
142 objectName: "categoryListView"
143
143
144 x: previewListView.open ? -width : 0
144 x: previewListView.open ? -width : 0
145+ visible: x != -width
145 Behavior on x { UbuntuNumberAnimation { } }
146 Behavior on x { UbuntuNumberAnimation { } }
146 width: parent.width
147 width: parent.width
147 height: parent.height
148 height: parent.height
@@ -346,7 +347,7 @@ FocusScope {
346 left: parent.left
347 left: parent.left
347 right: parent.right
348 right: parent.right
348 }
349 }
349− height: seeAllLabel.visible ? seeAllLabel.font.pixelSize + units.gu(6) : 0
350+ height: seeAllLabel.doShow ? seeAllLabel.font.pixelSize + units.gu(6) : 0
350
351
351 onClicked: {
352 onClicked: {
352 if (categoryView.expandedCategoryId != baseItem.category) {
353 if (categoryView.expandedCategoryId != baseItem.category) {
@@ -366,7 +367,8 @@ FocusScope {
366 fontSize: "small"
367 fontSize: "small"
367 font.weight: Font.Bold
368 font.weight: Font.Bold
368 color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
369 color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
369− visible: baseItem.expandable && !baseItem.headerLink
370+ readonly property bool doShow: baseItem.expandable && !baseItem.headerLink
371+ visible: doShow
370 }
372 }
371 }
373 }
372
374
qml/Dash/PageHeader.qml+3−2
@@ -25,7 +25,7 @@ import "../Components/SearchHistoryModel"
25Item {
25Item {
26 id: root
26 id: root
27 objectName: "pageHeader"
27 objectName: "pageHeader"
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 string title
31 property string title
@@ -34,7 +34,7 @@ Item {
34 property ListModel searchHistory: SearchHistoryModel
34 property ListModel searchHistory: SearchHistoryModel
35 property alias searchQuery: searchTextField.text
35 property alias searchQuery: searchTextField.text
36 property alias searchHint: searchTextField.placeholderText
36 property alias searchHint: searchTextField.placeholderText
37− property alias showSignatureLine: bottomBorder.visible
37+ property bool showSignatureLine: true
38
38
39 property alias bottomItem: bottomContainer.children
39 property alias bottomItem: bottomContainer.children
40 property int paginationCount: 0
40 property int paginationCount: 0
@@ -346,6 +346,7 @@ Item {
346
346
347 BorderImage {
347 BorderImage {
348 id: bottomBorder
348 id: bottomBorder
349+ visible: showSignatureLine
349 anchors {
350 anchors {
350 top: headerContainer.bottom
351 top: headerContainer.bottom
351 left: parent.left
352 left: parent.left
tests/qmltests/Dash/tst_GenericScopeView.qml+4
@@ -274,6 +274,7 @@ Item {
274 mouseClick(tile, tile.width / 2, tile.height / 2);
274 mouseClick(tile, tile.width / 2, tile.height / 2);
275 tryCompare(testCase.previewListView, "open", true);
275 tryCompare(testCase.previewListView, "open", true);
276 tryCompare(testCase.previewListView, "x", 0);
276 tryCompare(testCase.previewListView, "x", 0);
277+ tryCompare(findChild(genericScopeView, "categoryListView"), "visible", false);
277 }
278 }
278
279
279 function closePreview() {
280 function closePreview() {
@@ -281,6 +282,9 @@ Item {
281 mouseClick(closePreviewMouseArea, units.gu(2), units.gu(2));
282 mouseClick(closePreviewMouseArea, units.gu(2), units.gu(2));
282
283
283 tryCompare(testCase.previewListView, "open", false);
284 tryCompare(testCase.previewListView, "open", false);
285+ var categoryListView = findChild(genericScopeView, "categoryListView");
286+ tryCompare(categoryListView, "visible", true);
287+ tryCompare(categoryListView, "x", 0);
284 }
288 }
285
289
286 function test_previewOpenClose() {
290 function test_previewOpenClose() {