mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-03 20:18:31 -04:00
fix(Hover): refactor & update hover tracking w/context menus
Fixes #2737
This commit is contained in:
@@ -30,6 +30,7 @@ Rectangle {
|
||||
property real swipingNotificationOffset: 0
|
||||
property real listLevelAdjacentScaleInfluence: 1.0
|
||||
property bool listLevelScaleAnimationsEnabled: true
|
||||
property var transientSurfaceTracker: null
|
||||
|
||||
readonly property bool compactMode: SettingsData.notificationCompactMode
|
||||
readonly property real cardPadding: compactMode ? Theme.notificationCardPaddingCompact : Theme.notificationCardPadding
|
||||
@@ -63,6 +64,20 @@ Rectangle {
|
||||
});
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
transientSurfaceTracker?.unregister(root);
|
||||
notificationCardContextMenu.close();
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: root.transientSurfaceTracker
|
||||
ignoreUnknownSignals: true
|
||||
|
||||
function onCloseRequested() {
|
||||
notificationCardContextMenu.close();
|
||||
}
|
||||
}
|
||||
|
||||
function expansionMotionDuration() {
|
||||
if (isDescriptionToggleAnimation)
|
||||
return descriptionExpanded ? Theme.notificationInlineExpandDuration : Theme.notificationInlineCollapseDuration;
|
||||
@@ -1059,6 +1074,8 @@ Rectangle {
|
||||
width: 220
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
||||
onVisibleChanged: root.transientSurfaceTracker?.setActive(root, visible, null)
|
||||
|
||||
background: Rectangle {
|
||||
color: BlurService.enabled ? Theme.surfaceContainer : Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
|
||||
Reference in New Issue
Block a user