fix volume panel expansion: move trigger to sink name row, mute on bar click, longer hover timeout
This commit is contained in:
parent
e928688aa4
commit
c30f18a2ee
1 changed files with 38 additions and 14 deletions
|
|
@ -69,7 +69,7 @@ M.BarSection {
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: _collapseTimer
|
id: _collapseTimer
|
||||||
interval: 500
|
interval: 1500
|
||||||
onTriggered: root._expanded = false
|
onTriggered: root._expanded = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -81,7 +81,8 @@ M.BarSection {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: root._expanded = !root._expanded
|
onClicked: if (root.sink?.audio)
|
||||||
|
root.sink.audio.muted = !root.sink.audio.muted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
|
|
@ -92,7 +93,8 @@ M.BarSection {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: root._expanded = !root._expanded
|
onClicked: if (root.sink?.audio)
|
||||||
|
root.sink.audio.muted = !root.sink.audio.muted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -197,18 +199,40 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sink name
|
// Sink name — click to expand/collapse device list
|
||||||
Text {
|
Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 18
|
height: 22
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
|
Text {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: chevron.left
|
||||||
|
anchors.leftMargin: 12
|
||||||
|
anchors.rightMargin: 4
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: root.sink?.description ?? root.sink?.name ?? ""
|
text: root.sink?.description ?? root.sink?.name ?? ""
|
||||||
color: M.Theme.base04
|
color: M.Theme.base04
|
||||||
font.pixelSize: M.Theme.fontSize - 2
|
font.pixelSize: M.Theme.fontSize - 2
|
||||||
font.family: M.Theme.fontFamily
|
font.family: M.Theme.fontFamily
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
leftPadding: 12
|
}
|
||||||
rightPadding: 12
|
|
||||||
|
Text {
|
||||||
|
id: chevron
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 12
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: root._expanded ? "\uF077" : "\uF078"
|
||||||
|
color: M.Theme.base04
|
||||||
|
font.pixelSize: M.Theme.fontSize - 3
|
||||||
|
font.family: M.Theme.iconFontFamily
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: root._expanded = !root._expanded
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expanded: output device list
|
// Expanded: output device list
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue