author | zecke <zecke> | 2004-06-13 19:32:42 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-06-13 19:32:42 (UTC) |
commit | 6092529865660fee46ffab29177ca281f6252b2a (patch) (unidiff) | |
tree | 45373de9c58a31e3951f745c90aa223f260d47cd | |
parent | f74ad6f0e20cb803321cec629cd8d37abc966571 (diff) | |
download | opie-6092529865660fee46ffab29177ca281f6252b2a.zip opie-6092529865660fee46ffab29177ca281f6252b2a.tar.gz opie-6092529865660fee46ffab29177ca281f6252b2a.tar.bz2 |
Set the ScrollBar position right on start.
This works on Qt2.3.8 and Qt2.3.7
-rw-r--r-- | library/qpeapplication.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 040b2fe..26e310a 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -1304,32 +1304,34 @@ void QPEApplication::setCurrentMode( int x, int y, int depth ) | |||
1304 | qwsServer->endDisplayReconfigure(); | 1304 | qwsServer->endDisplayReconfigure(); |
1305 | 1305 | ||
1306 | // Get all the running apps to reset | 1306 | // Get all the running apps to reset |
1307 | QCopEnvelope env( "QPE/System", "reset()" ); | 1307 | QCopEnvelope env( "QPE/System", "reset()" ); |
1308 | } | 1308 | } |
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | void QPEApplication::reset() { | 1311 | void QPEApplication::reset() { |
1312 | // Reconnect to the screen | 1312 | // Reconnect to the screen |
1313 | qt_screen->disconnect(); | 1313 | qt_screen->disconnect(); |
1314 | qt_screen->connect( QString::null ); | 1314 | qt_screen->connect( QString::null ); |
1315 | 1315 | ||
1316 | // Redraw everything | 1316 | // Redraw everything |
1317 | applyStyle(); | 1317 | applyStyle(); |
1318 | } | 1318 | } |
1319 | 1319 | ||
1320 | |||
1321 | extern bool qt_left_hand_scrollbars __attribute__(( weak )); | ||
1320 | /*! | 1322 | /*! |
1321 | \internal | 1323 | \internal |
1322 | */ | 1324 | */ |
1323 | void QPEApplication::applyStyle() | 1325 | void QPEApplication::applyStyle() |
1324 | { | 1326 | { |
1325 | Config config( "qpe" ); | 1327 | Config config( "qpe" ); |
1326 | config.setGroup( "Appearance" ); | 1328 | config.setGroup( "Appearance" ); |
1327 | 1329 | ||
1328 | #if QT_VERSION > 233 | 1330 | #if QT_VERSION > 233 |
1329 | #if !defined(OPIE_NO_OVERRIDE_QT) | 1331 | #if !defined(OPIE_NO_OVERRIDE_QT) |
1330 | // don't block ourselves ... | 1332 | // don't block ourselves ... |
1331 | Opie::force_appearance = 0; | 1333 | Opie::force_appearance = 0; |
1332 | 1334 | ||
1333 | static QString appname = Opie::binaryName ( ); | 1335 | static QString appname = Opie::binaryName ( ); |
1334 | 1336 | ||
1335 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); | 1337 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); |
@@ -1360,40 +1362,44 @@ void QPEApplication::applyStyle() | |||
1360 | QString color = config.readEntry( "Highlight", "#73adef" ); | 1362 | QString color = config.readEntry( "Highlight", "#73adef" ); |
1361 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); | 1363 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); |
1362 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); | 1364 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); |
1363 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); | 1365 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); |
1364 | color = config.readEntry( "Text", "#000000" ); | 1366 | color = config.readEntry( "Text", "#000000" ); |
1365 | pal.setColor( QColorGroup::Text, QColor( color ) ); | 1367 | pal.setColor( QColorGroup::Text, QColor( color ) ); |
1366 | color = config.readEntry( "ButtonText", "#000000" ); | 1368 | color = config.readEntry( "ButtonText", "#000000" ); |
1367 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); | 1369 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); |
1368 | color = config.readEntry( "Base", "#FFFFFF" ); | 1370 | color = config.readEntry( "Base", "#FFFFFF" ); |
1369 | pal.setColor( QColorGroup::Base, QColor( color ) ); | 1371 | pal.setColor( QColorGroup::Base, QColor( color ) ); |
1370 | 1372 | ||
1371 | pal.setColor( QPalette::Disabled, QColorGroup::Text, | 1373 | pal.setColor( QPalette::Disabled, QColorGroup::Text, |
1372 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); | 1374 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); |
1373 | 1375 | ||
1374 | setPalette( pal, TRUE ); | 1376 | setPalette( pal, TRUE ); |
1375 | 1377 | ||
1378 | |||
1379 | // Set the ScrollBar on the 'right' side but only if the weak symbol is present | ||
1380 | if (&qt_left_hand_scrollbars ) | ||
1381 | qt_left_hand_scrollbars = config.readBoolEntry( "LeftHand", false ); | ||
1382 | |||
1376 | // Window Decoration | 1383 | // Window Decoration |
1377 | QString dec = config.readEntry( "Decoration", "Flat" ); | 1384 | QString dec = config.readEntry( "Decoration", "Flat" ); |
1378 | 1385 | ||
1379 | // don't set a custom deco | 1386 | // don't set a custom deco |
1380 | if ( nostyle & Opie::Force_Decoration ) | 1387 | if ( nostyle & Opie::Force_Decoration ) |
1381 | dec = ""; | 1388 | dec = ""; |
1382 | 1389 | ||
1383 | //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); | ||
1384 | 1390 | ||
1385 | if ( dec != d->decorationName ) { | 1391 | if ( dec != d->decorationName ) { |
1386 | qwsSetDecoration( new QPEDecoration( dec ) ); | 1392 | qwsSetDecoration( new QPEDecoration( dec ) ); |
1387 | d->decorationName = dec; | 1393 | d->decorationName = dec; |
1388 | } | 1394 | } |
1389 | 1395 | ||
1390 | // Font | 1396 | // Font |
1391 | QString ff = config.readEntry( "FontFamily", font().family() ); | 1397 | QString ff = config.readEntry( "FontFamily", font().family() ); |
1392 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); | 1398 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); |
1393 | 1399 | ||
1394 | // don't set a custom font | 1400 | // don't set a custom font |
1395 | if ( nostyle & Opie::Force_Font ) { | 1401 | if ( nostyle & Opie::Force_Font ) { |
1396 | ff = "Vera"; | 1402 | ff = "Vera"; |
1397 | fs = 10; | 1403 | fs = 10; |
1398 | } | 1404 | } |
1399 | 1405 | ||