@ -461,19 +461,33 @@ QRect PanelView::geometryByDistance(int distance) const
void PanelView : : resizePanel ( )
void PanelView : : resizePanel ( )
{
{
QSize targetSize ;
QSize targetMinSize ;
QSize targetMaxSize ;
if ( formFactor ( ) = = Plasma : : Types : : Vertical ) {
if ( formFactor ( ) = = Plasma : : Types : : Vertical ) {
const int minSize = qMax ( MINSIZE , m_minLength ) ;
const int minSize = qMax ( MINSIZE , m_minLength ) ;
const int maxSize = qMin ( m_maxLength , m_screenToFollow - > size ( ) . height ( ) - m_offset ) ;
const int maxSize = qMin ( m_maxLength , m_screenToFollow - > size ( ) . height ( ) - m_offset ) ;
setMinimumSize ( QSize ( thickness ( ) , minSize ) ) ;
targetMinSize = QSize ( thickness ( ) , minSize ) ;
setMaximumSize ( QSize ( thickness ( ) , maxSize ) ) ;
targetMaxSize = QSize ( thickness ( ) , maxSize ) ;
res ize ( thickness ( ) , qBound ( minSize , m_contentLength , maxSize ) ) ;
ta rgetSiz e = QS ize ( thickness ( ) , qBound ( minSize , m_contentLength , maxSize ) ) ;
} else {
} else {
const int minSize = qMax ( MINSIZE , m_minLength ) ;
const int minSize = qMax ( MINSIZE , m_minLength ) ;
const int maxSize = qMin ( m_maxLength , m_screenToFollow - > size ( ) . width ( ) - m_offset ) ;
const int maxSize = qMin ( m_maxLength , m_screenToFollow - > size ( ) . width ( ) - m_offset ) ;
setMinimumSize ( QSize ( minSize , thickness ( ) ) ) ;
targetMinSize = QSize ( minSize , thickness ( ) ) ;
setMaximumSize ( QSize ( maxSize , thickness ( ) ) ) ;
targetMaxSize = QSize ( maxSize , thickness ( ) ) ;
resize ( qBound ( minSize , m_contentLength , maxSize ) , thickness ( ) ) ;
targetSize = QSize ( qBound ( minSize , m_contentLength , maxSize ) , thickness ( ) ) ;
}
if ( minimumSize ( ) ! = targetMinSize ) {
setMinimumSize ( targetMinSize ) ;
}
if ( maximumSize ( ) ! = targetMaxSize ) {
setMaximumSize ( targetMaxSize ) ;
}
}
if ( size ( ) ! = targetSize ) {
resize ( targetSize ) ;
}
//position will be updated implicitly from resizeEvent
//position will be updated implicitly from resizeEvent
}
}