adjust maximumWidth when adjusting offset, if needed

This commit is contained in:
Marco Martin 2014-02-18 13:42:14 +01:00
parent ef0832787a
commit 553055e6d3

View File

@ -167,6 +167,16 @@ void PanelView::setOffset(int offset)
return;
}
if (formFactor() == Plasma::Types::Vertical) {
if (offset + m_maxLength > screen()->size().height()) {
setMaximumLength( -m_offset + screen()->size().height() );
}
} else {
if (offset + m_maxLength > screen()->size().width()) {
setMaximumLength( -m_offset + screen()->size().width() );
}
}
m_offset = offset;
config().writeEntry("offset", m_offset);
positionPanel();