sync with mobilecomponents 68c6dc9

This fixes spacing around the icon in the left drawer, the stretched-out
icons in the navigation menu, the unnecessary scrolling in the same
menu, and a few other things.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
This commit is contained in:
Sebastian Kügler 2015-11-30 02:35:17 +01:00
parent 6381c2eb2a
commit f8fb9181b2
2 changed files with 25 additions and 5 deletions

View file

@ -84,7 +84,7 @@ OverlayDrawer {
anchors { anchors {
left: parent.left left: parent.left
top: parent.top top: parent.top
margins: Units.smallSpacing margins: Units.smallSpacing * 2
} }
Icon { Icon {
id: headingIcon id: headingIcon
@ -140,6 +140,8 @@ OverlayDrawer {
model: actions model: actions
property int level: 0 property int level: 0
interactive: contentHeight > height
footer: ListItem { footer: ListItem {
visible: level > 0 visible: level > 0
enabled: true enabled: true
@ -149,7 +151,8 @@ OverlayDrawer {
left: parent.left left: parent.left
} }
Icon { Icon {
Layout.maximumWidth: height Layout.minimumWidth: height
Layout.maximumWidth: Layout.minimumWidth
Layout.fillHeight: true Layout.fillHeight: true
source: "go-previous" source: "go-previous"
} }
@ -179,7 +182,8 @@ OverlayDrawer {
text: modelData.text text: modelData.text
} }
Icon { Icon {
Layout.maximumWidth: height Layout.minimumWidth: height
Layout.maximumWidth: Layout.minimumWidth
Layout.fillHeight: true Layout.fillHeight: true
source: "go-next" source: "go-next"
visible: modelData.children != undefined visible: modelData.children != undefined

View file

@ -35,6 +35,15 @@ MouseArea {
minimumX: contextDrawer ? 0 : parent.width/2 - width/2 minimumX: contextDrawer ? 0 : parent.width/2 - width/2
maximumX: globalDrawer ? parent.width : parent.width/2 - width/2 maximumX: globalDrawer ? parent.width : parent.width/2 - width/2
} }
function toggle() {
showAnimation.running = false;
if (transform[0].y < button.height) {
showAnimation.to = button.height;
} else {
showAnimation.to = 0;
}
showAnimation.running = true;
}
transform: Translate {} transform: Translate {}
onReleased: { onReleased: {
@ -88,6 +97,13 @@ MouseArea {
} }
} }
NumberAnimation {
id: showAnimation
target: button.transform[0]
properties: "y"
duration: Units.longDuration
easing.type: Easing.InOutQuad
}
Item { Item {
id: background id: background
anchors { anchors {
@ -140,8 +156,8 @@ MouseArea {
DropShadow { DropShadow {
anchors.fill: background anchors.fill: background
horizontalOffset: 0 horizontalOffset: 0
verticalOffset: Units.smallSpacing/2 verticalOffset: Units.smallSpacing/3
radius: Units.gridUnit / 2.4 radius: Units.gridUnit / 3.5
samples: 16 samples: 16
color: button.pressed ? "transparent" : Qt.rgba(0, 0, 0, 0.5) color: button.pressed ? "transparent" : Qt.rgba(0, 0, 0, 0.5)
source: background source: background