on xenial help sign in
Make the categoryView invisible when we are in the preview mode

Fixes: 1341205 Approved by: Andrea Cimitan

commit257d67ac12eb8a03c70f6314d709441ae4c1ef22 authorAlbert Astals <albert.astals@canonical.com> dateThu 18 Sep 2014, 21:23 (12 years ago) parentacb665311ab9d9
8 files changed+21−16
plugins/Dash/CardCreator.js+2−2 qml/Dash/DashNavigation.qml+2−3 qml/Dash/GenericScopeView.qml+3−2 qml/Dash/PageHeader.qml+2−1 tests/plugins/Dash/cardcreator/1.res+2−2 tests/plugins/Dash/cardcreator/3.res+3−3 tests/plugins/Dash/cardcreator/5.res+3−3 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−3
@@ -37,9 +37,8 @@ Item {
3737 // FIXME this is only here for highlight purposes (see Background.qml, too)
3838 readonly property var background: backgroundItem
3939
40− visible: navigationButton.currentNavigation || altNavigationButton.currentNavigation
41−
42− height: visible ? units.gu(5) : 0
40+ visible: height != 0
41+ height: navigationButton.currentNavigation || altNavigationButton.currentNavigation ? units.gu(5) : 0
4342
4443 QtObject {
4544 id: d
qml/Dash/GenericScopeView.qml+3−2
@@ -146,6 +146,7 @@ FocusScope {
146146 objectName: "categoryListView"
147147
148148 x: subPageLoader.open ? -width : 0
149+ visible: x != -width
149150 Behavior on x { UbuntuNumberAnimation { } }
150151 width: parent.width
151152 height: floatingSeeLess.visible ? parent.height - floatingSeeLess.height + floatingSeeLess.yOffset
@@ -389,7 +390,8 @@ FocusScope {
389390 left: parent.left
390391 right: parent.right
391392 }
392− height: seeAllLabel.visible ? seeAllLabel.font.pixelSize + units.gu(4) : 0
393+ height: baseItem.expandable && !baseItem.headerLink ? seeAllLabel.font.pixelSize + units.gu(4) : 0
394+ visible: height != 0
393395
394396 onClicked: {
395397 if (categoryView.expandedCategoryId !== baseItem.category) {
@@ -410,7 +412,6 @@ FocusScope {
410412 fontSize: "small"
411413 font.weight: Font.Bold
412414 color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
413− visible: baseItem.expandable && !baseItem.headerLink
414415 }
415416 }
416417
qml/Dash/PageHeader.qml+2−1
@@ -37,7 +37,7 @@ Item {
3737 property ListModel searchHistory: SearchHistoryModel
3838 property alias searchQuery: searchTextField.text
3939 property alias searchHint: searchTextField.placeholderText
40− property alias showSignatureLine: bottomBorder.visible
40+ property bool showSignatureLine: true
4141
4242 property alias bottomItem: bottomContainer.children
4343 property int paginationCount: 0
@@ -346,6 +346,7 @@ Item {
346346
347347 Rectangle {
348348 id: bottomBorder
349+ visible: showSignatureLine
349350 anchors {
350351 top: headerContainer.bottom
351352 left: parent.left
tests/plugins/Dash/cardcreator/1.res+2−2
@@ -40,8 +40,8 @@ Item {
4040 width = root.fixedArtShapeSize.width;
4141 height = root.fixedArtShapeSize.height;
4242 } else {
43− width = Qt.binding(function() { return !visible ? 0 : image.width });
44− height = Qt.binding(function() { return !visible ? 0 : image.height });
43+ width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
44+ height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
4545 }
4646 }
4747 image: Image {
tests/plugins/Dash/cardcreator/3.res+3−3
@@ -40,9 +40,9 @@ Item {
4040 width = root.fixedArtShapeSize.width;
4141 height = root.fixedArtShapeSize.height;
4242 } else {
43− width = Qt.binding(function() { return !visible ? 0 : image.width });
44− height = Qt.binding(function() { return !visible ? 0 : image.height });
45− }
43+ width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
44+ height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
45+ }
4646 }
4747 image: Image {
4848 objectName: "artImage";
tests/plugins/Dash/cardcreator/5.res+3−3
@@ -40,9 +40,9 @@ Item {
4040 width = root.fixedArtShapeSize.width;
4141 height = root.fixedArtShapeSize.height;
4242 } else {
43− width = Qt.binding(function() { return !visible ? 0 : image.width });
44− height = Qt.binding(function() { return !visible ? 0 : image.height });
45− }
43+ width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
44+ height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
45+ }
4646 }
4747 image: Image {
4848 objectName: "artImage";
tests/qmltests/Dash/tst_GenericScopeView.qml+4
@@ -295,6 +295,7 @@ Item {
295295 mouseClick(tile, tile.width / 2, tile.height / 2);
296296 tryCompare(testCase.subPageLoader, "open", true);
297297 tryCompare(testCase.subPageLoader, "x", 0);
298+ tryCompare(findChild(genericScopeView, "categoryListView"), "visible", false);
298299 }
299300
300301 function closePreview() {
@@ -303,6 +304,9 @@ Item {
303304
304305 tryCompare(testCase.subPageLoader, "open", false);
305306 tryCompare(testCase.subPageLoader, "visible", false);
307+ var categoryListView = findChild(genericScopeView, "categoryListView");
308+ tryCompare(categoryListView, "visible", true);
309+ tryCompare(categoryListView, "x", 0);
306310 }
307311
308312 function test_previewOpenClose() {