-rw-r--r-- | library/qpeapplication.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 2ef60d5..7f8299a 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -47,12 +47,13 @@ | |||
47 | #include <qdialog.h> | 47 | #include <qdialog.h> |
48 | #include <qdragobject.h> | 48 | #include <qdragobject.h> |
49 | #include <qtextcodec.h> | 49 | #include <qtextcodec.h> |
50 | #include <qevent.h> | 50 | #include <qevent.h> |
51 | #include <qtooltip.h> | 51 | #include <qtooltip.h> |
52 | #include <qsignal.h> | 52 | #include <qsignal.h> |
53 | #include <qmainwindow.h> | ||
53 | #include "qpeapplication.h" | 54 | #include "qpeapplication.h" |
54 | #include "qpestyle.h" | 55 | #include "qpestyle.h" |
55 | #include "styleinterface.h" | 56 | #include "styleinterface.h" |
56 | #if QT_VERSION >= 300 | 57 | #if QT_VERSION >= 300 |
57 | #include <qstylefactory.h> | 58 | #include <qstylefactory.h> |
58 | #else | 59 | #else |
@@ -143,12 +144,18 @@ public: | |||
143 | #endif | 144 | #endif |
144 | 145 | ||
145 | qcopq.clear(); | 146 | qcopq.clear(); |
146 | } | 147 | } |
147 | static void show_mx(QWidget* mw, bool nomaximize) | 148 | static void show_mx(QWidget* mw, bool nomaximize) |
148 | { | 149 | { |
150 | |||
151 | // ugly hack, remove that later after finding a sane solution | ||
152 | if ( QPEApplication::desktop() ->width() >= 600 && ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) ) { | ||
153 | ( ( QMainWindow* ) mw )->setUsesBigPixmaps( true ); | ||
154 | } | ||
155 | |||
149 | if ( mw->layout() && mw->inherits("QDialog") ) { | 156 | if ( mw->layout() && mw->inherits("QDialog") ) { |
150 | QPEApplication::showDialog((QDialog*)mw, nomaximize); | 157 | QPEApplication::showDialog((QDialog*)mw, nomaximize); |
151 | } | 158 | } |
152 | else { | 159 | else { |
153 | #ifdef Q_WS_QWS | 160 | #ifdef Q_WS_QWS |
154 | if ( !nomaximize ) | 161 | if ( !nomaximize ) |
@@ -505,22 +512,22 @@ static void setTreble( int t = 0, int percent = -1 ) | |||
505 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) | 512 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) |
506 | : QApplication( argc, argv, t ) | 513 | : QApplication( argc, argv, t ) |
507 | { | 514 | { |
508 | d = new QPEApplicationData; | 515 | d = new QPEApplicationData; |
509 | d->loadTextCodecs(); | 516 | d->loadTextCodecs(); |
510 | d->loadImageCodecs(); | 517 | d->loadImageCodecs(); |
511 | int dw = desktop() ->width(); | 518 | int dw = desktop() ->width(); |
512 | 519 | ||
513 | if ( dw < 200 ) { | 520 | if ( dw < 200 ) { |
514 | setFont( QFont( "helvetica", 8 ) ); | 521 | setFont( QFont( "helvetica", 8 ) ); |
515 | AppLnk::setSmallIconSize( 10 ); | 522 | AppLnk::setSmallIconSize( 10 ); |
516 | AppLnk::setBigIconSize( 28 ); | 523 | AppLnk::setBigIconSize( 28 ); |
517 | } | 524 | } |
518 | else if ( dw > 600 ) { | 525 | else if ( dw > 600 ) { |
519 | setFont( QFont( "helvetica", 18 ) ); | 526 | setFont( QFont( "helvetica", 18 ) ); |
520 | AppLnk::setSmallIconSize( 24 ); | 527 | AppLnk::setSmallIconSize( 24 ); |
521 | AppLnk::setBigIconSize( 48 ); | 528 | AppLnk::setBigIconSize( 48 ); |
522 | } | 529 | } |
523 | else if ( dw > 200 ) { | 530 | else if ( dw > 200 ) { |
524 | setFont( QFont( "helvetica", 10 ) ); | 531 | setFont( QFont( "helvetica", 10 ) ); |
525 | AppLnk::setSmallIconSize( 14 ); | 532 | AppLnk::setSmallIconSize( 14 ); |
526 | AppLnk::setBigIconSize( 32 ); | 533 | AppLnk::setBigIconSize( 32 ); |
@@ -860,12 +867,14 @@ bool QPEApplication::qwsEventFilter( QWSEvent * e ) | |||
860 | if ( m == AlwaysOff ) | 867 | if ( m == AlwaysOff ) |
861 | Global::hideInputMethod(); | 868 | Global::hideInputMethod(); |
862 | if ( m == AlwaysOn ) | 869 | if ( m == AlwaysOn ) |
863 | Global::showInputMethod(); | 870 | Global::showInputMethod(); |
864 | } | 871 | } |
865 | } | 872 | } |
873 | |||
874 | |||
866 | return QApplication::qwsEventFilter( e ); | 875 | return QApplication::qwsEventFilter( e ); |
867 | } | 876 | } |
868 | #endif | 877 | #endif |
869 | 878 | ||
870 | /*! | 879 | /*! |
871 | Destroys the QPEApplication. | 880 | Destroys the QPEApplication. |
@@ -1314,13 +1323,13 @@ void QPEApplication::pidMessage( const QCString& msg, const QByteArray& data) | |||
1314 | consider passing TRUE for \a nomaximize rather than the default FALSE. | 1323 | consider passing TRUE for \a nomaximize rather than the default FALSE. |
1315 | 1324 | ||
1316 | \sa showMainDocumentWidget() | 1325 | \sa showMainDocumentWidget() |
1317 | */ | 1326 | */ |
1318 | void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize ) | 1327 | void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize ) |
1319 | { | 1328 | { |
1320 | d->show(mw, nomaximize ); | 1329 | d->show(mw, nomaximize ); |
1321 | } | 1330 | } |
1322 | 1331 | ||
1323 | /*! | 1332 | /*! |
1324 | Sets widget \a mw as the mainWidget() and shows it. For small windows, | 1333 | Sets widget \a mw as the mainWidget() and shows it. For small windows, |
1325 | consider passing TRUE for \a nomaximize rather than the default FALSE. | 1334 | consider passing TRUE for \a nomaximize rather than the default FALSE. |
1326 | 1335 | ||
@@ -1333,12 +1342,13 @@ void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize ) | |||
1333 | */ | 1342 | */ |
1334 | void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) | 1343 | void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) |
1335 | { | 1344 | { |
1336 | if ( mw && argc() == 2 ) | 1345 | if ( mw && argc() == 2 ) |
1337 | Global::setDocument( mw, QString::fromUtf8(argv()[1]) ); | 1346 | Global::setDocument( mw, QString::fromUtf8(argv()[1]) ); |
1338 | 1347 | ||
1348 | |||
1339 | d->show(mw, nomaximize ); | 1349 | d->show(mw, nomaximize ); |
1340 | } | 1350 | } |
1341 | 1351 | ||
1342 | 1352 | ||
1343 | /*! | 1353 | /*! |
1344 | If an application is started via a \link qcop.html QCop\endlink | 1354 | If an application is started via a \link qcop.html QCop\endlink |