forked from Shinonome/dots-hyprland
right sidebar: volume mixer: use listview, add separator
This commit is contained in:
@@ -40,44 +40,33 @@ Item {
|
|||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Flickable {
|
ListView {
|
||||||
id: flickable
|
id: listView
|
||||||
anchors.fill: parent
|
model: root.appPwNodes
|
||||||
contentHeight: volumeMixerColumnLayout.height
|
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
layer.enabled: true
|
anchors {
|
||||||
layer.effect: OpacityMask {
|
fill: parent
|
||||||
maskSource: Rectangle {
|
topMargin: 10
|
||||||
width: flickable.width
|
bottomMargin: 10
|
||||||
height: flickable.height
|
|
||||||
radius: Appearance.rounding.normal
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
spacing: 6
|
||||||
|
|
||||||
ColumnLayout {
|
delegate: VolumeMixerEntry {
|
||||||
id: volumeMixerColumnLayout
|
// Layout.fillWidth: true
|
||||||
anchors.top: parent.top
|
anchors {
|
||||||
anchors.left: parent.left
|
left: parent.left
|
||||||
anchors.right: parent.right
|
right: parent.right
|
||||||
anchors.margins: 10
|
leftMargin: 10
|
||||||
spacing: 10
|
rightMargin: 10
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: root.appPwNodes
|
|
||||||
|
|
||||||
VolumeMixerEntry {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
required property var modelData
|
|
||||||
node: modelData
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
required property var modelData
|
||||||
|
node: modelData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Placeholder when list is empty
|
// Placeholder when list is empty
|
||||||
Item {
|
Item {
|
||||||
anchors.fill: flickable
|
anchors.fill: listView
|
||||||
|
|
||||||
visible: opacity > 0
|
visible: opacity > 0
|
||||||
opacity: (root.appPwNodes.length === 0) ? 1 : 0
|
opacity: (root.appPwNodes.length === 0) ? 1 : 0
|
||||||
@@ -109,6 +98,15 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Separator
|
||||||
|
Rectangle {
|
||||||
|
color: Appearance.m3colors.m3outlineVariant
|
||||||
|
implicitHeight: 1
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Device selector
|
// Device selector
|
||||||
ButtonGroup {
|
ButtonGroup {
|
||||||
id: deviceSelectorRowLayout
|
id: deviceSelectorRowLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user