Add Audio Input/Output selector, add (probably) working battery indicator
This commit is contained in:
parent
ba93df4a1f
commit
f75ff03281
5 changed files with 394 additions and 4 deletions
|
|
@ -2,6 +2,7 @@ import QtQuick
|
|||
import Quickshell
|
||||
import qs.Settings
|
||||
import qs.Components
|
||||
import qs.Bar.Modules
|
||||
|
||||
Item {
|
||||
id: volumeDisplay
|
||||
|
|
@ -24,10 +25,23 @@ Item {
|
|||
StyledTooltip {
|
||||
id: volumeTooltip
|
||||
text: "Volume: " + volume + "%\nScroll up/down to change volume"
|
||||
tooltipVisible: false
|
||||
tooltipVisible: !ioSelector.visible && volumeDisplay.containsMouse
|
||||
targetItem: pillIndicator
|
||||
delay: 200
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (ioSelector.visible) {
|
||||
ioSelector.dismiss();
|
||||
} else {
|
||||
ioSelector.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
|
@ -54,8 +68,8 @@ Item {
|
|||
hoverEnabled: true
|
||||
acceptedButtons: Qt.NoButton // Accept wheel events only
|
||||
propagateComposedEvents: true
|
||||
onEntered: volumeTooltip.tooltipVisible = true
|
||||
onExited: volumeTooltip.tooltipVisible = false
|
||||
onEntered: volumeDisplay.containsMouse = true
|
||||
onExited: volumeDisplay.containsMouse = false
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onWheel:(wheel) => {
|
||||
if (!shell) return;
|
||||
|
|
@ -67,4 +81,11 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
AudioDeviceSelector {
|
||||
id: ioSelector
|
||||
onClosed: ioSelector.dismiss()
|
||||
}
|
||||
|
||||
property bool containsMouse: false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue