extract OsdSection base component from Volume and Backlight modules

This commit is contained in:
Damocles 2026-04-23 23:29:50 +02:00
parent e50dd155fa
commit 2ec24e3075
4 changed files with 33 additions and 34 deletions

View file

@ -0,0 +1,25 @@
import QtQuick
// Base component for bar modules with OSD flash behavior (Volume, Backlight).
// Panel shows on hover or when flashPanel() is called, auto-dismisses after 1.5s.
// Modules bind _panelHovered to their HoverPanel's panelHovered property.
BarSection {
id: root
tooltip: ""
property bool _panelHovered: false
property bool _osdActive: false
readonly property bool _anyHover: root._hovered || _panelHovered
readonly property bool _showPanel: _anyHover || _osdActive
function flashPanel() {
_osdActive = true;
_osdTimer.restart();
}
Timer {
id: _osdTimer
interval: 1500
onTriggered: root._osdActive = false
}
}