slightly more reliable formfactor switching

This commit is contained in:
Marco Martin 2013-05-09 13:52:51 +02:00
parent 3658a71935
commit 1d6382d48c

View File

@ -305,25 +305,28 @@ void PanelView::restore()
setMaximumSize(QSize(10000, 10000)); setMaximumSize(QSize(10000, 10000));
if (containment()->formFactor() == Plasma::Vertical) { if (containment()->formFactor() == Plasma::Vertical) {
resize(config().readEntry<int>("thickness", 32),
config().readEntry<int>("length", screen()->size().height()));
if (m_minLength > 0) { if (m_minLength > 0) {
setMinimumHeight(m_minLength); setMinimumHeight(m_minLength);
} }
if (m_maxLength > 0) { if (m_maxLength > 0) {
setMaximumHeight(m_maxLength); setMaximumHeight(m_maxLength);
} }
resize(config().readEntry<int>("thickness", 32),
config().readEntry<int>("length", screen()->size().height()));
//Horizontal //Horizontal
} else { } else {
resize(config().readEntry<int>("length", screen()->size().width()),
config().readEntry<int>("thickness", 32));
if (m_minLength > 0) { if (m_minLength > 0) {
setMinimumWidth(m_minLength); setMinimumWidth(m_minLength);
} }
if (m_maxLength > 0) { if (m_maxLength > 0) {
setMaximumWidth(m_maxLength); setMaximumWidth(m_maxLength);
} }
resize(config().readEntry<int>("length", screen()->size().width()),
config().readEntry<int>("thickness", 32));
} }
emit maximumLengthChanged(); emit maximumLengthChanged();