1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 16:02:51 -05:00

Compare commits

...

3 Commits

4 changed files with 39 additions and 36 deletions

View File

@@ -1088,7 +1088,7 @@ Singleton {
updateBarConfigs();
if (positionChanged) {
NotificationService.clearAllPopups();
NotificationService.dismissAllPopups();
}
}
@@ -1233,7 +1233,7 @@ Singleton {
}
function sendTestNotifications() {
NotificationService.clearAllPopups();
NotificationService.dismissAllPopups();
sendTestNotification(0);
testNotifTimer1.start();
testNotifTimer2.start();

View File

@@ -61,6 +61,10 @@ DankModal {
NotificationService.clearAllNotifications();
}
function dismissAllPopups () {
NotificationService.dismissAllPopups();
}
modalWidth: 500
modalHeight: 700
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
@@ -113,6 +117,11 @@ DankModal {
return "NOTIFICATION_MODAL_CLEAR_ALL_SUCCESS";
}
function dismissAllPopups(): string {
notificationModal.dismissAllPopups();
return "NOTIFICATION_MODAL_DISMISS_ALL_POPUPS_SUCCESS";
}
target: "notifications"
}

View File

@@ -170,6 +170,30 @@ Item {
windows: [widgetWindow]
}
Item {
anchors.fill: parent
focus: root.isInteracting
Keys.onPressed: event => {
if (!root.isInteracting)
return;
switch (event.key) {
case Qt.Key_G:
SettingsData.setDesktopWidgetGridSetting(root.screenKey, "enabled", !root.gridEnabled);
event.accepted = true;
break;
case Qt.Key_Z:
SettingsData.setDesktopWidgetGridSetting(root.screenKey, "size", Math.max(10, root.gridSize - 10));
event.accepted = true;
break;
case Qt.Key_X:
SettingsData.setDesktopWidgetGridSetting(root.screenKey, "size", Math.min(200, root.gridSize + 10));
event.accepted = true;
break;
}
}
}
anchors {
left: true
top: true
@@ -343,6 +367,7 @@ Item {
active: root.isInteracting && root.useGhostPreview
sourceComponent: PanelWindow {
id: ghostPreviewWindow
screen: root.screen
color: "transparent"
@@ -356,7 +381,7 @@ Item {
mask: Region {}
WlrLayershell.namespace: "quickshell:desktop-widget-preview"
WlrLayershell.layer: WlrLayer.Background
WlrLayershell.layer: WlrLayer.Bottom
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
@@ -484,16 +509,7 @@ Item {
WlrLayershell.namespace: "quickshell:desktop-widget-helper"
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.keyboardFocus: {
if (CompositorService.useHyprlandFocusGrab)
return WlrKeyboardFocus.OnDemand;
return WlrKeyboardFocus.Exclusive;
}
HyprlandFocusGrab {
active: CompositorService.isHyprland
windows: [helperWindow]
}
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
anchors {
bottom: true
@@ -503,28 +519,6 @@ Item {
implicitHeight: 60
Item {
anchors.fill: parent
focus: true
Keys.onPressed: event => {
switch (event.key) {
case Qt.Key_G:
SettingsData.setDesktopWidgetGridSetting(root.screenKey, "enabled", !root.gridEnabled);
event.accepted = true;
break;
case Qt.Key_Z:
SettingsData.setDesktopWidgetGridSetting(root.screenKey, "size", Math.max(10, root.gridSize - 10));
event.accepted = true;
break;
case Qt.Key_X:
SettingsData.setDesktopWidgetGridSetting(root.screenKey, "size", Math.min(200, root.gridSize + 10));
event.accepted = true;
break;
}
}
}
Rectangle {
id: helperContent
anchors.horizontalCenter: parent.horizontalCenter

View File

@@ -403,7 +403,7 @@ Singleton {
NotifWrapper {}
}
function clearAllPopups() {
function dismissAllPopups() {
for (const w of visibleNotifications) {
if (w) {
w.popup = false;