Commit 29eba39c authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[kcm] Fix layouting issues

The DeviceListItem's content was sometimes lacking proper padding to the
right, caused by internal layouting issues.
parent 24a4a741
...@@ -39,15 +39,11 @@ ColumnLayout { ...@@ -39,15 +39,11 @@ ColumnLayout {
RowLayout { RowLayout {
spacing: Kirigami.Units.smallSpacing spacing: Kirigami.Units.smallSpacing
Layout.minimumHeight: portbox.implicitHeight Layout.fillWidth: true
RadioButton { RadioButton {
id: defaultButton id: defaultButton
// Maximum width of the button need to match the text. Empty area must not change the default device. Layout.fillWidth: true
Layout.maximumWidth: delegate.width - Layout.leftMargin - Layout.rightMargin
- (portbox.visible ? Kirigami.Units.gridUnit + portLabel.implicitWidth + Kirigami.Units.smallSpacing + portbox.implicitWidth : 0)
- balanceButton.width
// Margins and spacing are set to center RadioButton with muteButton, and text with VolumeSlider.
Layout.leftMargin: LayoutMirroring.enabled ? 0 : Math.round((muteButton.width - defaultButton.indicator.width) / 2) Layout.leftMargin: LayoutMirroring.enabled ? 0 : Math.round((muteButton.width - defaultButton.indicator.width) / 2)
Layout.rightMargin: LayoutMirroring.enabled ? Math.round((muteButton.width - defaultButton.indicator.width) / 2) : 0 Layout.rightMargin: LayoutMirroring.enabled ? Math.round((muteButton.width - defaultButton.indicator.width) / 2) : 0
spacing: Kirigami.Units.smallSpacing + Math.round((muteButton.width - defaultButton.indicator.width) / 2) spacing: Kirigami.Units.smallSpacing + Math.round((muteButton.width - defaultButton.indicator.width) / 2)
...@@ -59,18 +55,12 @@ ColumnLayout { ...@@ -59,18 +55,12 @@ ColumnLayout {
Label { Label {
id: soloLabel id: soloLabel
Layout.maximumWidth: delegate.width Layout.fillWidth: true
- (portbox.visible ? Kirigami.Units.gridUnit + portLabel.implicitWidth + Kirigami.Units.smallSpacing + portbox.implicitWidth : 0)
- balanceButton.width
text: defaultButton.text text: defaultButton.text
visible: delegate.ListView.view.count <= 1 visible: delegate.ListView.view.count <= 1
elide: Text.ElideRight elide: Text.ElideRight
} }
Item {
Layout.fillWidth: true
}
Label { Label {
id: portLabel id: portLabel
visible: portbox.visible visible: portbox.visible
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment