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
|
||||||
import QtQuick.Shapes
|
import QtQuick.Shapes
|
||||||
import org.kde.kwin.decoration
|
import org.kde.kwin.decoration
|
||||||
import org.kde.plasma.private.mobileshell as MobileShell
|
|
||||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||||
|
|
||||||
Decoration {
|
Decoration {
|
||||||
|
|
@ -24,7 +23,7 @@ Decoration {
|
||||||
readonly property int normalCornerRadius: 8
|
readonly property int normalCornerRadius: 8
|
||||||
readonly property int cornerRadius: decoration.client.maximized ? 0 : normalCornerRadius
|
readonly property int cornerRadius: decoration.client.maximized ? 0 : normalCornerRadius
|
||||||
readonly property int frameThickness: 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
|
readonly property bool windowMenuAllowed: !ShellSettings.Settings.convergenceModeEnabled
|
||||||
|| ShellSettings.Settings.gamingModeEnabled
|
|| ShellSettings.Settings.gamingModeEnabled
|
||||||
|| !ShellSettings.Settings.dynamicTilingEnabled
|
|| !ShellSettings.Settings.dynamicTilingEnabled
|
||||||
|
|
@ -94,7 +93,7 @@ Decoration {
|
||||||
height: root.barHeight
|
height: root.barHeight
|
||||||
radius: root.cornerRadius
|
radius: root.cornerRadius
|
||||||
color: decoration.client.active ? root.activeBar : root.inactiveBar
|
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
|
// Square off bottom half — only top corners are rounded
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -135,7 +134,7 @@ Decoration {
|
||||||
elide: Text.ElideMiddle
|
elide: Text.ElideMiddle
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
renderType: Text.NativeRendering
|
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 {
|
Row {
|
||||||
|
|
@ -243,7 +242,7 @@ Decoration {
|
||||||
color: parent.pressed ? Qt.darker(parent.hoverColor, 1.3)
|
color: parent.pressed ? Qt.darker(parent.hoverColor, 1.3)
|
||||||
: parent.hovered ? parent.hoverColor
|
: parent.hovered ? parent.hoverColor
|
||||||
: parent.normalColor
|
: 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 {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
@ -252,7 +251,7 @@ Decoration {
|
||||||
font.pixelSize: Math.round(parent.width * 0.66)
|
font.pixelSize: Math.round(parent.width * 0.66)
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
opacity: 1.0
|
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
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import org.kde.kwin as KWinComponents
|
import org.kde.kwin as KWinComponents
|
||||||
import org.kde.plasma.private.mobileshell as MobileShell
|
|
||||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||||
|
|
||||||
KWinComponents.SceneEffect {
|
KWinComponents.SceneEffect {
|
||||||
|
|
@ -39,7 +38,7 @@ KWinComponents.SceneEffect {
|
||||||
readonly property int panelScreenMargin: 8
|
readonly property int panelScreenMargin: 8
|
||||||
readonly property int panelCursorGap: 12
|
readonly property int panelCursorGap: 12
|
||||||
readonly property int panelCursorRightBias: 34
|
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 var hoverWindowId: null
|
||||||
property int hoverTicks: 0
|
property int hoverTicks: 0
|
||||||
property string hoverWindowStateKey: ""
|
property string hoverWindowStateKey: ""
|
||||||
|
|
@ -651,7 +650,7 @@ KWinComponents.SceneEffect {
|
||||||
|
|
||||||
property bool hovered: false
|
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 {
|
Rectangle {
|
||||||
id: previewFrame
|
id: previewFrame
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue