Commit bd7c146a authored by George Vogiatzis's avatar George Vogiatzis Committed by Nate Graham

[Applet]Fix device label problems

Summary:
Limit label maximum width, to avoid breaking UI.
Change label to use plasma components 3, for theme color compatibility.
Use of implicit sizes, to avoid binding loops.

BUG: 417074
BUG: 417106

Test Plan:
Use applet outside of systemtray and limit it's width.
If device description is not long enough, enable in the configuration
"Add virtual output device for simultaneous output on all local sound cars".
Before: Hamburger menu moves to the right, and there is no eliding.
After: Proper display.
{F8080583}

Reviewers: #plasma, #vdg, drosca, ngraham, davidedmundson

Reviewed By: #vdg, ngraham

Subscribers: cfeck, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27117
parent ccdeb932
......@@ -53,7 +53,8 @@ PlasmaComponents.ListItem {
height: column.height
RowLayout {
id: rowLayout
id: controlsRow
spacing: units.smallSpacing
anchors.left: parent.left
anchors.right: parent.right
......@@ -108,10 +109,13 @@ PlasmaComponents.ListItem {
spacing: 0
RowLayout {
Layout.minimumHeight: contextMenuButton.height
Layout.minimumHeight: contextMenuButton.implicitHeight
PlasmaComponents3.RadioButton {
id: defaultButton
// Maximum width of the button need to match the text. Empty area must not change the default device.
Layout.maximumWidth: controlsRow.width - Layout.leftMargin - Layout.rightMargin
- (contextMenuButton.visible ? contextMenuButton.implicitWidth + units.smallSpacing * 2 : 0)
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: units.smallSpacing + Math.round((muteButton.width - defaultButton.indicator.width) / 2)
......@@ -120,8 +124,9 @@ PlasmaComponents.ListItem {
onClicked: PulseObject.default = true;
}
Label {
PlasmaComponents3.Label {
id: soloLabel
Layout.fillWidth: true
text: defaultButton.text
visible: !defaultButton.visible
elide: Text.ElideRight
......@@ -129,6 +134,7 @@ PlasmaComponents.ListItem {
Item {
Layout.fillWidth: true
visible: contextMenuButton.visble
}
SmallToolButton {
......
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