Verified Commit 9d08b997 authored by Fushan Wen's avatar Fushan Wen
Browse files

shell: Fix panel sometimes getting shortened when dragging

`positionPanel()` must be called first to make sure formFactor is
updated, or `maxSize` will be incorrect.

BUG: 435240
parent e18c2b1b
......@@ -628,6 +628,9 @@ void PanelView::restore()
// FIXME: an invalid size doesn't work with QWindows
m_initCompleted = true;
const int side = containment()->formFactor() == Plasma::Types::Vertical ? screenSize.height() : screenSize.width();
const int maxSize = side - m_offset;
m_maxLength = qBound<int>(MINSIZE, readConfigValueWithFallBack("maxLength", side), maxSize);
......@@ -640,9 +643,7 @@ void PanelView::restore()
setVisibilityMode((VisibilityMode)panelConfig.parent().readEntry<int>("panelVisibility", panelConfig.readEntry<int>("panelVisibility", (int)NormalPanel)));
configDefaults().parent().readEntry<int>("panelOpacity", PanelView::OpacityMode::Adaptive)));
m_initCompleted = true;
Q_EMIT maximumLengthChanged();
Q_EMIT minimumLengthChanged();
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