make volpopup width based on child length instead of hardcoding it
This commit is contained in:
parent
16e16c341b
commit
4e294cb377
1 changed files with 8 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ import QtQuick.Controls
|
||||||
|
|
||||||
|
|
||||||
PopupWindow {
|
PopupWindow {
|
||||||
implicitWidth: 400
|
implicitWidth: audioLayout.implicitWidth + 2 * audioLayout.anchors.margins
|
||||||
implicitHeight: audioLayout.implicitHeight + 24
|
implicitHeight: audioLayout.implicitHeight + 24
|
||||||
anchor.edges: Edges.Top | Edges.Right
|
anchor.edges: Edges.Top | Edges.Right
|
||||||
anchor.gravity: Edges.Bottom | Edges.Left
|
anchor.gravity: Edges.Bottom | Edges.Left
|
||||||
|
|
@ -24,20 +24,21 @@ PopupWindow {
|
||||||
radius: Config.rounding
|
radius: Config.rounding
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: audioLayout
|
id: audioLayout
|
||||||
anchors.fill: parent
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
spacing: 8
|
spacing: 8
|
||||||
Repeater {
|
Repeater {
|
||||||
|
id: audioRep
|
||||||
model: Audio.sinks
|
model: Audio.sinks
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
|
Layout.fillWidth: true
|
||||||
id: audioDelContainer
|
id: audioDelContainer
|
||||||
color: Colors.activeModuleBg
|
color: Colors.activeModuleBg
|
||||||
radius: Config.rounding
|
radius: Config.rounding
|
||||||
required property var modelData
|
required property var modelData
|
||||||
implicitWidth: 380
|
|
||||||
implicitHeight: audioRow.implicitHeight + 8
|
implicitHeight: audioRow.implicitHeight + 8
|
||||||
|
implicitWidth: audioRow.implicitWidth
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: audioRow
|
id: audioRow
|
||||||
|
|
@ -49,8 +50,11 @@ PopupWindow {
|
||||||
text: audioDelContainer.modelData.nickname
|
text: audioDelContainer.modelData.nickname
|
||||||
Layout.leftMargin: 10
|
Layout.leftMargin: 10
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.maximumWidth: 200
|
||||||
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
StyledIcon {
|
StyledIcon {
|
||||||
|
Layout.leftMargin: 10
|
||||||
iconName: Audio.getVolumeIcon(audioDelContainer.modelData)
|
iconName: Audio.getVolumeIcon(audioDelContainer.modelData)
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue