Allow the user to change the absolute min and max widget sizes.

It's not hardcoded anymore
This commit is contained in:
Sergio Martins
2020-12-19 15:34:37 +00:00
parent ae5edc9ebf
commit 613b1b8524
8 changed files with 78 additions and 30 deletions

View File

@@ -145,14 +145,13 @@ void QWidgetAdapter::raise()
QSize QWidgetAdapter::minimumSize() const
{
const QSize min = property("kddockwidgets_min_size").toSize();
return min.expandedTo({KDDOCKWIDGETS_MIN_WIDTH, KDDOCKWIDGETS_MIN_HEIGHT});
return min.expandedTo(Layouting::Item::hardcodedMinimumSize);
}
QSize QWidgetAdapter::maximumSize() const
{
const QSize max = property("kddockwidgets_max_size").toSize();
const QSize defaultMax(KDDOCKWIDGETS_MAX_WIDTH, KDDOCKWIDGETS_MAX_HEIGHT);
return max.isEmpty() ? defaultMax
return max.isEmpty() ? Layouting::Item::hardcodedMaximumSize
: max.boundedTo(defaultMax);
}