Merge pull request #12097 from vladest/tablet_pagination_magnify

Tablet pagination magnify
This commit is contained in:
Seth Alves 2018-01-09 08:08:02 -08:00 committed by GitHub
commit 87dfe0efc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,9 +127,15 @@ Item {
GridView {
id: gridView
keyNavigationEnabled: false
highlightFollowsCurrentItem: false
property int previousGridIndex: -1
// true if any of the buttons contains mouse
property bool containsMouse: false
anchors {
fill: parent
topMargin: 20
@ -162,15 +168,29 @@ Item {
flow: GridView.LeftToRight
model: page.proxyModel
delegate: Item {
delegate: Control {
id: wrapper
width: gridView.cellWidth
height: gridView.cellHeight
hoverEnabled: true
property bool containsMouse: gridView.containsMouse
onHoveredChanged: {
if (hovered && !gridView.containsMouse) {
gridView.containsMouse = true
} else {
gridView.containsMouse = false
}
}
property var proxy: modelData
TabletButton {
id: tabletButton
scale: wrapper.hovered ? 1.25 : wrapper.containsMouse ? 0.75 : 1.0
Behavior on scale { NumberAnimation { duration: 200; easing.type: Easing.Linear } }
anchors.centerIn: parent
gridView: wrapper.GridView.view
buttonIndex: page.proxyModel.buttonIndex(uuid);