refactor: unified BarModule base component, click-to-open panels, remove pinning
This commit is contained in:
parent
034f0b6d85
commit
26476dc930
33 changed files with 273 additions and 517 deletions
|
|
@ -5,10 +5,10 @@ import "." as M
|
|||
import "../services" as S
|
||||
import "../applets" as C
|
||||
|
||||
M.OsdSection {
|
||||
M.BarModule {
|
||||
id: root
|
||||
spacing: S.Theme.moduleSpacing
|
||||
_panelHovered: hoverPanel.panelHovered
|
||||
tooltip: "Volume: " + Math.round(volume * 100) + "%" + (muted ? " (muted)" : "")
|
||||
|
||||
PwObjectTracker {
|
||||
objects: [Pipewire.defaultAudioSink, ...root._streamList]
|
||||
|
|
@ -63,24 +63,12 @@ M.OsdSection {
|
|||
minIcon: "\uF028"
|
||||
color: root._volumeColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: if (root.sink?.audio)
|
||||
root.sink.audio.muted = !root.sink.audio.muted
|
||||
}
|
||||
}
|
||||
M.BarLabel {
|
||||
label: Math.round(root.volume * 100) + "%"
|
||||
minText: "100%"
|
||||
color: root._volumeColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: if (root.sink?.audio)
|
||||
root.sink.audio.muted = !root.sink.audio.muted
|
||||
}
|
||||
}
|
||||
|
||||
WheelHandler {
|
||||
|
|
@ -100,6 +88,7 @@ M.OsdSection {
|
|||
panelNamespace: "nova-volume"
|
||||
panelTitle: "Sound"
|
||||
contentWidth: 220
|
||||
onDismissed: root.dismissPanel()
|
||||
|
||||
C.VolumeApplet {
|
||||
width: hoverPanel.contentWidth
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue