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:
Marco Allegretti 2026-05-21 11:14:00 +02:00
parent a37734b74a
commit 88a4f5883b
4 changed files with 20 additions and 12 deletions

View file

@ -37,6 +37,9 @@ Window {
readonly property string rightShoulderLabel: GamingShell.GamepadManager.buttonLabel(GamingShell.GamepadManager.ButtonRightShoulder) readonly property string rightShoulderLabel: GamingShell.GamepadManager.buttonLabel(GamingShell.GamepadManager.ButtonRightShoulder)
readonly property string quickSettingsButtonLabel: GamingShell.GamepadManager.buttonLabel(GamingShell.GamepadManager.ButtonBack) readonly property string quickSettingsButtonLabel: GamingShell.GamepadManager.buttonLabel(GamingShell.GamepadManager.ButtonBack)
readonly property string searchButtonLabel: GamingShell.GamepadManager.buttonLabel(GamingShell.GamepadManager.ButtonStart) 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) { function pulsePrimaryGamepad(lowIntensity, highIntensity, durationMs) {
var pad = GamingShell.GamepadManager.primaryGamepad var pad = GamingShell.GamepadManager.primaryGamepad
@ -161,7 +164,7 @@ Window {
// Animate opacity on show/hide // Animate opacity on show/hide
opacity: visible ? 1 : 0 opacity: visible ? 1 : 0
Behavior on opacity { Behavior on opacity {
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad } MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsDefault; duration: root.longAnimationDuration }
} }
Connections { Connections {
@ -960,7 +963,7 @@ Window {
scale: parent.parent.parent.isCurrent ? 1.08 : 1.0 scale: parent.parent.parent.isCurrent ? 1.08 : 1.0
Behavior on scale { 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 z: 100
Behavior on opacity { Behavior on opacity {
NumberAnimation { duration: 250; easing.type: Easing.InQuad } MobileShell.MotionNumberAnimation { type: MobileShell.Motion.StandardAccel; duration: root.launchFadeDuration }
} }
} }

View file

@ -7,7 +7,7 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import org.kde.kirigami as Kirigami 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.plasma.private.mobileshell.gamingshellplugin as GamingShell
import org.kde.layershell 1.0 as LayerShell import org.kde.layershell 1.0 as LayerShell
@ -23,6 +23,8 @@ Window {
property string toastMessage: "" property string toastMessage: ""
property bool toastError: false property bool toastError: false
readonly property bool toastActive: toastMessage.length > 0 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) // Most-recently-played game for quick resume. Populated from recentGames(1)
// and refreshed whenever the recent list changes. // and refreshed whenever the recent list changes.
@ -39,10 +41,10 @@ Window {
flags: Qt.FramelessWindowHint flags: Qt.FramelessWindowHint
Behavior on width { Behavior on width {
NumberAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.OutCubic } MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration }
} }
Behavior on height { 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" LayerShell.Window.scope: "gaming-hud"
@ -57,7 +59,7 @@ Window {
opacity: showing ? 1 : 0 opacity: showing ? 1 : 0
Behavior on opacity { Behavior on opacity {
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad } MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsDefault; duration: root.longAnimationDuration }
} }
Timer { Timer {
@ -183,7 +185,7 @@ Window {
opacity: root.toastActive ? 1.0 : 0.0 opacity: root.toastActive ? 1.0 : 0.0
Behavior on opacity { Behavior on opacity {
NumberAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.InOutQuad } MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration }
} }
RowLayout { RowLayout {

View file

@ -135,7 +135,7 @@ Item {
color: "black" color: "black"
opacity: root.opened ? 0.4 : 0 opacity: root.opened ? 0.4 : 0
Behavior on opacity { 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 x: root.opened ? root.width - width : root.width
Behavior on x { Behavior on x {
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad } MobileShell.MotionNumberAnimation { type: MobileShell.Motion.SpatialDefault }
} }
Kirigami.Theme.inherit: false Kirigami.Theme.inherit: false

View file

@ -7,6 +7,7 @@ import QtQuick.Controls as QQC2
import org.kde.kirigami as Kirigami import org.kde.kirigami as Kirigami
import org.kde.plasma.components 3.0 as PC3 import org.kde.plasma.components 3.0 as PC3
import org.kde.plasma.private.mobileshell as MobileShell
import org.kde.taskmanager as TaskManager import org.kde.taskmanager as TaskManager
import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
@ -17,6 +18,8 @@ Item {
implicitHeight: taskList.count > 0 ? column.implicitHeight : 0 implicitHeight: taskList.count > 0 ? column.implicitHeight : 0
readonly property bool hasTasks: taskList.count > 0 readonly property bool hasTasks: taskList.count > 0
readonly property int taskCount: taskList.count 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 taskActivated()
signal moveDownRequested() signal moveDownRequested()
@ -59,7 +62,7 @@ Item {
} }
Behavior on implicitHeight { Behavior on implicitHeight {
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad } MobileShell.MotionNumberAnimation { type: MobileShell.Motion.Standard; duration: root.longAnimationDuration }
} }
ColumnLayout { ColumnLayout {
@ -152,7 +155,7 @@ Item {
: Qt.rgba(Kirigami.Theme.textColor.r, Kirigami.Theme.textColor.g, : Qt.rgba(Kirigami.Theme.textColor.r, Kirigami.Theme.textColor.g,
Kirigami.Theme.textColor.b, 0.06) 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 { ColumnLayout {