fix: swallow first pipewire/backlight value to prevent osd on startup
This commit is contained in:
parent
9257941fe0
commit
0e581905aa
2 changed files with 25 additions and 12 deletions
|
|
@ -12,13 +12,17 @@ M.BarSection {
|
||||||
|
|
||||||
property int percent: 0
|
property int percent: 0
|
||||||
property bool _osdActive: false
|
property bool _osdActive: false
|
||||||
property bool _ready: false
|
property bool _percentInit: false
|
||||||
readonly property bool _showPanel: root._hovered || hoverPanel.panelHovered || _osdActive
|
readonly property bool _showPanel: root._hovered || hoverPanel.panelHovered || _osdActive
|
||||||
|
|
||||||
Component.onCompleted: _ready = true
|
onPercentChanged: {
|
||||||
|
if (!_percentInit) {
|
||||||
onPercentChanged: if (_ready && percent > 0)
|
_percentInit = true;
|
||||||
_flashPanel()
|
return;
|
||||||
|
}
|
||||||
|
if (percent > 0)
|
||||||
|
_flashPanel();
|
||||||
|
}
|
||||||
|
|
||||||
function _flashPanel() {
|
function _flashPanel() {
|
||||||
_osdActive = true;
|
_osdActive = true;
|
||||||
|
|
|
||||||
|
|
@ -39,16 +39,25 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool _osdActive: false
|
property bool _osdActive: false
|
||||||
property bool _ready: false
|
property bool _volumeInit: false
|
||||||
|
property bool _mutedInit: false
|
||||||
readonly property bool _anyHover: root._hovered || hoverPanel.panelHovered
|
readonly property bool _anyHover: root._hovered || hoverPanel.panelHovered
|
||||||
readonly property bool _showPanel: _anyHover || _osdActive
|
readonly property bool _showPanel: _anyHover || _osdActive
|
||||||
|
|
||||||
Component.onCompleted: _ready = true
|
onVolumeChanged: {
|
||||||
|
if (!_volumeInit) {
|
||||||
onVolumeChanged: if (_ready)
|
_volumeInit = true;
|
||||||
_flashPanel()
|
return;
|
||||||
onMutedChanged: if (_ready)
|
}
|
||||||
_flashPanel()
|
_flashPanel();
|
||||||
|
}
|
||||||
|
onMutedChanged: {
|
||||||
|
if (!_mutedInit) {
|
||||||
|
_mutedInit = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_flashPanel();
|
||||||
|
}
|
||||||
|
|
||||||
function _flashPanel() {
|
function _flashPanel() {
|
||||||
_osdActive = true;
|
_osdActive = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue