summaryrefslogtreecommitdiff
path: root/inputmethods
authormickeyl <mickeyl>2005-01-05 15:22:09 (UTC)
committer mickeyl <mickeyl>2005-01-05 15:22:09 (UTC)
commit34ae22499b91f483f1cf505e515047ea11e8eaf0 (patch) (side-by-side diff)
tree555ad0f77c87d445f1ca688f96a78fe903211190 /inputmethods
parent80823d4cbd234a54a15d6b439bd37a8ea42e7904 (diff)
downloadopie-34ae22499b91f483f1cf505e515047ea11e8eaf0.zip
opie-34ae22499b91f483f1cf505e515047ea11e8eaf0.tar.gz
opie-34ae22499b91f483f1cf505e515047ea11e8eaf0.tar.bz2
remove hard coded fonts for dvorak, keyboard, multikey, pickboard, and unikeyboard
Diffstat (limited to 'inputmethods') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dvorak/dvorak.cpp13
-rw-r--r--inputmethods/keyboard/keyboard.cpp13
-rw-r--r--inputmethods/multikey/keyboard.cpp6
-rw-r--r--inputmethods/pickboard/pickboard.cpp15
-rw-r--r--inputmethods/unikeyboard/unikeyboard.cpp12
5 files changed, 43 insertions, 16 deletions
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
@@ -18,13 +18,13 @@
**
**********************************************************************/
#include "dvorak.h"
#include <qpe/global.h>
-
+#include <qpe/config.h>
#include <qwindowsystem_qws.h>
#include <qpainter.h>
#include <qfontmetrics.h>
#include <qtimer.h>
#include <ctype.h>
@@ -40,15 +40,22 @@ Keyboard::Keyboard(QWidget* parent, const char* name, WFlags f) :
{
// setPalette(QPalette(QColor(240,240,230))); // Beige!
// setFont( QFont( "Helvetica", 8 ) );
// setPalette(QPalette(QColor(200,200,200))); // Gray
setPalette(QPalette(QColor(220,220,220))); // Gray
+ // get the default font
+ Config *config = new Config( "qpe" );
+ config->setGroup( "Appearance" );
+ QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
+ int fontSize = config->readNumEntry( "FontSize", 10 );
+ delete config;
+
picks = new KeyboardPicks( this );
- picks->setFont( QFont( "smallsmooth", 9 ) );
- setFont( QFont( "smallsmooth", 9 ) );
+ picks->setFont( QFont( familyStr, fontSize ) );
+ setFont( QFont( familyStr, fontSize ) );
picks->initialise();
QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
repeatTimer = new QTimer( this );
connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) );
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
@@ -18,13 +18,13 @@
**
**********************************************************************/
#include "keyboard.h"
#include <qpe/global.h>
-
+#include <qpe/config.h>
#include <qwindowsystem_qws.h>
#include <qpainter.h>
#include <qfontmetrics.h>
#include <qtimer.h>
#include <ctype.h>
@@ -41,15 +41,22 @@ Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) :
{
// setPalette(QPalette(QColor(240,240,230))); // Beige!
// setFont( QFont( "Helvetica", 8 ) );
// setPalette(QPalette(QColor(200,200,200))); // Gray
setPalette(QPalette(QColor(220,220,220))); // Gray
+ // get the default font
+ Config *config = new Config( "qpe" );
+ config->setGroup( "Appearance" );
+ QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
+ int fontSize = config->readNumEntry( "FontSize", 10 );
+ delete config;
+
picks = new KeyboardPicks( this );
- picks->setFont( QFont( "smallsmooth", 9 ) );
- setFont( QFont( "smallsmooth", 9 ) );
+ picks->setFont( QFont( familyStr, fontSize ) );
+ setFont( QFont( familyStr, fontSize ) );
picks->initialise();
QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
repeatTimer = new QTimer( this );
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
@@ -63,25 +63,25 @@ Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) :
{
// get the default font
Config *config = new Config( "qpe" );
config->setGroup( "Appearance" );
QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
+ int fontSize = config->readNumEntry( "FontSize", 10 );
delete config;
config = new Config("multikey");
config->setGroup ("general");
usePicks = config->readBoolEntry ("usePickboard", 0); // default closed
useRepeat = config->readBoolEntry ("useRepeat", 1);
delete config;
-
- setFont( QFont( familyStr, 10 ) );
+ setFont( QFont( familyStr, fontSize ) );
picks = new KeyboardPicks( this );
- picks->setFont( QFont( familyStr, 10 ) );
+ picks->setFont( QFont( familyStr, fontSize ) );
picks->initialise();
if (usePicks) {
QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
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
@@ -19,13 +19,13 @@
**********************************************************************/
#include "pickboard.h"
#include "pickboardpicks.h"
#include "pickboardcfg.h"
#include <qpe/global.h>
-
+#include <qpe/config.h>
#include <qpainter.h>
#include <qlist.h>
#include <qbitmap.h>
#include <qlayout.h>
#include <qvbox.h>
#include <qdialog.h>
@@ -89,16 +89,21 @@ public:
Pickboard::Pickboard(QWidget* parent, const char* name, WFlags f) :
QFrame(parent,name,f)
{
(new QHBoxLayout(this))->setAutoAdd(TRUE);
d = new PickboardPrivate(this);
-// under Win32 we may not have smallsmooth font
-#ifndef Q_OS_WIN32
- setFont( QFont( "smallsmooth", 9 ) );
-#endif
+
+ // get the default font
+ Config *config = new Config( "qpe" );
+ config->setGroup( "Appearance" );
+ QString familyStr = config->readEntry( "FontFamily", "smallsmooth" );
+ int fontSize = config->readNumEntry( "FontSize", 10 );
+ delete config;
+
+ setFont( QFont( familyStr, fontSize ) );
}
Pickboard::~Pickboard()
{
delete d;
}
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
@@ -18,13 +18,13 @@
**
**********************************************************************/
#include "unikeyboard.h"
#include <qpe/fontmanager.h>
-
+#include <qpe/config.h>
#include <qpainter.h>
#include <qfontmetrics.h>
#include <qcombobox.h>
#if defined(Q_WS_QWS) || defined(_WS_QWS_)
#include <qwindowsystem_qws.h>
#endif
@@ -132,13 +132,21 @@ static const BlockMap blockMap[] =
UniScrollview::UniScrollview(QWidget* parent, const char* name, int f) :
QScrollView(parent, name, f)
{
// smallFont.setRawName( "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1" ); //######
- smallFont = QFont( "Helvetica", 8 );
+
+ // get the default font
+ Config *config = new Config( "qpe" );
+ config->setGroup( "Appearance" );
+ QString familyStr = config->readEntry( "FontFamily", "Helvetica" );
+ int fontSize = config->readNumEntry( "FontSize", 8 ) - 2;
+ delete config;
+
+ smallFont = QFont( familyStr, fontSize );
QFontMetrics sfm( smallFont );
xoff = sfm.width( "AAA" );
setFont( FontManager::unicodeFont( FontManager::Fixed ) );
QFontMetrics fm( font() );
cellsize = fm.lineSpacing() + 2;
resizeContents( cellsize*nw, cellsize*65536/nw );