on xenial help sign in
Hide the categoryView if it's out of view

And a few changes so that height of items do not change depending if their parent is visible or not

commit140f13fad8349fbed3deb74502df3aa2602190f4 authorAlbert Astals <albert.astals@canonical.com> dateFri 22 Aug 2014, 12:35 (12 years ago) parenta8c6760
5 files changed+15−8
plugins/Dash/CardCreator.js+2−2 qml/Dash/DashNavigation.qml+2−2 qml/Dash/GenericScopeView.qml+4−2 qml/Dash/PageHeader.qml+3−2 tests/qmltests/Dash/tst_GenericScopeView.qml+4
plugins/Dash/CardCreator.js+2−2
@@ -78,8 +78,8 @@ var kArtShapeHolderCode = 'Item { \n\
7878 width = root.fixedArtShapeSize.width; \n\
7979 height = root.fixedArtShapeSize.height; \n\
8080 } else { \n\
81− width = Qt.binding(function() { return !visible ? 0 : image.width }); \n\
82− height = Qt.binding(function() { return !visible ? 0 : image.height }); \n\
81+ width = Qt.binding(function() { return image.status != Image.Ready ? 0 : image.width }); \n\
82+ height = Qt.binding(function() { return image.status != Image.Ready ? 0 : image.height }); \n\
8383 } \n\
8484 } \n\
8585 image: Image { \n\
qml/Dash/DashNavigation.qml+2−2
@@ -34,9 +34,9 @@ AbstractButton {
3434 // Are we drilling down the tree or up?
3535 property bool isGoingBack: false
3636
37− visible: root.currentNavigation != null
37+ visible: height != 0
3838
39− height: visible ? units.gu(5) : 0
39+ height: root.currentNavigation != null ? units.gu(5) : 0
4040
4141 onClicked: {
4242 navigationListView.updateMaxHeight();
qml/Dash/GenericScopeView.qml+4−2
@@ -142,6 +142,7 @@ FocusScope {
142142 objectName: "categoryListView"
143143
144144 x: previewListView.open ? -width : 0
145+ visible: x != -width
145146 Behavior on x { UbuntuNumberAnimation { } }
146147 width: parent.width
147148 height: parent.height
@@ -346,7 +347,7 @@ FocusScope {
346347 left: parent.left
347348 right: parent.right
348349 }
349− height: seeAllLabel.visible ? seeAllLabel.font.pixelSize + units.gu(6) : 0
350+ height: seeAllLabel.doShow ? seeAllLabel.font.pixelSize + units.gu(6) : 0
350351
351352 onClicked: {
352353 if (categoryView.expandedCategoryId != baseItem.category) {
@@ -366,7 +367,8 @@ FocusScope {
366367 fontSize: "small"
367368 font.weight: Font.Bold
368369 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
370372 }
371373 }
372374
qml/Dash/PageHeader.qml+3−2
@@ -25,7 +25,7 @@ import "../Components/SearchHistoryModel"
2525Item {
2626 id: root
2727 objectName: "pageHeader"
28− implicitHeight: headerContainer.height + bottomContainer.height + (showSignatureLine ? units.gu(2) : 0)
28+ implicitHeight: headerContainer.height + bottomContainer.height + (showSignatureLine ? units.gu(2) : 0);
2929
3030 property bool showBackButton: false
3131 property string title
@@ -34,7 +34,7 @@ Item {
3434 property ListModel searchHistory: SearchHistoryModel
3535 property alias searchQuery: searchTextField.text
3636 property alias searchHint: searchTextField.placeholderText
37− property alias showSignatureLine: bottomBorder.visible
37+ property bool showSignatureLine: true
3838
3939 property alias bottomItem: bottomContainer.children
4040 property int paginationCount: 0
@@ -346,6 +346,7 @@ Item {
346346
347347 BorderImage {
348348 id: bottomBorder
349+ visible: showSignatureLine
349350 anchors {
350351 top: headerContainer.bottom
351352 left: parent.left
tests/qmltests/Dash/tst_GenericScopeView.qml+4
@@ -274,6 +274,7 @@ Item {
274274 mouseClick(tile, tile.width / 2, tile.height / 2);
275275 tryCompare(testCase.previewListView, "open", true);
276276 tryCompare(testCase.previewListView, "x", 0);
277+ tryCompare(findChild(genericScopeView, "categoryListView"), "visible", false);
277278 }
278279
279280 function closePreview() {
@@ -281,6 +282,9 @@ Item {
281282 mouseClick(closePreviewMouseArea, units.gu(2), units.gu(2));
282283
283284 tryCompare(testCase.previewListView, "open", false);
285+ var categoryListView = findChild(genericScopeView, "categoryListView");
286+ tryCompare(categoryListView, "visible", true);
287+ tryCompare(categoryListView, "x", 0);
284288 }
285289
286290 function test_previewOpenClose() {