mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
homescreens/folio: Fix cube effect
This commit is contained in:
parent
6bf87ae843
commit
fa8aa6e85f
1 changed files with 4 additions and 1 deletions
|
|
@ -37,6 +37,7 @@ MouseArea {
|
||||||
// animation so that full opacity is only when the page is in view
|
// animation so that full opacity is only when the page is in view
|
||||||
readonly property real distanceToCenter: Math.abs(-Folio.HomeScreenState.pageViewX - root.width * pageNum)
|
readonly property real distanceToCenter: Math.abs(-Folio.HomeScreenState.pageViewX - root.width * pageNum)
|
||||||
readonly property real positionX: root.width * index + Folio.HomeScreenState.pageViewX
|
readonly property real positionX: root.width * index + Folio.HomeScreenState.pageViewX
|
||||||
|
readonly property real progressToCenter: 1 - Math.min(1, Math.max(0, distanceToCenter / root.width))
|
||||||
|
|
||||||
opacity: 1 - Math.min(1, Math.max(0, distanceToCenter / root.width))
|
opacity: 1 - Math.min(1, Math.max(0, distanceToCenter / root.width))
|
||||||
|
|
||||||
|
|
@ -46,7 +47,9 @@ MouseArea {
|
||||||
x: homeScreenPage.positionX
|
x: homeScreenPage.positionX
|
||||||
},
|
},
|
||||||
Rotation {
|
Rotation {
|
||||||
origin.x: Folio.HomeScreenState.pageWidth / 2;
|
origin.x: (positionX < 0) ?
|
||||||
|
(Folio.HomeScreenState.pageWidth / 2) * homeScreenPage.progressToCenter :
|
||||||
|
(Folio.HomeScreenState.pageWidth / 2) + (Folio.HomeScreenState.pageWidth / 2) * (1 - homeScreenPage.progressToCenter);
|
||||||
origin.y: Folio.HomeScreenState.pageHeight / 2;
|
origin.y: Folio.HomeScreenState.pageHeight / 2;
|
||||||
axis { x: 0; y: 1; z: 0 }
|
axis { x: 0; y: 1; z: 0 }
|
||||||
angle: {
|
angle: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue