@@ -114,7 +114,8 @@ FocusScope {
114114 x: previewListView.open ? -width : 0
115115 Behavior on x { UbuntuNumberAnimation { } }
116116 width: parent.width
117− height: parent.height
117+ height: floatingSeeLess.visible ? parent.height - floatingSeeLess.height : parent.height
118+ clip: height != parent.height
118119
119120 model: scopeView.categories
120121 forceNoClip: previewListView.open
@@ -321,6 +322,7 @@ FocusScope {
321322 onClicked: {
322323 if (categoryView.expandedCategoryId != baseItem.category) {
323324 categoryView.expandedCategoryId = baseItem.category;
325+ floatingSeeLess.companionTo = seeAll;
324326 } else {
325327 categoryView.expandedCategoryId = "";
326328 }
@@ -403,6 +405,54 @@ FocusScope {
403405 }
404406 }
405407
408+ AbstractButton {
409+ id: floatingSeeLess
410+
411+ property var companionTo: null
412+ property bool companionLowerThanSelf: false
413+
414+ objectName: "floatingSeeLess"
415+ anchors {
416+ bottom: parent.bottom
417+ left: categoryView.left
418+ right: categoryView.right
419+ }
420+ height: seeLessLabel.font.pixelSize + units.gu(4)
421+ visible: companionTo && companionLowerThanSelf
422+
423+ onClicked: categoryView.expandedCategoryId = "";
424+
425+ function updateLowerThan() {
426+ var pos = companionTo.mapToItem(floatingSeeLess, 0, 0);
427+ companionLowerThanSelf = pos.y >= 0;
428+ if (!companionLowerThanSelf && categoryView.expandedCategoryId === "") {
429+ companionTo = null;
430+ }
431+ }
432+
433+ Label {
434+ id: seeLessLabel
435+ text: i18n.tr("See less")
436+ anchors {
437+ centerIn: parent
438+ verticalCenterOffset: units.gu(-0.5)
439+ }
440+ fontSize: "small"
441+ font.weight: Font.Bold
442+ color: scopeStyle ? scopeStyle.foreground : "grey"
443+ }
444+
445+ Connections {
446+ target: floatingSeeLess.companionTo ? categoryView : null
447+ onContentYChanged: floatingSeeLess.updateLowerThan();
448+ }
449+
450+ Connections {
451+ target: floatingSeeLess.companionTo ? floatingSeeLess.companionTo : null
452+ onYChanged: floatingSeeLess.updateLowerThan();
453+ }
454+ }
455+
406456 LimitProxyModel {
407457 id: previewLimitModel
408458 }