Commit 56513036 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[plasmoidconfig] Fix sizing for some configurations

We'd like to rely on the config to give us an appropriate
implicitHeight, but some configs do the opposite and assume they fill
the parent. The old code resolved this by making the config at least as
high as its parent. Reintroduce that.

This is arguably all very ugly and should be resolved properly, but that
requires changing the configs themselves, which is infeasible for Plasma
5 with regards to third-party applets

BUG: 429797
parent 7ed963fa
...@@ -44,9 +44,13 @@ Kirigami.ScrollablePage { ...@@ -44,9 +44,13 @@ Kirigami.ScrollablePage {
Loader { Loader {
id: loader id: loader
width: parent.width width: parent.width
// HACK the height of the loader is based on the implicitHeight of the content // HACK the height of the loader is based on the implicitHeight of the content.
// If the content item doesn't set one fall back to the height of its children // Unfortunately not all content items have a sensible implicitHeight.
height: item.implicitHeight ? item.implicitHeight : item.childrenRect.height // If it is zero fall back to the height of its children
// Also make it at least as high as the page itself. Some existing configs assume they fill the whole space
// TODO KF6 clean this up by making all configs based on SimpleKCM/ScrollViewKCM/GridViewKCM
height: Math.max(root.availableHeight, item.implicitHeight ? item.implicitHeight : item.childrenRect.height)
Component.onCompleted: { Component.onCompleted: {
var plasmoidConfig = plasmoid.configuration var plasmoidConfig = plasmoid.configuration
Supports Markdown
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