author | mickeyl <mickeyl> | 2005-01-05 15:22:09 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-01-05 15:22:09 (UTC) |
commit | 34ae22499b91f483f1cf505e515047ea11e8eaf0 (patch) (unidiff) | |
tree | 555ad0f77c87d445f1ca688f96a78fe903211190 | |
parent | 80823d4cbd234a54a15d6b439bd37a8ea42e7904 (diff) | |
download | opie-34ae22499b91f483f1cf505e515047ea11e8eaf0.zip opie-34ae22499b91f483f1cf505e515047ea11e8eaf0.tar.gz opie-34ae22499b91f483f1cf505e515047ea11e8eaf0.tar.bz2 |
remove hard coded fonts for dvorak, keyboard, multikey, pickboard, and unikeyboard
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | inputmethods/dvorak/dvorak.cpp | 13 | ||||
-rw-r--r-- | inputmethods/keyboard/keyboard.cpp | 13 | ||||
-rw-r--r-- | inputmethods/multikey/keyboard.cpp | 6 | ||||
-rw-r--r-- | inputmethods/pickboard/pickboard.cpp | 15 | ||||
-rw-r--r-- | inputmethods/unikeyboard/unikeyboard.cpp | 12 |
6 files changed, 45 insertions, 17 deletions
@@ -5,7 +5,8 @@ | |||
5 | 5 | ||
6 | Fixed Bugs | 6 | Fixed Bugs |
7 | ---------- | 7 | ---------- |
8 | * #1501 - Fixing bug in todo sql backend (eilers) | 8 | * #1501 - Fixed bug in todo sql backend (eilers) |
9 | * n.a - Removed hard coded font sizes in a couple of inputmethods (mickeyl) | ||
9 | 10 | ||
10 | Internal | 11 | Internal |
11 | -------- | 12 | -------- |
diff --git a/inputmethods/dvorak/dvorak.cpp b/inputmethods/dvorak/dvorak.cpp index 2137f22..3781e38 100644 --- a/inputmethods/dvorak/dvorak.cpp +++ b/inputmethods/dvorak/dvorak.cpp | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "dvorak.h" | 21 | #include "dvorak.h" |
22 | 22 | ||
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | 24 | #include <qpe/config.h> | |
25 | #include <qwindowsystem_qws.h> | 25 | #include <qwindowsystem_qws.h> |
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qfontmetrics.h> | 27 | #include <qfontmetrics.h> |
@@ -43,9 +43,16 @@ Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) : | |||
43 | // setPalette(QPalette(QColor(200,200,200))); // Gray | 43 | // setPalette(QPalette(QColor(200,200,200))); // Gray |
44 | setPalette(QPalette(QColor(220,220,220))); // Gray | 44 | setPalette(QPalette(QColor(220,220,220))); // Gray |
45 | 45 | ||
46 | // get the default font | ||
47 | Config *config = new Config( "qpe" ); | ||
48 | config->setGroup( "Appearance" ); | ||
49 | QString familyStr = config->readEntry( "FontFamily", "smallsmooth" ); | ||
50 | int fontSize = config->readNumEntry( "FontSize", 10 ); | ||
51 | delete config; | ||
52 | |||
46 | picks = new KeyboardPicks( this ); | 53 | picks = new KeyboardPicks( this ); |
47 | picks->setFont( QFont( "smallsmooth", 9 ) ); | 54 | picks->setFont( QFont( familyStr, fontSize ) ); |
48 | setFont( QFont( "smallsmooth", 9 ) ); | 55 | setFont( QFont( familyStr, fontSize ) ); |
49 | picks->initialise(); | 56 | picks->initialise(); |
50 | QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), | 57 | QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), |
51 | this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); | 58 | this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); |
diff --git a/inputmethods/keyboard/keyboard.cpp b/inputmethods/keyboard/keyboard.cpp index fb88f2a..39d44cd 100644 --- a/inputmethods/keyboard/keyboard.cpp +++ b/inputmethods/keyboard/keyboard.cpp | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "keyboard.h" | 21 | #include "keyboard.h" |
22 | 22 | ||
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | 24 | #include <qpe/config.h> | |
25 | #include <qwindowsystem_qws.h> | 25 | #include <qwindowsystem_qws.h> |
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qfontmetrics.h> | 27 | #include <qfontmetrics.h> |
@@ -44,9 +44,16 @@ Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : | |||
44 | // setPalette(QPalette(QColor(200,200,200))); // Gray | 44 | // setPalette(QPalette(QColor(200,200,200))); // Gray |
45 | setPalette(QPalette(QColor(220,220,220))); // Gray | 45 | setPalette(QPalette(QColor(220,220,220))); // Gray |
46 | 46 | ||
47 | // get the default font | ||
48 | Config *config = new Config( "qpe" ); | ||
49 | config->setGroup( "Appearance" ); | ||
50 | QString familyStr = config->readEntry( "FontFamily", "smallsmooth" ); | ||
51 | int fontSize = config->readNumEntry( "FontSize", 10 ); | ||
52 | delete config; | ||
53 | |||
47 | picks = new KeyboardPicks( this ); | 54 | picks = new KeyboardPicks( this ); |
48 | picks->setFont( QFont( "smallsmooth", 9 ) ); | 55 | picks->setFont( QFont( familyStr, fontSize ) ); |
49 | setFont( QFont( "smallsmooth", 9 ) ); | 56 | setFont( QFont( familyStr, fontSize ) ); |
50 | picks->initialise(); | 57 | picks->initialise(); |
51 | QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), | 58 | QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), |
52 | this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); | 59 | this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); |
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp index f8cafd5..96fb484 100644 --- a/inputmethods/multikey/keyboard.cpp +++ b/inputmethods/multikey/keyboard.cpp | |||
@@ -66,6 +66,7 @@ Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : | |||
66 | Config *config = new Config( "qpe" ); | 66 | Config *config = new Config( "qpe" ); |
67 | config->setGroup( "Appearance" ); | 67 | config->setGroup( "Appearance" ); |
68 | QString familyStr = config->readEntry( "FontFamily", "smallsmooth" ); | 68 | QString familyStr = config->readEntry( "FontFamily", "smallsmooth" ); |
69 | int fontSize = config->readNumEntry( "FontSize", 10 ); | ||
69 | delete config; | 70 | delete config; |
70 | 71 | ||
71 | config = new Config("multikey"); | 72 | config = new Config("multikey"); |
@@ -74,11 +75,10 @@ Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : | |||
74 | useRepeat = config->readBoolEntry ("useRepeat", 1); | 75 | useRepeat = config->readBoolEntry ("useRepeat", 1); |
75 | delete config; | 76 | delete config; |
76 | 77 | ||
77 | 78 | setFont( QFont( familyStr, fontSize ) ); | |
78 | setFont( QFont( familyStr, 10 ) ); | ||
79 | 79 | ||
80 | picks = new KeyboardPicks( this ); | 80 | picks = new KeyboardPicks( this ); |
81 | picks->setFont( QFont( familyStr, 10 ) ); | 81 | picks->setFont( QFont( familyStr, fontSize ) ); |
82 | picks->initialise(); | 82 | picks->initialise(); |
83 | if (usePicks) { | 83 | if (usePicks) { |
84 | 84 | ||
diff --git a/inputmethods/pickboard/pickboard.cpp b/inputmethods/pickboard/pickboard.cpp index 1611cb0..e5365ba 100644 --- a/inputmethods/pickboard/pickboard.cpp +++ b/inputmethods/pickboard/pickboard.cpp | |||
@@ -22,7 +22,7 @@ | |||
22 | #include "pickboardcfg.h" | 22 | #include "pickboardcfg.h" |
23 | 23 | ||
24 | #include <qpe/global.h> | 24 | #include <qpe/global.h> |
25 | 25 | #include <qpe/config.h> | |
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qlist.h> | 27 | #include <qlist.h> |
28 | #include <qbitmap.h> | 28 | #include <qbitmap.h> |
@@ -92,10 +92,15 @@ Pickboard::Pickboard(QWidget* parent, const char* name, WFlags f) : | |||
92 | { | 92 | { |
93 | (new QHBoxLayout(this))->setAutoAdd(TRUE); | 93 | (new QHBoxLayout(this))->setAutoAdd(TRUE); |
94 | d = new PickboardPrivate(this); | 94 | d = new PickboardPrivate(this); |
95 | // under Win32 we may not have smallsmooth font | 95 | |
96 | #ifndef Q_OS_WIN32 | 96 | // get the default font |
97 | setFont( QFont( "smallsmooth", 9 ) ); | 97 | Config *config = new Config( "qpe" ); |
98 | #endif | 98 | config->setGroup( "Appearance" ); |
99 | QString familyStr = config->readEntry( "FontFamily", "smallsmooth" ); | ||
100 | int fontSize = config->readNumEntry( "FontSize", 10 ); | ||
101 | delete config; | ||
102 | |||
103 | setFont( QFont( familyStr, fontSize ) ); | ||
99 | } | 104 | } |
100 | 105 | ||
101 | Pickboard::~Pickboard() | 106 | Pickboard::~Pickboard() |
diff --git a/inputmethods/unikeyboard/unikeyboard.cpp b/inputmethods/unikeyboard/unikeyboard.cpp index aa74c66..23d96ad 100644 --- a/inputmethods/unikeyboard/unikeyboard.cpp +++ b/inputmethods/unikeyboard/unikeyboard.cpp | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "unikeyboard.h" | 21 | #include "unikeyboard.h" |
22 | 22 | ||
23 | #include <qpe/fontmanager.h> | 23 | #include <qpe/fontmanager.h> |
24 | 24 | #include <qpe/config.h> | |
25 | #include <qpainter.h> | 25 | #include <qpainter.h> |
26 | #include <qfontmetrics.h> | 26 | #include <qfontmetrics.h> |
27 | #include <qcombobox.h> | 27 | #include <qcombobox.h> |
@@ -135,7 +135,15 @@ UniScrollview::UniScrollview(QWidget* parent, const char* name, int f) : | |||
135 | QScrollView(parent, name, f) | 135 | QScrollView(parent, name, f) |
136 | { | 136 | { |
137 | // smallFont.setRawName( "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1" ); //###### | 137 | // smallFont.setRawName( "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1" ); //###### |
138 | smallFont = QFont( "Helvetica", 8 ); | 138 | |
139 | // get the default font | ||
140 | Config *config = new Config( "qpe" ); | ||
141 | config->setGroup( "Appearance" ); | ||
142 | QString familyStr = config->readEntry( "FontFamily", "Helvetica" ); | ||
143 | int fontSize = config->readNumEntry( "FontSize", 8 ) - 2; | ||
144 | delete config; | ||
145 | |||
146 | smallFont = QFont( familyStr, fontSize ); | ||
139 | QFontMetrics sfm( smallFont ); | 147 | QFontMetrics sfm( smallFont ); |
140 | xoff = sfm.width( "AAA" ); | 148 | xoff = sfm.width( "AAA" ); |
141 | setFont( FontManager::unicodeFont( FontManager::Fixed ) ); | 149 | setFont( FontManager::unicodeFont( FontManager::Fixed ) ); |