mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-06-11 00:47:22 +00:00
Move Folio gaming surfaces to shared motion
Use Motion tokens for the Game Center overlay, gaming HUD, quick settings drawer, and running-games panel. Keep gaming mode settings and gamepad behavior unchanged.
This commit is contained in:
parent
a37734b74a
commit
88a4f5883b
4 changed files with 20 additions and 12 deletions
|
|
@ -37,6 +37,9 @@ Window {
|
|||
readonly property string rightShoulderLabel: GamingShell.GamepadManager.buttonLabel(GamingShell.GamepadManager.ButtonRightShoulder)
|
||||
readonly property string quickSettingsButtonLabel: GamingShell.GamepadManager.buttonLabel(GamingShell.GamepadManager.ButtonBack)
|
||||
readonly property string searchButtonLabel: GamingShell.GamepadManager.buttonLabel(GamingShell.GamepadManager.ButtonStart)
|
||||
readonly property int shortAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.EffectsFast)
|
||||
readonly property int longAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.EffectsDefault)
|
||||
readonly property int launchFadeDuration: MobileShell.Motion.duration(MobileShell.Motion.StandardAccel)
|
||||
|
||||
function pulsePrimaryGamepad(lowIntensity, highIntensity, durationMs) {
|
||||
var pad = GamingShell.GamepadManager.primaryGamepad
|
||||
|
|
@ -161,7 +164,7 @@ Window {
|
|||
// Animate opacity on show/hide
|
||||
opacity: visible ? 1 : 0
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsDefault; duration: root.longAnimationDuration }
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
|
@ -960,7 +963,7 @@ Window {
|
|||
|
||||
scale: parent.parent.parent.isCurrent ? 1.08 : 1.0
|
||||
Behavior on scale {
|
||||
NumberAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.InOutQuad }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1116,7 +1119,7 @@ Window {
|
|||
z: 100
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 250; easing.type: Easing.InQuad }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.StandardAccel; duration: root.launchFadeDuration }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import QtQuick.Layouts
|
|||
import QtQuick.Window
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||
import org.kde.plasma.private.mobileshell as MobileShell
|
||||
import org.kde.plasma.private.mobileshell.gamingshellplugin as GamingShell
|
||||
import org.kde.layershell 1.0 as LayerShell
|
||||
|
||||
|
|
@ -23,6 +23,8 @@ Window {
|
|||
property string toastMessage: ""
|
||||
property bool toastError: false
|
||||
readonly property bool toastActive: toastMessage.length > 0
|
||||
readonly property int shortAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.EffectsFast)
|
||||
readonly property int longAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.EffectsDefault)
|
||||
|
||||
// Most-recently-played game for quick resume. Populated from recentGames(1)
|
||||
// and refreshed whenever the recent list changes.
|
||||
|
|
@ -39,10 +41,10 @@ Window {
|
|||
flags: Qt.FramelessWindowHint
|
||||
|
||||
Behavior on width {
|
||||
NumberAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration }
|
||||
}
|
||||
Behavior on height {
|
||||
NumberAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration }
|
||||
}
|
||||
|
||||
LayerShell.Window.scope: "gaming-hud"
|
||||
|
|
@ -57,7 +59,7 @@ Window {
|
|||
|
||||
opacity: showing ? 1 : 0
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsDefault; duration: root.longAnimationDuration }
|
||||
}
|
||||
|
||||
Timer {
|
||||
|
|
@ -183,7 +185,7 @@ Window {
|
|||
|
||||
opacity: root.toastActive ? 1.0 : 0.0
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.InOutQuad }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration }
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ Item {
|
|||
color: "black"
|
||||
opacity: root.opened ? 0.4 : 0
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsDefault }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ Item {
|
|||
x: root.opened ? root.width - width : root.width
|
||||
|
||||
Behavior on x {
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.SpatialDefault }
|
||||
}
|
||||
|
||||
Kirigami.Theme.inherit: false
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import QtQuick.Controls as QQC2
|
|||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.plasma.components 3.0 as PC3
|
||||
import org.kde.plasma.private.mobileshell as MobileShell
|
||||
import org.kde.taskmanager as TaskManager
|
||||
|
||||
import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
|
||||
|
|
@ -17,6 +18,8 @@ Item {
|
|||
implicitHeight: taskList.count > 0 ? column.implicitHeight : 0
|
||||
readonly property bool hasTasks: taskList.count > 0
|
||||
readonly property int taskCount: taskList.count
|
||||
readonly property int shortAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.EffectsFast)
|
||||
readonly property int longAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.Standard)
|
||||
|
||||
signal taskActivated()
|
||||
signal moveDownRequested()
|
||||
|
|
@ -59,7 +62,7 @@ Item {
|
|||
}
|
||||
|
||||
Behavior on implicitHeight {
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad }
|
||||
MobileShell.MotionNumberAnimation { type: MobileShell.Motion.Standard; duration: root.longAnimationDuration }
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
|
@ -152,7 +155,7 @@ Item {
|
|||
: Qt.rgba(Kirigami.Theme.textColor.r, Kirigami.Theme.textColor.g,
|
||||
Kirigami.Theme.textColor.b, 0.06)
|
||||
|
||||
Behavior on color { ColorAnimation { duration: Kirigami.Units.shortDuration } }
|
||||
Behavior on color { MobileShell.MotionColorAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration } }
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
|
|
|||
Loading…
Reference in a new issue