mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-12 07:19:41 -04:00
quickshell: drop support for 0.2, require 0.3+
- Remove all compat code - Rewire LegacyNetworkService to use Quickshell.Networking - Add parentWindow to settings child windows
This commit is contained in:
@@ -4,11 +4,13 @@ import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
|
||||
PanelWindow {
|
||||
id: root
|
||||
|
||||
property bool active: false
|
||||
property bool _completed: false
|
||||
|
||||
signal fadeCompleted
|
||||
signal fadeCancelled
|
||||
@@ -35,7 +37,8 @@ PanelWindow {
|
||||
opacity: 0
|
||||
|
||||
onOpacityChanged: {
|
||||
if (opacity >= 0.99 && root.active) {
|
||||
if (opacity >= 0.99 && root.active && !root._completed) {
|
||||
root._completed = true;
|
||||
root.fadeCompleted();
|
||||
}
|
||||
}
|
||||
@@ -58,6 +61,7 @@ PanelWindow {
|
||||
function startFade() {
|
||||
if (!SettingsData.fadeToLockEnabled)
|
||||
return;
|
||||
_completed = false;
|
||||
active = true;
|
||||
fadeOverlay.opacity = 0.0;
|
||||
fadeSeq.stop();
|
||||
@@ -65,12 +69,29 @@ PanelWindow {
|
||||
}
|
||||
|
||||
function cancelFade() {
|
||||
if (_completed)
|
||||
return;
|
||||
fadeSeq.stop();
|
||||
fadeOverlay.opacity = 0.0;
|
||||
active = false;
|
||||
fadeCancelled();
|
||||
}
|
||||
|
||||
function dismiss() {
|
||||
fadeSeq.stop();
|
||||
fadeOverlay.opacity = 0.0;
|
||||
active = false;
|
||||
_completed = false;
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: IdleService
|
||||
function onIsShellLockedChanged() {
|
||||
if (!IdleService.isShellLocked && root._completed)
|
||||
root.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
enabled: root.active
|
||||
|
||||
Reference in New Issue
Block a user