When trying to keep a window fully inside an area, shrink if necessary and possible.

svn path=/trunk/KDE/kdebase/workspace/; revision=814467
remotes/origin/Plasma/5.0
Luboš Luňák 18 years ago
parent 71ecd9c64e
commit 22b3584b8d
  1. 5
      geometry.cpp

@ -700,6 +700,11 @@ void Client::keepInArea( QRect area, bool partial )
area.setRight( qMax( area.right() + width() - 100, area.right()));
area.setBottom( qMax( area.bottom() + height() - 100, area.bottom()));
}
if( !partial )
{ // resize to fit into area
if( area.width() < width() || area.height() < height())
resizeWithChecks( qMin( area.width(), width()), qMin( area.height(), height()));
}
if ( geometry().right() > area.right() && width() < area.width() )
move( area.right() - width(), y() );
if ( geometry().bottom() > area.bottom() && height() < area.height() )

Loading…
Cancel
Save