Commit bb3225d4 authored by Marco Martin's avatar Marco Martin
Browse files

bigger hit area for the up arrow

parent 349de2f2
......@@ -155,7 +155,7 @@ Item {
color: "black"
opacity: 0.4 * Math.min(1, mainFlickable.contentY / (units.gridUnit * 10))
height: root.height + radius * 2
y: Math.max(-radius, -mainFlickable.contentY + arrowUpIcon.y - units.smallSpacing)
y: Math.max(-radius, -mainFlickable.contentY + arrowUpIcon.y)
}
Flickable {
......@@ -253,56 +253,57 @@ Item {
imagePath: "widgets/arrows"
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
}
Item {
MouseArea {
id: arrowUpIcon
z: 9
anchors {
horizontalCenter: parent.horizontalCenter
left: parent.left
right: parent.right
bottom: parent.bottom
margins: -units.smallSpacing
}
width: units.iconSizes.medium
height: width
property real factor: Math.max(0, Math.min(1, mainFlickable.contentY / (mainFlickable.height/2)))
Rectangle {
anchors {
verticalCenter: parent.verticalCenter
right: parent.horizontalCenter
left: parent.left
verticalCenterOffset: -arrowUpIcon.height/4 + (arrowUpIcon.height/4) * arrowUpIcon.factor
}
color: theme.backgroundColor
transformOrigin: Item.Right
rotation: -45 + 90 * parent.factor
antialiasing: true
height: 1
}
Rectangle {
anchors {
verticalCenter: parent.verticalCenter
left: parent.horizontalCenter
right: parent.right
verticalCenterOffset: -arrowUpIcon.height/4 + (arrowUpIcon.height/4) * arrowUpIcon.factor
height: units.iconSizes.medium
onClicked: {
if (mainFlickable.contentY >= mainFlickable.height/2) {
scrollAnim.to = 0;
} else {
scrollAnim.to = mainFlickable.height/2
}
color: theme.backgroundColor
transformOrigin: Item.Left
rotation: 45 - 90 * parent.factor
antialiasing: true
height: 1
scrollAnim.restart();
}
MouseArea {
anchors {
fill: parent
margins: -units.smallSpacing
Item {
anchors.centerIn: parent
width: units.iconSizes.medium
height: width
Rectangle {
anchors {
verticalCenter: parent.verticalCenter
right: parent.horizontalCenter
left: parent.left
verticalCenterOffset: -arrowUpIcon.height/4 + (arrowUpIcon.height/4) * arrowUpIcon.factor
}
color: theme.backgroundColor
transformOrigin: Item.Right
rotation: -45 + 90 * arrowUpIcon.factor
antialiasing: true
height: 1
}
onClicked: {
if (mainFlickable.contentY >= mainFlickable.height/2) {
scrollAnim.to = 0;
} else {
scrollAnim.to = mainFlickable.height/2
Rectangle {
anchors {
verticalCenter: parent.verticalCenter
left: parent.horizontalCenter
right: parent.right
verticalCenterOffset: -arrowUpIcon.height/4 + (arrowUpIcon.height/4) * arrowUpIcon.factor
}
scrollAnim.restart();
color: theme.backgroundColor
transformOrigin: Item.Left
rotation: 45 - 90 * arrowUpIcon.factor
antialiasing: true
height: 1
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment