1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

notifications: fix DnD tooltip

This commit is contained in:
bbedward
2025-11-23 20:37:08 -05:00
parent b773fdca34
commit b3c07edef6

View File

@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Controls
import qs.Common import qs.Common
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -13,6 +12,10 @@ Item {
width: parent.width width: parent.width
height: 32 height: 32
DankTooltipV2 {
id: sharedTooltip
}
Row { Row {
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -35,17 +38,10 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: SessionData.setDoNotDisturb(!SessionData.doNotDisturb) onClicked: SessionData.setDoNotDisturb(!SessionData.doNotDisturb)
onEntered: { onEntered: {
tooltipLoader.active = true sharedTooltip.show(I18n.tr("Do Not Disturb"), doNotDisturbButton, 0, 0, "bottom");
if (tooltipLoader.item) {
const p = mapToItem(null, width / 2, 0)
tooltipLoader.item.show(I18n.tr("Do Not Disturb"), p.x, p.y - 40, null)
}
} }
onExited: { onExited: {
if (tooltipLoader.item) { sharedTooltip.hide();
tooltipLoader.item.hide()
}
tooltipLoader.active = false
} }
} }
} }
@@ -64,7 +60,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
if (keyboardController) { if (keyboardController) {
keyboardController.showKeyboardHints = !keyboardController.showKeyboardHints keyboardController.showKeyboardHints = !keyboardController.showKeyboardHints;
} }
} }
} }
@@ -115,14 +111,6 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: NotificationService.clearAllNotifications() onClicked: NotificationService.clearAllNotifications()
} }
} }
} }
Loader {
id: tooltipLoader
active: false
sourceComponent: DankTooltip {}
}
} }