diff --git a/shell/scripting/scriptengine_v1.cpp b/shell/scripting/scriptengine_v1.cpp --- a/shell/scripting/scriptengine_v1.cpp +++ b/shell/scripting/scriptengine_v1.cpp @@ -378,7 +378,11 @@ // Basic panel setup panel->setLocation(panelData.property("location").toString()); - panel->setHeight(panelData.property("height").toInteger() * ScriptEngine::gridUnit()); + panel->setHeight(panelData.property("height").toNumber() * ScriptEngine::gridUnit()); + panel->setMaximumLength(panelData.property("maximumLength").toNumber() * ScriptEngine::gridUnit()); + panel->setMinimumLength(panelData.property("minimumLength").toNumber() * ScriptEngine::gridUnit()); + panel->setOffset(panelData.property("offset").toNumber() * ScriptEngine::gridUnit()); + panel->setAlignment(panelData.property("alignment").toString()); // Loading the config for the panel loadSerializedConfigs(panel, panelData.property("config")); diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -435,15 +435,22 @@ : location == Plasma::Types::RightEdge ? "right" : /* Plasma::Types::BottomEdge */ "bottom"); - const qreal units = + const qreal height = // If we do not have a panel, fallback to 4 units !view ? 4 - : location == Plasma::Types::TopEdge ? view->height() / gridUnit - : location == Plasma::Types::LeftEdge ? view->width() / gridUnit - : location == Plasma::Types::RightEdge ? view->width() / gridUnit - : /* Plasma::Types::BottomEdge */ view->height() / gridUnit; - - panelJson.insert("height", units); + : (qreal)view->thickness() / gridUnit; + + panelJson.insert("height", height); + if (view) { + const auto alignment = view->alignment(); + panelJson.insert("maximumLength", (qreal)view->maximumLength() / gridUnit); + panelJson.insert("minimumLength", (qreal)view->minimumLength() / gridUnit); + panelJson.insert("offset", (qreal)view->offset() / gridUnit); + panelJson.insert("alignment", + alignment == Qt::AlignRight ? "right" + : alignment == Qt::AlignCenter ? "center" + : "left"); + } // Saving the config keys const KConfigGroup contConfig = cont->config();