From a50334dddaa542fd63726a639e852c30036f53a0 Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 20 Dec 2004 22:11:44 +0000 Subject: Restore Files: -QWSDecoration scaling fixes by mickeyl -Readd macros for DEPRECATED and VISIBILITY -Move out showWidget and execDialog to widget_sowing.cpp -QPE_EXPORT_SYMBOL for Q_EXPORT_INTERFACE -Deprecated for FileSelector, QPEMenubar and Toolbar --- (limited to 'library/widget_showing.cpp') diff --git a/library/widget_showing.cpp b/library/widget_showing.cpp new file mode 100644 index 0000000..43ece64 --- a/dev/null +++ b/library/widget_showing.cpp @@ -0,0 +1,74 @@ +/* + This file is part of the OPIE Project + Copyright (c) 2004 Andreas Richter + Copyright (c) 2004 Holger Hans Peter Freyther +               =. +             .=l. +           .>+-= + _;:,     .>    :=|. This library is free software; you can +.> <`_,   >  .   <= redistribute it and/or modify it under +:`=1 )Y*s>-.--   : the terms of the GNU Library General Public +.="- .-=="i,     .._ License as published by the Free Software + - .   .-<_>     .<> Foundation; either version 2 of the License, +     ._= =}       : or (at your option) any later version. +    .%`+i>       _;_. +    .i_,=:_.      -`: PARTICULAR PURPOSE. See the GNU +..}^=.=       =       ; Library General Public License for more +++=   -.     .`     .: details. + :     =  ...= . :.=- + -.   .:....=;==+<; You should have received a copy of the GNU +  -_. . .   )=.  = Library General Public License along with +    --        :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#include + +#ifdef Q_WS_QWS +extern Q_EXPORT QRect qt_maxWindowRect; +#endif + +void QPEApplication::showDialog( QDialog* d, bool nomax ) +{ + showWidget( d, nomax ); +} + +int QPEApplication::execDialog( QDialog* d, bool nomax ) +{ + showDialog( d, nomax ); + return d->exec(); +} + +void QPEApplication::showWidget( QWidget* wg, bool nomax ) { + if ( wg->isVisible() ) { + wg->show(); + return; + } + + if ( !nomax + && ( qApp->desktop()->width() <= 320 ) ){ + wg->showMaximized(); + } else { +#ifdef Q_WS_QWS + QSize desk = QSize( qApp->desktop()->width(), qApp->desktop()->height() ); +#else + QSize desk = QSize( qt_maxWindowRect.width(), qt_maxWindowRect.height() ); +#endif + + QSize sh = wg->sizeHint(); + int w = QMAX( sh.width(), wg->width() ); + int h = QMAX( sh.height(), wg->height() ); +// desktop widget-frame taskbar + w = QMIN( w, ( desk.width() - ( wg->frameGeometry().width() - wg->geometry().width() ) - 25 ) ); + h = QMIN( h, ( desk.height() - ( wg->frameGeometry().height() - wg->geometry().height() ) - 25 ) ); + wg->resize( w, h ); + wg->show(); + } +} -- cgit v0.9.0.2