author | drw <drw> | 2002-06-20 00:32:56 (UTC) |
---|---|---|
committer | drw <drw> | 2002-06-20 00:32:56 (UTC) |
commit | 2ae11eec4c1b90093e464b863131de07c4528d96 (patch) (unidiff) | |
tree | f8df2cf39b9fe183944be3f6453cbfe383729e57 /library | |
parent | 51ef8523daa3874e7b5542de6b19423fba261de6 (diff) | |
download | opie-2ae11eec4c1b90093e464b863131de07c4528d96.zip opie-2ae11eec4c1b90093e464b863131de07c4528d96.tar.gz opie-2ae11eec4c1b90093e464b863131de07c4528d96.tar.bz2 |
Allow apps to use font selected in appearance app
-rw-r--r-- | library/qpeapplication.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index cf437da..f84bc0e 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -69,8 +69,10 @@ | |||
69 | #endif | 69 | #endif |
70 | #include "config.h" | 70 | #include "config.h" |
71 | #include "network.h" | 71 | #include "network.h" |
72 | #include "fontmanager.h" | 72 | #include "fontmanager.h" |
73 | #include "fontdatabase.h" | ||
74 | |||
73 | #include "power.h" | 75 | #include "power.h" |
74 | #include "alarmserver.h" | 76 | #include "alarmserver.h" |
75 | #include "applnk.h" | 77 | #include "applnk.h" |
76 | #include "qpemenubar.h" | 78 | #include "qpemenubar.h" |
@@ -384,9 +386,9 @@ public: | |||
384 | else // We're going to suspend the whole machine | 386 | else // We're going to suspend the whole machine |
385 | { | 387 | { |
386 | if ( disable_suspend > 2 && !powerOnline() && !networkOnline() ) { | 388 | if ( disable_suspend > 2 && !powerOnline() && !networkOnline() ) { |
387 | QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); | 389 | QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); |
388 | return TRUE; | 390 | return TRUE; |
389 | } | 391 | } |
390 | } | 392 | } |
391 | break; | 393 | break; |
392 | } | 394 | } |
@@ -503,9 +505,9 @@ QPEApplication::QPEApplication( int& argc, char **argv, Type t ) | |||
503 | : QApplication( hack(argc), argv, t ) | 505 | : QApplication( hack(argc), argv, t ) |
504 | { | 506 | { |
505 | int dw = desktop()->width(); | 507 | int dw = desktop()->width(); |
506 | if ( dw < 200 ) { | 508 | if ( dw < 200 ) { |
507 | setFont( QFont( "helvetica", 8 ) ); | 509 | // setFont( QFont( "helvetica", 8 ) ); |
508 | AppLnk::setSmallIconSize(10); | 510 | AppLnk::setSmallIconSize(10); |
509 | AppLnk::setBigIconSize(28); | 511 | AppLnk::setBigIconSize(28); |
510 | } | 512 | } |
511 | 513 | ||
@@ -598,9 +600,23 @@ QPEApplication::QPEApplication( int& argc, char **argv, Type t ) | |||
598 | if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) { | 600 | if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) { |
599 | QFont fn = FontManager::unicodeFont( FontManager::Proportional ); | 601 | QFont fn = FontManager::unicodeFont( FontManager::Proportional ); |
600 | setFont( fn ); | 602 | setFont( fn ); |
601 | } | 603 | } |
604 | else { | ||
605 | Config config( "qpe" ); | ||
606 | config.setGroup( "Appearance" ); | ||
607 | QString familyStr = config.readEntry( "FontFamily", "fixed" ); | ||
608 | QString styleStr = config.readEntry( "FontStyle", "Regular" ); | ||
609 | QString sizeStr = config.readEntry( "FontSize", "10" ); | ||
610 | QString charSetStr = config.readEntry( "FontCharSet", "iso10646-1" ); | ||
611 | bool ok; | ||
612 | int i_size = sizeStr.toInt( &ok, 10 ); | ||
613 | FontDatabase fdb; | ||
614 | QFont selectedFont = fdb.font( familyStr, styleStr, i_size, charSetStr ); | ||
615 | setFont( selectedFont ); | ||
616 | } | ||
602 | } | 617 | } |
618 | |||
603 | #endif | 619 | #endif |
604 | 620 | ||
605 | applyStyle(); | 621 | applyStyle(); |
606 | 622 | ||