author | llornkcor <llornkcor> | 2004-04-25 08:45:33 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-04-25 08:45:33 (UTC) |
commit | fc1f0001f53f57b625f337a68532984959e6d8dd (patch) (unidiff) | |
tree | c333201e13d7b17a64fcdb1af5805a8b19af6b73 | |
parent | 73f0c227fc94bc4dea12e4eb2384bdff2e9561eb (diff) | |
download | opie-fc1f0001f53f57b625f337a68532984959e6d8dd.zip opie-fc1f0001f53f57b625f337a68532984959e6d8dd.tar.gz opie-fc1f0001f53f57b625f337a68532984959e6d8dd.tar.bz2 |
fix persistence in other widgets
-rw-r--r-- | library/qpeapplication.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 90cd5f1..ae1632e 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -175,27 +175,31 @@ public: | |||
175 | 175 | ||
176 | static void show_mx(QWidget* mw, bool nomaximize, QString &strName/* = QString::null */) | 176 | static void show_mx(QWidget* mw, bool nomaximize, QString &strName/* = QString::null */) |
177 | { | 177 | { |
178 | QPoint p; | ||
179 | QSize s; | ||
180 | bool max; | ||
178 | if ( mw->isVisible() ) { | 181 | if ( mw->isVisible() ) { |
182 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | ||
183 | mw->resize(s); | ||
184 | mw->move(p); | ||
185 | } | ||
179 | mw->raise(); | 186 | mw->raise(); |
180 | } else { | 187 | } else { |
181 | QPoint p; | ||
182 | QSize s; | ||
183 | 188 | ||
184 | if ( mw->layout() && mw->inherits("QDialog") ) { | 189 | if ( mw->layout() && mw->inherits("QDialog") ) { |
185 | bool max; | ||
186 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | 190 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { |
187 | mw->resize(s); | 191 | mw->resize(s); |
188 | mw->move(p); | 192 | mw->move(p); |
189 | 193 | ||
190 | if ( max && !nomaximize ) | 194 | if ( max && !nomaximize ) { |
191 | mw->showMaximized(); | 195 | mw->showMaximized(); |
192 | else | 196 | } else { |
193 | mw->show(); | 197 | mw->show(); |
198 | } | ||
194 | } else { | 199 | } else { |
195 | qpe_show_dialog((QDialog*)mw,nomaximize); | 200 | qpe_show_dialog((QDialog*)mw,nomaximize); |
196 | } | 201 | } |
197 | } else { | 202 | } else { |
198 | bool max; | ||
199 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { | 203 | if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { |
200 | mw->resize(s); | 204 | mw->resize(s); |
201 | mw->move(p); | 205 | mw->move(p); |
@@ -302,7 +306,7 @@ static void qpe_show_dialog( QDialog* d, bool nomax ) | |||
302 | static bool read_widget_rect(const QString &app, bool &maximized, QPoint &p, QSize &s) | 306 | static bool read_widget_rect(const QString &app, bool &maximized, QPoint &p, QSize &s) |
303 | { | 307 | { |
304 | maximized = TRUE; | 308 | maximized = TRUE; |
305 | 309 | qDebug("read_widget_rect"); | |
306 | // 350 is the trigger in qwsdefaultdecoration for providing a resize button | 310 | // 350 is the trigger in qwsdefaultdecoration for providing a resize button |
307 | if ( qApp->desktop()->width() <= 350 ) | 311 | if ( qApp->desktop()->width() <= 350 ) |
308 | return FALSE; | 312 | return FALSE; |
@@ -374,7 +378,7 @@ static void qpe_show_dialog( QDialog* d, bool nomax ) | |||
374 | // 350 is the trigger in qwsdefaultdecoration for providing a resize button | 378 | // 350 is the trigger in qwsdefaultdecoration for providing a resize button |
375 | if ( qApp->desktop()->width() <= 350 ) | 379 | if ( qApp->desktop()->width() <= 350 ) |
376 | return; | 380 | return; |
377 | 381 | qDebug("store_widget_rect"); | |
378 | // we use these to map the offset of geometry and pos. ( we can only use normalGeometry to | 382 | // we use these to map the offset of geometry and pos. ( we can only use normalGeometry to |
379 | // get the non-maximized version, so we have to do it the hard way ) | 383 | // get the non-maximized version, so we have to do it the hard way ) |
380 | int offsetX = w->x() - w->geometry().left(); | 384 | int offsetX = w->x() - w->geometry().left(); |