mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-27 14:33:08 +00:00
This makes the startup feedback more robust, by having instances be controlled by a model which can listen to window changes. Being window based also allows for the close button and gestures to work properly with it, since it will show up in the task switcher as well. Fixes: * https://invent.kde.org/plasma/plasma-mobile/-/issues/357 * https://invent.kde.org/plasma/plasma-mobile/-/issues/338 * https://invent.kde.org/plasma/plasma-mobile/-/issues/335 (dark themes now tint the background color) * https://invent.kde.org/plasma/plasma-mobile/-/issues/330 * https://invent.kde.org/plasma/plasma-mobile/-/issues/30
48 lines
1.2 KiB
QML
48 lines
1.2 KiB
QML
// SPDX-FileCopyrightText: 2024 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
import QtQuick
|
|
|
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
|
|
|
// Component to supplement the StartupFeedback window maximization animation for panel backgrounds.
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
property real fullHeight
|
|
property int screen
|
|
property var maximizedTracker
|
|
|
|
// Smooth animation for colored rectangle
|
|
NumberAnimation on height {
|
|
id: heightAnim
|
|
from: 0
|
|
to: root.fullHeight
|
|
duration: 200
|
|
easing.type: Easing.OutExpo
|
|
}
|
|
|
|
// Reset when maximized window state changes
|
|
Connections {
|
|
target: maximizedTracker
|
|
|
|
function onShowingWindowChanged() {
|
|
root.color = 'transparent';
|
|
}
|
|
}
|
|
|
|
// Listen to event from shell dbus
|
|
Connections {
|
|
target: MobileShellState.ShellDBusClient
|
|
|
|
function onAppLaunchMaximizePanelAnimationTriggered(screen, color) {
|
|
if (root.screen !== screen) {
|
|
return;
|
|
}
|
|
|
|
root.color = color;
|
|
heightAnim.restart();
|
|
}
|
|
}
|
|
}
|