korganizer Library API Documentation

koglobals.cpp

00001 #include <qapplication.h>
00002 
00003 #include <kdebug.h>
00004 
00005 #include "koglobals.h"
00006 
00007 void KOGlobals::fitDialogToScreen( QWidget *wid, bool force )
00008 {
00009   bool resized = false;
00010 
00011   int w = wid->frameSize().width();
00012   int h = wid->frameSize().height();  
00013 
00014   if ( w > QApplication::desktop()->size().width() ) {
00015     w = QApplication::desktop()->size().width();
00016     resized = true;
00017   }
00018   if ( h > QApplication::desktop()->size().height() - 30 ) {
00019     h = QApplication::desktop()->size().height() - 30;
00020     resized = true;
00021   }
00022   
00023   if ( resized || force ) {
00024     wid->resize( w, h );
00025     wid->move( 0, 15 );
00026     if ( force ) wid->setFixedSize( w, h );
00027   }
00028 }
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:41:09 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001