mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Overlay the shell's status panel and quicksettings panel over the lockscreen, instead of rendering a second copy in the lockscreen theme. This will allow us to improve the lockscreen loading speed. Key changes: - Overlay quicksettings window and the status bar over the lockscreen when it is shown - Refactor the top panel's showing logic to be cleaner (as it supports various overlay modes over fullscreen apps already) - Implement lockscreen support to the status bar and quicksettings panel in the to panel - Forward quicksettings panel requests for "unlock" over DBus to the lockscreen - Add "raiselockscreen" QML plugin to easily request a window to be raised over the lockscreen Notes: - Now that we are sharing the quicksettings panel from the shell, notifications that are already there will be shown on the lockscreen (compared to right now, where only new notifications would be shown) Depends on: - https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2339 - https://invent.kde.org/plasma/kscreenlocker/-/merge_requests/283 - https://invent.kde.org/plasma/kwin/-/merge_requests/7839 Implements: https://invent.kde.org/plasma/plasma-mobile/-/issues/199 
100 lines
No EOL
3 KiB
QML
100 lines
No EOL
3 KiB
QML
// SPDX-FileCopyrightText: 2021-2025 Devin Lin <devin@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
import org.kde.plasma.plasmoid
|
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
|
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
|
|
|
|
Item {
|
|
id: root
|
|
|
|
// The full intended height of the status panel.
|
|
required property real statusPanelHeight
|
|
|
|
// Whether the background should be transparent, with content using a complementary theme on top.
|
|
required property bool transparentBackground
|
|
|
|
// Request the panel itself to reapply settings (ex. for updating touch area).
|
|
signal updatePanelPropertiesRequested()
|
|
|
|
|
|
Kirigami.Theme.colorSet: transparentBackground ? Kirigami.Theme.Complementary : Kirigami.Theme.Header
|
|
Kirigami.Theme.inherit: false
|
|
|
|
property real offset: 0
|
|
|
|
MobileShell.StatusBar {
|
|
id: topPanel
|
|
anchors.fill: parent
|
|
|
|
showSecondRow: false
|
|
showTime: !MobileShellState.LockscreenDBusClient.lockscreenActive // Don't show time on the lockscreen, since we already have a massive clock
|
|
|
|
showDropShadow: root.transparentBackground
|
|
backgroundColor: {
|
|
if (root.transparentBackground) {
|
|
return "transparent";
|
|
}
|
|
|
|
if (state == "default") {
|
|
return Kirigami.Theme.backgroundColor;
|
|
} else {
|
|
return Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.95);
|
|
}
|
|
}
|
|
|
|
transform: [
|
|
Translate {
|
|
y: root.offset
|
|
}
|
|
]
|
|
}
|
|
|
|
states: [
|
|
State {
|
|
// Default panel state, which is shown in the UI.
|
|
name: "default"
|
|
PropertyChanges {
|
|
target: root; offset: 0
|
|
}
|
|
},
|
|
State {
|
|
// Panel is forced to be visible and overlaid over content (will be automatically hidden after a duration).
|
|
name: "visible"
|
|
PropertyChanges {
|
|
target: root; offset: 0
|
|
}
|
|
},
|
|
State {
|
|
// Panel is hidden and requires a gesture to be shown.
|
|
name: "hidden"
|
|
PropertyChanges {
|
|
target: root; offset: -root.statusPanelHeight
|
|
}
|
|
}
|
|
]
|
|
|
|
transitions: Transition {
|
|
SequentialAnimation {
|
|
ParallelAnimation {
|
|
PropertyAnimation {
|
|
properties: "offset"
|
|
easing.type: root.state === "hidden" ? Easing.InExpo : Easing.OutExpo
|
|
duration: Kirigami.Units.longDuration
|
|
}
|
|
}
|
|
ScriptAction {
|
|
script: {
|
|
root.updatePanelPropertiesRequested();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |