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

[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 {
RowLayout {
spacing: Kirigami.Units.smallSpacing
Layout.minimumHeight: portbox.implicitHeight
Layout.fillWidth: true
RadioButton {
id: defaultButton
// Maximum width of the button need to match the text. Empty area must not change the default device.
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.fillWidth: true
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
spacing: Kirigami.Units.smallSpacing + Math.round((muteButton.width - defaultButton.indicator.width) / 2)
......@@ -59,18 +55,12 @@ ColumnLayout {
Label {
id: soloLabel
Layout.maximumWidth: delegate.width
- (portbox.visible ? Kirigami.Units.gridUnit + portLabel.implicitWidth + Kirigami.Units.smallSpacing + portbox.implicitWidth : 0)
- balanceButton.width
Layout.fillWidth: true
text: defaultButton.text
visible: delegate.ListView.view.count <= 1
elide: Text.ElideRight
}
Item {
Layout.fillWidth: true
}
Label {
id: portLabel
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