mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 22:15:38 -05:00
Nicer notification click handlign
This commit is contained in:
@@ -13,7 +13,6 @@ This is a Quickshell-based desktop shell implementation with Material Design 3 d
|
||||
- **QML (Qt Modeling Language)** - Primary language for all UI components
|
||||
- **Quickshell Framework** - QML-based framework for building desktop shells
|
||||
- **Qt/QtQuick** - UI rendering and controls
|
||||
- **Qt5Compat** - Graphical effects
|
||||
- **Wayland** - Display server protocol
|
||||
|
||||
## Development Commands
|
||||
|
||||
@@ -21,19 +21,21 @@ PanelWindow {
|
||||
anchors {
|
||||
top: true
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
|
||||
implicitWidth: 400
|
||||
margins {
|
||||
top: Theme.barHeight
|
||||
right: 0
|
||||
}
|
||||
|
||||
implicitWidth: 396
|
||||
implicitHeight: 116 // Just the notification area
|
||||
|
||||
Rectangle {
|
||||
id: popupContainer
|
||||
width: 380
|
||||
height: 100
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: Theme.barHeight + 16
|
||||
anchors.rightMargin: 16
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: 16 // 16px from the top of this window
|
||||
anchors.rightMargin: 16 // 16px from the right edge
|
||||
|
||||
color: Theme.surfaceContainer
|
||||
radius: Theme.cornerRadiusLarge
|
||||
@@ -50,8 +52,9 @@ PanelWindow {
|
||||
anchors.rightMargin: 36 // Don't overlap with close button
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
|
||||
onClicked: {
|
||||
onClicked: (mouse) => {
|
||||
console.log("Popup clicked!")
|
||||
if (root.activeNotification) {
|
||||
root.handleNotificationClick(root.activeNotification)
|
||||
@@ -65,6 +68,7 @@ PanelWindow {
|
||||
}
|
||||
// Always hide popup after click
|
||||
Utils.hideNotificationPopup()
|
||||
mouse.accepted = true // Prevent event propagation
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +95,11 @@ PanelWindow {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: Utils.hideNotificationPopup()
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onClicked: (mouse) => {
|
||||
Utils.hideNotificationPopup()
|
||||
mouse.accepted = true // Prevent event propagation
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
|
||||
@@ -9,6 +9,7 @@ import Quickshell.Services.SystemTray
|
||||
import Quickshell.Services.Notifications
|
||||
import Quickshell.Services.Mpris
|
||||
import "../../Common"
|
||||
import "../../Common/Utilities.js" as Utils
|
||||
import "../../Services"
|
||||
import ".."
|
||||
|
||||
@@ -177,6 +178,10 @@ PanelWindow {
|
||||
|
||||
onClicked: {
|
||||
if (topBar.shellRoot) {
|
||||
// Hide notification popup if visible
|
||||
if (topBar.shellRoot.showNotificationPopup) {
|
||||
Utils.hideNotificationPopup()
|
||||
}
|
||||
topBar.shellRoot.calendarVisible = !topBar.shellRoot.calendarVisible
|
||||
}
|
||||
}
|
||||
@@ -195,6 +200,10 @@ PanelWindow {
|
||||
|
||||
onClicked: {
|
||||
if (topBar.shellRoot) {
|
||||
// Hide notification popup if visible
|
||||
if (topBar.shellRoot.showNotificationPopup) {
|
||||
Utils.hideNotificationPopup()
|
||||
}
|
||||
topBar.shellRoot.calendarVisible = !topBar.shellRoot.calendarVisible
|
||||
}
|
||||
}
|
||||
@@ -243,6 +252,10 @@ PanelWindow {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: {
|
||||
// Hide notification popup if visible
|
||||
if (topBar.shellRoot && topBar.shellRoot.showNotificationPopup) {
|
||||
Utils.hideNotificationPopup()
|
||||
}
|
||||
topBar.clipboardRequested()
|
||||
}
|
||||
}
|
||||
@@ -270,6 +283,10 @@ PanelWindow {
|
||||
isActive: topBar.shellRoot ? topBar.shellRoot.notificationHistoryVisible : false
|
||||
onClicked: {
|
||||
if (topBar.shellRoot) {
|
||||
// Hide notification popup if visible
|
||||
if (topBar.shellRoot.showNotificationPopup) {
|
||||
Utils.hideNotificationPopup()
|
||||
}
|
||||
topBar.shellRoot.notificationHistoryVisible = !topBar.shellRoot.notificationHistoryVisible
|
||||
}
|
||||
}
|
||||
@@ -291,6 +308,10 @@ PanelWindow {
|
||||
|
||||
onClicked: {
|
||||
if (topBar.shellRoot) {
|
||||
// Hide notification popup if visible
|
||||
if (topBar.shellRoot.showNotificationPopup) {
|
||||
Utils.hideNotificationPopup()
|
||||
}
|
||||
topBar.shellRoot.controlCenterVisible = !topBar.shellRoot.controlCenterVisible
|
||||
if (topBar.shellRoot.controlCenterVisible) {
|
||||
WifiService.scanWifi()
|
||||
|
||||
Reference in New Issue
Block a user