containments/panel: Use the panel length as the spacer size limit

On a vertical panel, the size spinbox shown in edit mode for a
non-flexible Panel Spacer cannot go beyond the panel's thickness;
we instead use the panel length regardless of orientation.

BUG: 518799
This commit is contained in:
Niccolò Venerandi 2026-10-21 16:46:01 +02:00
parent 64b9cc4f13
commit c4ba517adf
2 changed files with 6 additions and 4 deletions

View file

@ -32,7 +32,7 @@ MouseArea {
required property Component appletContainerComponent
required property bool isHorizontal
required property bool reverse
required property int rootWidth
required property int rootLength
property AppletContainer currentApplet
property int draggedItemIndex
@ -405,7 +405,9 @@ MouseArea {
Kirigami.Heading {
Layout.fillWidth: true
visible: panelSpacerWidth.visible
text: i18nc("@label:spinbox", "Spacer width")
text: configurationArea.isHorizontal
? i18nc("@label:spinbox", "Spacer width")
: i18nc("@label:spinbox", "Spacer height")
textFormat: Text.PlainText
level: 3
horizontalAlignment: Text.AlignHCenter
@ -420,7 +422,7 @@ MouseArea {
&& !configurationArea.currentApplet.applet.Plasmoid.configuration.expanding
from: 0
stepSize: 10
to: configurationArea.rootWidth
to: configurationArea.rootLength
value: configurationArea.currentApplet?.applet.Plasmoid.configuration.length ?? 0
onValueModified: {
configurationArea.currentApplet.applet.Plasmoid.configuration.length = value

View file

@ -140,7 +140,7 @@ ContainmentItem {
"appletContainerComponent": appletContainerComponent,
"dropArea": dropArea,
"isHorizontal": Qt.binding(() => root.isHorizontal),
"rootWidth": Qt.binding(() => root.width),
"rootLength": Qt.binding(() => root.isHorizontal ? root.width : root.height),
"reverse": Qt.binding(() => root.reverse),
"lastSpacer": lastSpacer,
"addWidgetsButton": addWidgetsButton