From 88a4f5883b13fc4edc11e679427fc56770a36472 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Thu, 21 May 2026 11:14:00 +0200 Subject: [PATCH] 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. --- .../folio/qml/gaming/GameCenterOverlay.qml | 9 ++++++--- .../homescreens/folio/qml/gaming/GamingHUD.qml | 12 +++++++----- .../folio/qml/gaming/GamingQuickSettings.qml | 4 ++-- .../folio/qml/gaming/RunningGamesView.qml | 7 +++++-- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml b/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml index e20f56c7..92e56eaa 100644 --- a/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml +++ b/containments/homescreens/folio/qml/gaming/GameCenterOverlay.qml @@ -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 } } } diff --git a/containments/homescreens/folio/qml/gaming/GamingHUD.qml b/containments/homescreens/folio/qml/gaming/GamingHUD.qml index 69b8ee6f..9d9f642c 100644 --- a/containments/homescreens/folio/qml/gaming/GamingHUD.qml +++ b/containments/homescreens/folio/qml/gaming/GamingHUD.qml @@ -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 { diff --git a/containments/homescreens/folio/qml/gaming/GamingQuickSettings.qml b/containments/homescreens/folio/qml/gaming/GamingQuickSettings.qml index 86b325ae..274bd79e 100644 --- a/containments/homescreens/folio/qml/gaming/GamingQuickSettings.qml +++ b/containments/homescreens/folio/qml/gaming/GamingQuickSettings.qml @@ -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 diff --git a/containments/homescreens/folio/qml/gaming/RunningGamesView.qml b/containments/homescreens/folio/qml/gaming/RunningGamesView.qml index 4f6cae2a..78c16bf7 100644 --- a/containments/homescreens/folio/qml/gaming/RunningGamesView.qml +++ b/containments/homescreens/folio/qml/gaming/RunningGamesView.qml @@ -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 {