diff --git a/containments/panel/contents/config/main.xml b/containments/panel/contents/config/main.xml --- a/containments/panel/contents/config/main.xml +++ b/containments/panel/contents/config/main.xml @@ -9,6 +9,9 @@ + + + diff --git a/containments/panel/contents/ui/ConfigOverlay.qml b/containments/panel/contents/ui/ConfigOverlay.qml --- a/containments/panel/contents/ui/ConfigOverlay.qml +++ b/containments/panel/contents/ui/ConfigOverlay.qml @@ -378,6 +378,39 @@ Layout.leftMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2 } + PlasmaComponents.ToolButton { + id: fixedSizeButton + Layout.fillWidth: true + iconSource: "distribute-horizontal-x" + visible: currentApplet.expandingApplet + text: i18n("Non-expanding") + tooltip: i18n("Make applet non-expanding") + + checkable: true + checked: currentApplet && currentApplet.fixedSize + Connections { + target: configurationArea + onCurrentAppletChanged: { + fixedSizeButton.checked = currentApplet && currentApplet.fixedSize; + } + } + + onClicked: { + tooltip.visible = false; + if (currentApplet.applet.pluginName == "org.kde.plasma.panelspacer") { + currentApplet.applet.configuration.expanding = !currentApplet.applet.configuration.expanding; + return; + } + var tmp = plasmoid.configuration.fixedSizeOverride; + var index = tmp.indexOf(currentApplet.applet.id) + if (index != -1) { + tmp.splice(index, 1); + } else { + tmp.push(currentApplet.applet.id); + } + plasmoid.configuration.fixedSizeOverride = tmp; + } + } PlasmaComponents.ToolButton { id: configureButton Layout.fillWidth: true diff --git a/containments/panel/contents/ui/main.qml b/containments/panel/contents/ui/main.qml --- a/containments/panel/contents/ui/main.qml +++ b/containments/panel/contents/ui/main.qml @@ -251,19 +251,27 @@ Loader { id: container visible: false + property bool expandingApplet: applet && + (applet.pluginName == "org.kde.plasma.panelspacer" || + (plasmoid.formFactor != PlasmaCore.Types.Vertical ? applet.Layout.fillWidth : applet.Layout.fillHeight)) + property bool fixedSize: applet && + (applet.pluginName == "org.kde.plasma.panelspacer" ? + !applet.configuration.expanding : + (plasmoid.configuration.fixedSizeOverride.indexOf(applet.id) != -1)) + property bool animationsEnabled: true //when the applet moves caused by its resize, don't animate. //this is completely heuristic, but looks way less "jumpy" property bool movingForResize: false - Layout.fillWidth: applet && applet.Layout.fillWidth + Layout.fillWidth: applet && applet.Layout.fillWidth && !fixedSize Layout.onFillWidthChanged: { if (plasmoid.formFactor !== PlasmaCore.Types.Vertical) { checkLastSpacer(); } } - Layout.fillHeight: applet && applet.Layout.fillHeight + Layout.fillHeight: applet && applet.Layout.fillHeight && !fixedSize Layout.onFillHeightChanged: { if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { checkLastSpacer();