mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
Revert "modals: single window optimization"
This reverts commit 468e569bc7.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Io
|
||||
import qs.Common
|
||||
import qs.Modals.Common
|
||||
@@ -10,6 +11,11 @@ DankModal {
|
||||
|
||||
layerNamespace: "dms:notification-center-modal"
|
||||
|
||||
HyprlandFocusGrab {
|
||||
windows: [notificationModal.contentWindow]
|
||||
active: CompositorService.isHyprland && notificationModal.shouldHaveFocus
|
||||
}
|
||||
|
||||
property bool notificationModalOpen: false
|
||||
property var notificationListRef: null
|
||||
|
||||
@@ -55,6 +61,9 @@ DankModal {
|
||||
modalHeight: 700
|
||||
visible: false
|
||||
onBackgroundClicked: hide()
|
||||
onOpened: () => {
|
||||
Qt.callLater(() => modalFocusScope.forceActiveFocus());
|
||||
}
|
||||
onShouldBeVisibleChanged: shouldBeVisible => {
|
||||
if (!shouldBeVisible) {
|
||||
notificationModalOpen = false;
|
||||
@@ -62,6 +71,7 @@ DankModal {
|
||||
NotificationService.onOverlayClose();
|
||||
}
|
||||
}
|
||||
modalFocusScope.Keys.onPressed: event => modalKeyboardController.handleKey(event)
|
||||
|
||||
NotificationKeyboardController {
|
||||
id: modalKeyboardController
|
||||
@@ -91,12 +101,10 @@ DankModal {
|
||||
}
|
||||
|
||||
content: Component {
|
||||
FocusScope {
|
||||
Item {
|
||||
id: notificationKeyHandler
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
|
||||
Keys.onPressed: event => modalKeyboardController.handleKey(event)
|
||||
anchors.fill: parent
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
|
||||
Reference in New Issue
Block a user