1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-31 08:52:49 -05:00

Compare commits

...

3 Commits

4 changed files with 39 additions and 36 deletions

View File

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

View File

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

View File

@@ -170,6 +170,30 @@ Item {
windows: [widgetWindow] 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 { anchors {
left: true left: true
top: true top: true
@@ -343,6 +367,7 @@ Item {
active: root.isInteracting && root.useGhostPreview active: root.isInteracting && root.useGhostPreview
sourceComponent: PanelWindow { sourceComponent: PanelWindow {
id: ghostPreviewWindow
screen: root.screen screen: root.screen
color: "transparent" color: "transparent"
@@ -356,7 +381,7 @@ Item {
mask: Region {} mask: Region {}
WlrLayershell.namespace: "quickshell:desktop-widget-preview" WlrLayershell.namespace: "quickshell:desktop-widget-preview"
WlrLayershell.layer: WlrLayer.Background WlrLayershell.layer: WlrLayer.Bottom
WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
@@ -484,16 +509,7 @@ Item {
WlrLayershell.namespace: "quickshell:desktop-widget-helper" WlrLayershell.namespace: "quickshell:desktop-widget-helper"
WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.keyboardFocus: { WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
if (CompositorService.useHyprlandFocusGrab)
return WlrKeyboardFocus.OnDemand;
return WlrKeyboardFocus.Exclusive;
}
HyprlandFocusGrab {
active: CompositorService.isHyprland
windows: [helperWindow]
}
anchors { anchors {
bottom: true bottom: true
@@ -503,28 +519,6 @@ Item {
implicitHeight: 60 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 { Rectangle {
id: helperContent id: helperContent
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter

View File

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