1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

Fix OSDs disappearing and toast exit anim

This commit is contained in:
bbedward
2025-08-20 11:06:47 -04:00
parent 1f24ad51f8
commit 8c7b72fb6c
5 changed files with 85 additions and 25 deletions

View File

@@ -35,8 +35,34 @@ PanelWindow {
}
function resetHideTimer() {
if (shouldBeVisible && enableMouseInteraction)
hideTimer.restart()
if (shouldBeVisible && enableMouseInteraction) {
// Only restart timer if we're not currently hovering
let isHovered = (enableMouseInteraction && mouseArea.containsMouse) || osdContainer.childHovered
if (!isHovered) {
hideTimer.restart()
}
}
}
function stopHideTimer() {
if (enableMouseInteraction)
hideTimer.stop()
}
function updateHoverState() {
let isHovered = (enableMouseInteraction && mouseArea.containsMouse) || osdContainer.childHovered
if (enableMouseInteraction) {
if (isHovered) {
stopHideTimer()
} else if (shouldBeVisible) {
resetHideTimer()
}
}
}
function setChildHovered(hovered) {
osdContainer.childHovered = hovered
updateHoverState()
}
screen: modelData
@@ -82,6 +108,7 @@ PanelWindow {
id: osdContainer
property bool containsMouse: enableMouseInteraction && mouseArea.containsMouse
property bool childHovered: false
width: osdWidth
height: osdHeight
@@ -103,6 +130,14 @@ PanelWindow {
acceptedButtons: Qt.NoButton
propagateComposedEvents: true
z: -1
onContainsMouseChanged: {
updateHoverState()
}
}
onChildHoveredChanged: {
root.updateHoverState()
}
Loader {

View File

@@ -14,6 +14,7 @@ Item {
property string unit: "%"
property bool showValue: true
property bool isDragging: false
readonly property bool containsMouse: sliderMouseArea.containsMouse
signal sliderValueChanged(int newValue)
signal sliderDragFinished(int finalValue)