fix tablet menu scrolling issue

This commit is contained in:
Faye Li Si Fi 2017-01-17 16:40:12 -08:00
parent c8382e6853
commit 126bfba512
3 changed files with 11 additions and 10 deletions

View file

@ -78,11 +78,8 @@ Item {
hoverEnabled: true
onEntered: breadcrumbText.color = "#1fc6a6";
onExited: breadcrumbText.color = "#ffffff";
// navigate back to parent level menu if there is one
onClicked:
if (breadcrumbText.text !== "Menu") {
menuPopperUpper.closeLastMenu();
}
// navigate back to parent level menu
onClicked: menuPopperUpper.closeLastMenu();
}
}
}

View file

@ -36,14 +36,18 @@ FocusScope {
//color: isSubMenu ? hifi.colors.faintGray : hifi.colors.faintGray80
}
ListView {
id: listView
x: 0
y: 0
width: 480
height: 720
contentWidth: 480
contentHeight: 720
topMargin: hifi.dimensions.menuPadding.y + 90
topMargin: hifi.dimensions.menuPadding.y
bottomMargin: hifi.dimensions.menuPadding.y
onEnabledChanged: recalcSize();
onVisibleChanged: recalcSize();
onCountChanged: recalcSize();
@ -94,12 +98,12 @@ FocusScope {
newHeight += currentItem.implicitHeight
}
}
newHeight += 2 * hifi.dimensions.menuPadding.y; // White space at top and bottom.
newHeight += hifi.dimensions.menuPadding.y * 2; // White space at top and bottom.
if (maxWidth > width) {
width = maxWidth;
}
if (newHeight > height) {
height = newHeight
if (newHeight > contentHeight) {
contentHeight = newHeight;
}
currentIndex = originalIndex;
}

View file

@ -156,7 +156,7 @@ Item {
readonly property real modalDialogTitleHeight: 40
readonly property real controlLineHeight: 28 // Height of spinbox control on 1920 x 1080 monitor
readonly property real controlInterlineHeight: 21 // 75% of controlLineHeight
readonly property vector2d menuPadding: Qt.vector2d(14, 12)
readonly property vector2d menuPadding: Qt.vector2d(14, 102)
readonly property real scrollbarBackgroundWidth: 18
readonly property real scrollbarHandleWidth: scrollbarBackgroundWidth - 2
}