Commit 6dd8d16f authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Restrict default panel width to the size it would have on a 21:9 screen

This is part of https://phabricator.kde.org/T13156
parent 3e13a78d
......@@ -27,6 +27,19 @@ if (freeEdges["bottom"] == true) {
panel.height = gridUnit * 2
// Restrict horizontal panel to a maximum size of a 21:9 monitor
const maximumAspectRatio = 21/9;
if (panel.formFactor === "horizontal") {
const geo = screenGeometry(panelScreen);
const maximumWidth = Math.ceil(geo.height * maximumAspectRatio);
if (geo.width > maximumWidth) {
panel.alignment = "center";
panel.minimumLength = maximumWidth;
panel.maximumLength = maximumWidth;
}
}
var kickoff = panel.addWidget("org.kde.plasma.kickoff")
kickoff.currentConfigGroup = ["Shortcuts"]
kickoff.writeConfig("global", "Alt+F1")
......
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