mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-06-11 00:47:22 +00:00
Drop MobileShell motion dependency in KWin QML
Replace MobileShell motion imports/animations with local Qt Quick ColorAnimation and NumberAnimation timings so decoration and snap-assist effects animate consistently without shell plugin coupling.
This commit is contained in:
parent
33ebcce63b
commit
43fe97dc11
2 changed files with 7 additions and 9 deletions
|
|
@ -4,7 +4,6 @@
|
|||
import QtQuick
|
||||
import QtQuick.Shapes
|
||||
import org.kde.kwin.decoration
|
||||
import org.kde.plasma.private.mobileshell as MobileShell
|
||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||
|
||||
Decoration {
|
||||
|
|
@ -24,7 +23,7 @@ Decoration {
|
|||
readonly property int normalCornerRadius: 8
|
||||
readonly property int cornerRadius: decoration.client.maximized ? 0 : normalCornerRadius
|
||||
readonly property int frameThickness: decoration.client.maximized ? 0 : normalCornerRadius
|
||||
readonly property int shortAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.EffectsFast)
|
||||
readonly property int shortAnimationDuration: 120
|
||||
readonly property bool windowMenuAllowed: !ShellSettings.Settings.convergenceModeEnabled
|
||||
|| ShellSettings.Settings.gamingModeEnabled
|
||||
|| !ShellSettings.Settings.dynamicTilingEnabled
|
||||
|
|
@ -94,7 +93,7 @@ Decoration {
|
|||
height: root.barHeight
|
||||
radius: root.cornerRadius
|
||||
color: decoration.client.active ? root.activeBar : root.inactiveBar
|
||||
Behavior on color { MobileShell.MotionColorAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration } }
|
||||
Behavior on color { ColorAnimation { duration: root.shortAnimationDuration; easing.type: Easing.OutCubic } }
|
||||
|
||||
// Square off bottom half — only top corners are rounded
|
||||
Rectangle {
|
||||
|
|
@ -135,7 +134,7 @@ Decoration {
|
|||
elide: Text.ElideMiddle
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
renderType: Text.NativeRendering
|
||||
Behavior on color { MobileShell.MotionColorAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration } }
|
||||
Behavior on color { ColorAnimation { duration: root.shortAnimationDuration; easing.type: Easing.OutCubic } }
|
||||
}
|
||||
|
||||
Row {
|
||||
|
|
@ -243,7 +242,7 @@ Decoration {
|
|||
color: parent.pressed ? Qt.darker(parent.hoverColor, 1.3)
|
||||
: parent.hovered ? parent.hoverColor
|
||||
: parent.normalColor
|
||||
Behavior on color { MobileShell.MotionColorAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration } }
|
||||
Behavior on color { ColorAnimation { duration: root.shortAnimationDuration; easing.type: Easing.OutCubic } }
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
|
|
@ -252,7 +251,7 @@ Decoration {
|
|||
font.pixelSize: Math.round(parent.width * 0.66)
|
||||
font.weight: Font.Bold
|
||||
opacity: 1.0
|
||||
Behavior on opacity { MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration } }
|
||||
Behavior on opacity { NumberAnimation { duration: root.shortAnimationDuration; easing.type: Easing.OutCubic } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import org.kde.kwin as KWinComponents
|
||||
import org.kde.plasma.private.mobileshell as MobileShell
|
||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||
|
||||
KWinComponents.SceneEffect {
|
||||
|
|
@ -39,7 +38,7 @@ KWinComponents.SceneEffect {
|
|||
readonly property int panelScreenMargin: 8
|
||||
readonly property int panelCursorGap: 12
|
||||
readonly property int panelCursorRightBias: 34
|
||||
readonly property int hoverAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.Press)
|
||||
readonly property int hoverAnimationDuration: 100
|
||||
property var hoverWindowId: null
|
||||
property int hoverTicks: 0
|
||||
property string hoverWindowStateKey: ""
|
||||
|
|
@ -651,7 +650,7 @@ KWinComponents.SceneEffect {
|
|||
|
||||
property bool hovered: false
|
||||
|
||||
Behavior on color { MobileShell.MotionColorAnimation { type: MobileShell.Motion.Press; duration: effect.hoverAnimationDuration } }
|
||||
Behavior on color { ColorAnimation { duration: effect.hoverAnimationDuration; easing.type: Easing.OutCubic } }
|
||||
|
||||
Rectangle {
|
||||
id: previewFrame
|
||||
|
|
|
|||
Loading…
Reference in a new issue