on xenial help sign in
Make the categoryView invisible when we are in the preview mode
257d67aAlbert 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−3
@@ -37,9 +37,8 @@ Item {
37 // FIXME this is only here for highlight purposes (see Background.qml, too)
37 // FIXME this is only here for highlight purposes (see Background.qml, too)
38 readonly property var background: backgroundItem
38 readonly property var background: backgroundItem
39
39
40+ visible: height != 0
40− visible: navigationButton.currentNavigation || altNavigationButton.currentNavigation
41+ height: navigationButton.currentNavigation || altNavigationButton.currentNavigation ? units.gu(5) : 0
41−
42− height: visible ? units.gu(5) : 0
43
42
44 QtObject {
43 QtObject {
45 id: d
44 id: d
qml/Dash/GenericScopeView.qml+3−2
@@ -146,6 +146,7 @@ FocusScope {
146 objectName: "categoryListView"
146 objectName: "categoryListView"
147
147
148 x: subPageLoader.open ? -width : 0
148 x: subPageLoader.open ? -width : 0
149+ visible: x != -width
149 Behavior on x { UbuntuNumberAnimation { } }
150 Behavior on x { UbuntuNumberAnimation { } }
150 width: parent.width
151 width: parent.width
151 height: floatingSeeLess.visible ? parent.height - floatingSeeLess.height + floatingSeeLess.yOffset
152 height: floatingSeeLess.visible ? parent.height - floatingSeeLess.height + floatingSeeLess.yOffset
@@ -389,7 +390,8 @@ FocusScope {
389 left: parent.left
390 left: parent.left
390 right: parent.right
391 right: parent.right
391 }
392 }
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
393
395
394 onClicked: {
396 onClicked: {
395 if (categoryView.expandedCategoryId !== baseItem.category) {
397 if (categoryView.expandedCategoryId !== baseItem.category) {
@@ -410,7 +412,6 @@ FocusScope {
410 fontSize: "small"
412 fontSize: "small"
411 font.weight: Font.Bold
413 font.weight: Font.Bold
412 color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
414 color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
413− visible: baseItem.expandable && !baseItem.headerLink
414 }
415 }
415 }
416 }
416
417
qml/Dash/PageHeader.qml+2−1
@@ -37,7 +37,7 @@ Item {
37 property ListModel searchHistory: SearchHistoryModel
37 property ListModel searchHistory: SearchHistoryModel
38 property alias searchQuery: searchTextField.text
38 property alias searchQuery: searchTextField.text
39 property alias searchHint: searchTextField.placeholderText
39 property alias searchHint: searchTextField.placeholderText
40− property alias showSignatureLine: bottomBorder.visible
40+ property bool showSignatureLine: true
41
41
42 property alias bottomItem: bottomContainer.children
42 property alias bottomItem: bottomContainer.children
43 property int paginationCount: 0
43 property int paginationCount: 0
@@ -346,6 +346,7 @@ Item {
346
346
347 Rectangle {
347 Rectangle {
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/plugins/Dash/cardcreator/1.res+2−2
@@ -40,8 +40,8 @@ Item {
40 width = root.fixedArtShapeSize.width;
40 width = root.fixedArtShapeSize.width;
41 height = root.fixedArtShapeSize.height;
41 height = root.fixedArtShapeSize.height;
42 } else {
42 } else {
43− width = Qt.binding(function() { return !visible ? 0 : image.width });
43+ width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
44− height = Qt.binding(function() { return !visible ? 0 : image.height });
44+ height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
45 }
45 }
46 }
46 }
47 image: Image {
47 image: Image {
tests/plugins/Dash/cardcreator/3.res+3−3
@@ -40,9 +40,9 @@ Item {
40 width = root.fixedArtShapeSize.width;
40 width = root.fixedArtShapeSize.width;
41 height = root.fixedArtShapeSize.height;
41 height = root.fixedArtShapeSize.height;
42 } else {
42 } else {
43− width = Qt.binding(function() { return !visible ? 0 : image.width });
43+ width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
44− height = Qt.binding(function() { return !visible ? 0 : image.height });
44+ height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
45− }
45+ }
46 }
46 }
47 image: Image {
47 image: Image {
48 objectName: "artImage";
48 objectName: "artImage";
tests/plugins/Dash/cardcreator/5.res+3−3
@@ -40,9 +40,9 @@ Item {
40 width = root.fixedArtShapeSize.width;
40 width = root.fixedArtShapeSize.width;
41 height = root.fixedArtShapeSize.height;
41 height = root.fixedArtShapeSize.height;
42 } else {
42 } else {
43− width = Qt.binding(function() { return !visible ? 0 : image.width });
43+ width = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.width });
44− height = Qt.binding(function() { return !visible ? 0 : image.height });
44+ height = Qt.binding(function() { return image.status !== Image.Ready ? 0 : image.height });
45− }
45+ }
46 }
46 }
47 image: Image {
47 image: Image {
48 objectName: "artImage";
48 objectName: "artImage";
tests/qmltests/Dash/tst_GenericScopeView.qml+4
@@ -295,6 +295,7 @@ Item {
295 mouseClick(tile, tile.width / 2, tile.height / 2);
295 mouseClick(tile, tile.width / 2, tile.height / 2);
296 tryCompare(testCase.subPageLoader, "open", true);
296 tryCompare(testCase.subPageLoader, "open", true);
297 tryCompare(testCase.subPageLoader, "x", 0);
297 tryCompare(testCase.subPageLoader, "x", 0);
298+ tryCompare(findChild(genericScopeView, "categoryListView"), "visible", false);
298 }
299 }
299
300
300 function closePreview() {
301 function closePreview() {
@@ -303,6 +304,9 @@ Item {
303
304
304 tryCompare(testCase.subPageLoader, "open", false);
305 tryCompare(testCase.subPageLoader, "open", false);
305 tryCompare(testCase.subPageLoader, "visible", false);
306 tryCompare(testCase.subPageLoader, "visible", false);
307+ var categoryListView = findChild(genericScopeView, "categoryListView");
308+ tryCompare(categoryListView, "visible", true);
309+ tryCompare(categoryListView, "x", 0);
306 }
310 }
307
311
308 function test_previewOpenClose() {
312 function test_previewOpenClose() {