Make panels default to spanning the screen axis.

This commit is contained in:
Eike Hein 2013-09-12 19:21:50 +02:00
parent 29d10cc4b5
commit 7c9ad840d1

View File

@ -341,8 +341,6 @@ void PanelView::restore()
m_offset = qMax(0, m_offset); m_offset = qMax(0, m_offset);
} }
m_maxLength = config().readEntry<int>("maxLength", -1);
m_minLength = config().readEntry<int>("minLength", -1);
m_alignment = (Qt::Alignment)config().readEntry<int>("alignment", Qt::AlignLeft); m_alignment = (Qt::Alignment)config().readEntry<int>("alignment", Qt::AlignLeft);
setMinimumSize(QSize(-1, -1)); setMinimumSize(QSize(-1, -1));
@ -350,6 +348,9 @@ void PanelView::restore()
setMaximumSize(screen()->size()); setMaximumSize(screen()->size());
if (containment()->formFactor() == Plasma::Types::Vertical) { if (containment()->formFactor() == Plasma::Types::Vertical) {
m_maxLength = config().readEntry<int>("maxLength", screen()->size().height());
m_minLength = config().readEntry<int>("minLength", screen()->size().height());
const int maxSize = screen()->size().height() - m_offset; const int maxSize = screen()->size().height() - m_offset;
m_maxLength = qBound<int>(MINSIZE, m_maxLength, maxSize); m_maxLength = qBound<int>(MINSIZE, m_maxLength, maxSize);
m_minLength = qBound<int>(MINSIZE, m_minLength, maxSize); m_minLength = qBound<int>(MINSIZE, m_minLength, maxSize);
@ -362,11 +363,14 @@ void PanelView::restore()
//Horizontal //Horizontal
} else { } else {
m_maxLength = config().readEntry<int>("maxLength", screen()->size().width());
m_minLength = config().readEntry<int>("minLength", screen()->size().width());
const int maxSize = screen()->size().width() - m_offset; const int maxSize = screen()->size().width() - m_offset;
m_maxLength = qBound<int>(MINSIZE, m_maxLength, maxSize); m_maxLength = qBound<int>(MINSIZE, m_maxLength, maxSize);
m_minLength = qBound<int>(MINSIZE, m_minLength, maxSize); m_minLength = qBound<int>(MINSIZE, m_minLength, maxSize);
resize(qBound<int>(MINSIZE, config().readEntry<int>("length", screen()->size().height()), maxSize), resize(qBound<int>(MINSIZE, config().readEntry<int>("length", screen()->size().width()), maxSize),
config().readEntry<int>("thickness", 32)); config().readEntry<int>("thickness", 32));
setMinimumWidth(m_minLength); setMinimumWidth(m_minLength);