mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Notifications: ensure they are not sandwitched between panels
+ Always access lockScreen via panel service and removed deprecation notice.
This commit is contained in:
@@ -20,21 +20,19 @@ import qs.Widgets
|
||||
import qs.Widgets.AudioSpectrum
|
||||
|
||||
Loader {
|
||||
id: lockScreen
|
||||
id: root
|
||||
active: false
|
||||
|
||||
// Track if triggered via deprecated IPC call
|
||||
property bool triggeredViaDeprecatedCall: false
|
||||
Component.onCompleted: {
|
||||
// Register with panel service
|
||||
PanelService.lockScreen = this;
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: unloadAfterUnlockTimer
|
||||
interval: 250
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
lockScreen.active = false;
|
||||
// Reset the deprecation flag when unlocking
|
||||
lockScreen.triggeredViaDeprecatedCall = false;
|
||||
}
|
||||
onTriggered: root.active = false
|
||||
}
|
||||
|
||||
function scheduleUnloadAfterUnlock() {
|
||||
@@ -49,7 +47,7 @@ Loader {
|
||||
id: lockContext
|
||||
onUnlocked: {
|
||||
lockSession.locked = false;
|
||||
lockScreen.scheduleUnloadAfterUnlock();
|
||||
root.scheduleUnloadAfterUnlock();
|
||||
lockContext.currentText = "";
|
||||
}
|
||||
onFailed: {
|
||||
@@ -59,7 +57,7 @@ Loader {
|
||||
|
||||
WlSessionLock {
|
||||
id: lockSession
|
||||
locked: lockScreen.active
|
||||
locked: root.active
|
||||
|
||||
WlSessionLockSurface {
|
||||
readonly property var now: Time.now
|
||||
@@ -383,64 +381,6 @@ Loader {
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecation warning (shown above error notification)
|
||||
Rectangle {
|
||||
width: Math.min(650, parent.width - 40)
|
||||
implicitHeight: deprecationContent.implicitHeight + 24
|
||||
height: implicitHeight
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: (Settings.data.general.compactLockScreen ? 320 : 400) * Style.uiScaleRatio
|
||||
radius: Style.radiusL
|
||||
color: Qt.alpha(Color.mTertiary, 0.95)
|
||||
border.color: Color.mTertiary
|
||||
border.width: 2
|
||||
visible: lockScreen.triggeredViaDeprecatedCall
|
||||
opacity: visible ? 1.0 : 0.0
|
||||
|
||||
ColumnLayout {
|
||||
id: deprecationContent
|
||||
anchors.fill: parent
|
||||
anchors.margins: 12
|
||||
spacing: 6
|
||||
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: 8
|
||||
|
||||
NIcon {
|
||||
icon: "alert-triangle"
|
||||
pointSize: Style.fontSizeL
|
||||
color: Color.mOnTertiary
|
||||
}
|
||||
|
||||
NText {
|
||||
text: "Deprecated IPC Call"
|
||||
color: Color.mOnTertiary
|
||||
pointSize: Style.fontSizeL
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
}
|
||||
|
||||
NText {
|
||||
text: "The 'lockScreen toggle' IPC call is deprecated. Use 'lockScreen lock' instead."
|
||||
color: Color.mOnTertiary
|
||||
pointSize: Style.fontSizeM
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: 300
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Error notification
|
||||
Rectangle {
|
||||
width: 450
|
||||
|
||||
@@ -21,8 +21,8 @@ Variants {
|
||||
|
||||
property ListModel notificationModel: NotificationService.activeList
|
||||
|
||||
// Loader is active when there are notifications
|
||||
active: notificationModel.count > 0 || delayTimer.running
|
||||
// Always create window (but with 0x0 dimensions when no notifications)
|
||||
active: true
|
||||
|
||||
// Keep loader active briefly after last notification to allow animations to complete
|
||||
Timer {
|
||||
@@ -104,8 +104,8 @@ Variants {
|
||||
margins.left: isLeft ? barOffsetLeft : 0
|
||||
margins.right: isRight ? barOffsetRight : 0
|
||||
|
||||
implicitWidth: notifWidth
|
||||
implicitHeight: notificationStack.implicitHeight + Style.marginL
|
||||
implicitWidth: (notificationModel.count > 0 || delayTimer.running) ? notifWidth : 0
|
||||
implicitHeight: (notificationModel.count > 0 || delayTimer.running) ? (notificationStack.implicitHeight + Style.marginL) : 0
|
||||
|
||||
property var animateConnection: null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user