make volpopup width based on child length instead of hardcoding it

This commit is contained in:
lucy 2026-08-27 00:55:46 +02:00
commit 4e294cb377

View file

@ -10,7 +10,7 @@ import QtQuick.Controls
PopupWindow {
implicitWidth: 400
implicitWidth: audioLayout.implicitWidth + 2 * audioLayout.anchors.margins
implicitHeight: audioLayout.implicitHeight + 24
anchor.edges: Edges.Top | Edges.Right
anchor.gravity: Edges.Bottom | Edges.Left
@ -24,20 +24,21 @@ PopupWindow {
radius: Config.rounding
ColumnLayout {
id: audioLayout
anchors.fill: parent
anchors.centerIn: parent
anchors.margins: 10
spacing: 8
Repeater {
id: audioRep
model: Audio.sinks
delegate: Rectangle {
Layout.fillWidth: true
id: audioDelContainer
color: Colors.activeModuleBg
radius: Config.rounding
required property var modelData
implicitWidth: 380
implicitHeight: audioRow.implicitHeight + 8
implicitWidth: audioRow.implicitWidth
RowLayout {
id: audioRow
@ -49,8 +50,11 @@ PopupWindow {
text: audioDelContainer.modelData.nickname
Layout.leftMargin: 10
Layout.fillWidth: true
Layout.maximumWidth: 200
elide: Text.ElideRight
}
StyledIcon {
Layout.leftMargin: 10
iconName: Audio.getVolumeIcon(audioDelContainer.modelData)
MouseArea {
anchors.fill: parent