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 @@ -18,6 +18,7 @@ import QtQuick 2.1 import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.3 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents @@ -378,6 +379,37 @@ currentApplet.applet.action("configure").trigger() } } + PlasmaComponents.ToolButton { + id: fixedSizeButton + anchors.verticalCenter: parent.verticalCenter + iconSource: "distribute-horizontal-x" + visible: currentApplet.expandingApplet + tooltip: i18n("Make applet non-expanding size") + + checkable: true + checked: currentApplet && currentApplet.fixedSize + Connections { + target: configurationArea + onCurrentAppletChanged: { + fixedSizeButton.checked = currentApplet && currentApplet.fixedSize + } + } + + onClicked: { + 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.Label { id: label anchors.verticalCenter: parent.verticalCenter 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();