mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:12:53 +02:00
Merge pull request #12097 from vladest/tablet_pagination_magnify
Tablet pagination magnify
This commit is contained in:
commit
87dfe0efc3
1 changed files with 21 additions and 1 deletions
|
@ -127,9 +127,15 @@ Item {
|
||||||
|
|
||||||
GridView {
|
GridView {
|
||||||
id: gridView
|
id: gridView
|
||||||
|
|
||||||
keyNavigationEnabled: false
|
keyNavigationEnabled: false
|
||||||
highlightFollowsCurrentItem: false
|
highlightFollowsCurrentItem: false
|
||||||
|
|
||||||
property int previousGridIndex: -1
|
property int previousGridIndex: -1
|
||||||
|
|
||||||
|
// true if any of the buttons contains mouse
|
||||||
|
property bool containsMouse: false
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
fill: parent
|
||||||
topMargin: 20
|
topMargin: 20
|
||||||
|
@ -162,15 +168,29 @@ Item {
|
||||||
flow: GridView.LeftToRight
|
flow: GridView.LeftToRight
|
||||||
model: page.proxyModel
|
model: page.proxyModel
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Control {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
width: gridView.cellWidth
|
width: gridView.cellWidth
|
||||||
height: gridView.cellHeight
|
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
|
property var proxy: modelData
|
||||||
|
|
||||||
TabletButton {
|
TabletButton {
|
||||||
id: 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
|
anchors.centerIn: parent
|
||||||
gridView: wrapper.GridView.view
|
gridView: wrapper.GridView.view
|
||||||
buttonIndex: page.proxyModel.buttonIndex(uuid);
|
buttonIndex: page.proxyModel.buttonIndex(uuid);
|
||||||
|
|
Loading…
Reference in a new issue