@@ -114,7 +114,7 @@ FocusScope {
114 x: previewListView.open ? -width : 0
114 x: previewListView.open ? -width : 0
115 Behavior on x { UbuntuNumberAnimation { } }
115 Behavior on x { UbuntuNumberAnimation { } }
116 width: parent.width
116 width: parent.width
117− height: floatingSeeLess.visible ? parent.height - floatingSeeLess.height : parent.height
117+ height: floatingSeeLess.visible ? parent.height - floatingSeeLess.height + floatingSeeLess.yOffset : parent.height
118 clip: height != parent.height
118 clip: height != parent.height
120 model: scopeView.categories
120 model: scopeView.categories
@@ -323,6 +323,7 @@ FocusScope {
323 if (categoryView.expandedCategoryId != baseItem.category) {
323 if (categoryView.expandedCategoryId != baseItem.category) {
324 categoryView.expandedCategoryId = baseItem.category;
324 categoryView.expandedCategoryId = baseItem.category;
325 floatingSeeLess.companionTo = seeAll;
325 floatingSeeLess.companionTo = seeAll;
326+ floatingSeeLess.companionBase = baseItem;
327 categoryView.expandedCategoryId = "";
328 categoryView.expandedCategoryId = "";
@@ -407,26 +408,34 @@ FocusScope {
408 AbstractButton {
409 AbstractButton {
409 id: floatingSeeLess
410 id: floatingSeeLess
411+ objectName: "floatingSeeLess"
411 property var companionTo: null
413 property var companionTo: null
412− property bool companionLowerThanSelf: false
414+ property var companionBase: null
415+ property bool showBecausePosition: false
416+ property real yOffset: 0
414− objectName: "floatingSeeLess"
415 anchors {
418 anchors {
416− bottom: parent.bottom
417 left: categoryView.left
419 left: categoryView.left
418 right: categoryView.right
420 right: categoryView.right
422+ y: parent.height - height + yOffset
420 height: seeLessLabel.font.pixelSize + units.gu(4)
423 height: seeLessLabel.font.pixelSize + units.gu(4)
421− visible: companionTo && companionLowerThanSelf
424+ visible: companionTo && showBecausePosition
423 onClicked: categoryView.expandedCategoryId = "";
426 onClicked: categoryView.expandedCategoryId = "";
425− function updateLowerThan() {
428+ function updateVisibility() {
426− var pos = companionTo.mapToItem(floatingSeeLess, 0, 0);
429+ var companionPos = companionTo.mapToItem(floatingSeeLess, 0, 0);
427− companionLowerThanSelf = pos.y >= 0;
430+ showBecausePosition = companionPos.y > 0;
432+ var posToBase = floatingSeeLess.mapToItem(companionBase, 0, -yOffset).y;
433+ yOffset = Math.max(0, companionBase.item.collapsedHeight - posToBase);
434+ yOffset = Math.min(yOffset, height);
428− if (!companionLowerThanSelf && categoryView.expandedCategoryId === "") {
436+ if (!showBecausePosition && categoryView.expandedCategoryId === "") {
429 companionTo = null;
437 companionTo = null;
438+ companionBase = false;
@@ -444,12 +453,12 @@ FocusScope {
445 Connections {
454 Connections {
446 target: floatingSeeLess.companionTo ? categoryView : null
455 target: floatingSeeLess.companionTo ? categoryView : null
447− onContentYChanged: floatingSeeLess.updateLowerThan();
456+ onContentYChanged: floatingSeeLess.updateVisibility();
450 Connections {
459 Connections {
451 target: floatingSeeLess.companionTo ? floatingSeeLess.companionTo : null
460 target: floatingSeeLess.companionTo ? floatingSeeLess.companionTo : null
452− onYChanged: floatingSeeLess.updateLowerThan();
461+ onYChanged: floatingSeeLess.updateVisibility();