-rw-r--r-- | library/qpeapplication.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 4adfc8f..43a9be5 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -197,57 +197,57 @@ public: | |||
197 | delete r; | 197 | delete r; |
198 | } | 198 | } |
199 | } | 199 | } |
200 | 200 | ||
201 | static void show_mx(QWidget* mw, bool nomaximize, QString &strName) | 201 | static void show_mx(QWidget* mw, bool nomaximize, QString &strName) { |
202 | { | 202 | if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) |
203 | if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) | 203 | { |
204 | { | 204 | ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); |
205 | ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); | 205 | } |
206 | } | ||
207 | QPoint p; | 206 | QPoint p; |
208 | QSize s; | 207 | QSize s; |
209 | bool max; | 208 | bool max; |
210 | if ( mw->isVisible() ) { | ||
211 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | ||
212 | mw->resize(s); | ||
213 | mw->move(p); | ||
214 | } | ||
215 | mw->raise(); | ||
216 | } else { | ||
217 | 209 | ||
218 | if ( mw->layout() && mw->inherits("QDialog") ) { | 210 | if ( mw->isVisible() ) { |
219 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | 211 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { |
220 | mw->resize(s); | 212 | mw->resize(s); |
221 | mw->move(p); | 213 | mw->move(p); |
214 | } | ||
215 | mw->raise(); | ||
216 | } else { | ||
222 | 217 | ||
223 | if ( max && !nomaximize ) { | 218 | if ( mw->layout() && mw->inherits("QDialog") ) { |
224 | mw->showMaximized(); | 219 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { |
225 | } else { | 220 | mw->resize(s); |
226 | mw->show(); | 221 | mw->move(p); |
222 | |||
223 | if ( max && !nomaximize ) { | ||
224 | mw->showMaximized(); | ||
225 | } else { | ||
226 | mw->show(); | ||
227 | } | ||
228 | } else { | ||
229 | QPEApplication::showDialog((QDialog*)mw,nomaximize); | ||
227 | } | 230 | } |
228 | } else { | 231 | } else { |
229 | QPEApplication::showDialog((QDialog*)mw,nomaximize); | 232 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { |
230 | } | 233 | mw->resize(s); |
231 | } else { | 234 | mw->move(p); |
232 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | 235 | } else { //no stored rectangle, make an estimation |
233 | mw->resize(s); | 236 | int x = (qApp->desktop()->width()-mw->frameGeometry().width())/2; |
234 | mw->move(p); | 237 | int y = (qApp->desktop()->height()-mw->frameGeometry().height())/2; |
235 | } else { //no stored rectangle, make an estimation | 238 | mw->move( QMAX(x,0), QMAX(y,0) ); |
236 | int x = (qApp->desktop()->width()-mw->frameGeometry().width())/2; | ||
237 | int y = (qApp->desktop()->height()-mw->frameGeometry().height())/2; | ||
238 | mw->move( QMAX(x,0), QMAX(y,0) ); | ||
239 | #ifdef Q_WS_QWS | 239 | #ifdef Q_WS_QWS |
240 | if ( !nomaximize ) | 240 | if ( !nomaximize ) |
241 | mw->showMaximized(); | 241 | mw->showMaximized(); |
242 | #endif | 242 | #endif |
243 | } | ||
244 | if ( max && !nomaximize ) | ||
245 | mw->showMaximized(); | ||
246 | else | ||
247 | mw->show(); | ||
248 | } | ||
243 | } | 249 | } |
244 | if ( max && !nomaximize ) | ||
245 | mw->showMaximized(); | ||
246 | else | ||
247 | mw->show(); | ||
248 | } | ||
249 | } | ||
250 | } | 250 | } |
251 | 251 | ||
252 | static bool read_widget_rect(const QString &app, bool &maximized, QPoint &p, QSize &s) | 252 | static bool read_widget_rect(const QString &app, bool &maximized, QPoint &p, QSize &s) |
253 | { | 253 | { |