forked from Shinonome/dots-hyprland
proper anim for action center stackview
This commit is contained in:
@@ -12,7 +12,7 @@ import qs.modules.waffle.actionCenter.mainPage
|
|||||||
WBarAttachedPanelContent {
|
WBarAttachedPanelContent {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
contentItem: StackView { // TODO: Make this a WStackView with proper anim
|
contentItem: WStackView {
|
||||||
id: stackView
|
id: stackView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
implicitWidth: initItem.implicitWidth
|
implicitWidth: initItem.implicitWidth
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ Singleton {
|
|||||||
|
|
||||||
function push(component) {
|
function push(component) {
|
||||||
if (stackView) {
|
if (stackView) {
|
||||||
item = stackView.push(component)
|
stackView.push(component)
|
||||||
stackView.implicitWidth = item.implicitWidth
|
|
||||||
stackView.implicitHeight = item.implicitHeight
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import qs.modules.common.widgets
|
|||||||
import qs.modules.waffle.looks
|
import qs.modules.waffle.looks
|
||||||
import qs.modules.waffle.actionCenter
|
import qs.modules.waffle.actionCenter
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
implicitWidth: 360
|
implicitWidth: 360
|
||||||
implicitHeight: 352
|
implicitHeight: 352
|
||||||
|
|||||||
@@ -78,9 +78,8 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
id: contentArea
|
id: contentArea
|
||||||
color: "red"
|
|
||||||
z: 0
|
z: 0
|
||||||
anchors.fill: borderRect
|
anchors.fill: borderRect
|
||||||
anchors.margins: borderRect.border.width
|
anchors.margins: borderRect.border.width
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import qs.modules.waffle.looks
|
||||||
|
|
||||||
|
StackView {
|
||||||
|
id: root
|
||||||
|
property real moveDistance: 20
|
||||||
|
property int pushDuration: 100
|
||||||
|
property list<real> bezierCurve: Looks.transition.easing.bezierCurve.easeIn
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
property alias color: background.color
|
||||||
|
background: Rectangle {
|
||||||
|
id: background
|
||||||
|
color: Looks.colors.bgPanelBody
|
||||||
|
}
|
||||||
|
|
||||||
|
pushEnter: Transition {
|
||||||
|
XAnimator {
|
||||||
|
from: -root.moveDistance
|
||||||
|
to: 0
|
||||||
|
duration: root.pushDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.bezierCurve
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "opacity"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
duration: root.pushDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.bezierCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pushExit: Transition {
|
||||||
|
XAnimator {
|
||||||
|
from: 0
|
||||||
|
to: root.moveDistance
|
||||||
|
duration: root.pushDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.bezierCurve
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "opacity"
|
||||||
|
from: 1
|
||||||
|
to: 0
|
||||||
|
duration: root.pushDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.bezierCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
popEnter: Transition {
|
||||||
|
XAnimator {
|
||||||
|
from: root.moveDistance
|
||||||
|
to: 0
|
||||||
|
duration: root.pushDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.bezierCurve
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "opacity"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
duration: root.pushDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.bezierCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
popExit: Transition {
|
||||||
|
XAnimator {
|
||||||
|
from: 0
|
||||||
|
to: -root.moveDistance
|
||||||
|
duration: root.pushDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.bezierCurve
|
||||||
|
}
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "opacity"
|
||||||
|
from: 1
|
||||||
|
to: 0
|
||||||
|
duration: root.pushDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.bezierCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user