summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/multikey/keyboard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/inputmethods/multikey/keyboard.cpp b/inputmethods/multikey/keyboard.cpp
index b793391..2a80f1e 100644
--- a/inputmethods/multikey/keyboard.cpp
+++ b/inputmethods/multikey/keyboard.cpp
@@ -14,100 +14,100 @@
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "keyboard.h" 21#include "keyboard.h"
22#include "configdlg.h" 22#include "configdlg.h"
23 23
24#include <qpe/global.h> 24#include <qpe/global.h>
25#include <qpe/qcopenvelope_qws.h> 25#include <qpe/qcopenvelope_qws.h>
26 26
27#include <qwindowsystem_qws.h> 27#include <qwindowsystem_qws.h>
28#include <qpainter.h> 28#include <qpainter.h>
29#include <qfontmetrics.h> 29#include <qfontmetrics.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
32#include <qpe/config.h> 32#include <qpe/config.h>
33#include <ctype.h> 33#include <ctype.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <iostream.h> 36#include <iostream.h>
37 37
38#include <sys/utsname.h> 38#include <sys/utsname.h>
39 39
40 40
41#define USE_SMALL_BACKSPACE 41#define USE_SMALL_BACKSPACE
42 42
43/* Keyboard::Keyboard {{{1 */ 43/* Keyboard::Keyboard {{{1 */
44Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) : 44Keyboard::Keyboard(QWidget* parent, const char* _name, WFlags f) :
45 QFrame(parent, _name, f), shift(0), lock(0), ctrl(0), 45 QFrame(parent, _name, f), shift(0), lock(0), ctrl(0),
46 alt(0), useLargeKeys(TRUE), usePicks(0), pressedKeyRow(-1), pressedKeyCol(-1), 46 alt(0), useLargeKeys(TRUE), usePicks(0), pressedKeyRow(-1), pressedKeyCol(-1),
47 unicode(-1), qkeycode(0), modifiers(0), schar(0), mchar(0), echar(0), 47 unicode(-1), qkeycode(0), modifiers(0), schar(0), mchar(0), echar(0),
48 configdlg(0) 48 configdlg(0)
49 49
50{ 50{
51 // get the default font 51 // get the default font
52 Config *config = new Config( "qpe" ); 52 Config *config = new Config( "qpe" );
53 config->setGroup( "Appearance" ); 53 config->setGroup( "Appearance" );
54 QString familyStr = config->readEntry( "FontFamily", "fixed" ); 54 QString familyStr = config->readEntry( "FontFamily", "fixed" );
55 delete config; 55 delete config;
56 56
57 config = new Config("multikey"); 57 config = new Config("multikey");
58 config->setGroup ("pickboard"); 58 config->setGroup ("pickboard");
59 usePicks = config->readBoolEntry ("open", "0"); // default closed 59 usePicks = config->readBoolEntry ("open", "0"); // default closed
60 delete config; 60 delete config;
61 61
62 setFont( QFont( familyStr, 8 ) ); 62 setFont( QFont( familyStr, 10 ) );
63 63
64 picks = new KeyboardPicks( this ); 64 picks = new KeyboardPicks( this );
65 picks->setFont( QFont( familyStr, 8 ) ); 65 picks->setFont( QFont( familyStr, 10 ) );
66 picks->initialise(); 66 picks->initialise();
67 if (usePicks) { 67 if (usePicks) {
68 68
69 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ), 69 QObject::connect( picks, SIGNAL(key(ushort,ushort,ushort,bool,bool) ),
70 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) ); 70 this, SIGNAL(key(ushort,ushort,ushort,bool,bool)) );
71 71
72 } else picks->hide(); 72 } else picks->hide();
73 73
74 keys = new Keys(); 74 keys = new Keys();
75 75
76 repeatTimer = new QTimer( this ); 76 repeatTimer = new QTimer( this );
77 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) ); 77 connect( repeatTimer, SIGNAL(timeout()), this, SLOT(repeat()) );
78 78
79} 79}
80 80
81/* Keyboard::resizeEvent {{{1 */ 81/* Keyboard::resizeEvent {{{1 */
82void Keyboard::resizeEvent(QResizeEvent*) 82void Keyboard::resizeEvent(QResizeEvent*)
83{ 83{
84 int ph = picks->sizeHint().height(); 84 int ph = picks->sizeHint().height();
85 picks->setGeometry( 0, 0, width(), ph ); 85 picks->setGeometry( 0, 0, width(), ph );
86 keyHeight = (height()-(usePicks ? ph : 0))/5; 86 keyHeight = (height()-(usePicks ? ph : 0))/5;
87 87
88 int nk; // number of keys? 88 int nk; // number of keys?
89 if ( useLargeKeys ) { 89 if ( useLargeKeys ) {
90 nk = 15; 90 nk = 15;
91 } else { 91 } else {
92 nk = 19; 92 nk = 19;
93 } 93 }
94 defaultKeyWidth = (width()/nk)/2; 94 defaultKeyWidth = (width()/nk)/2;
95 xoffs = (width()-defaultKeyWidth*nk)/2; // empty key spaces? 95 xoffs = (width()-defaultKeyWidth*nk)/2; // empty key spaces?
96 96
97} 97}
98 98
99/* KeyboardPicks::initialize {{{1 */ 99/* KeyboardPicks::initialize {{{1 */
100void KeyboardPicks::initialise() 100void KeyboardPicks::initialise()
101{ 101{
102 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); 102 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed));
103 mode = 0; 103 mode = 0;
104 dc = new KeyboardConfig(this); 104 dc = new KeyboardConfig(this);
105 configs.append(dc); 105 configs.append(dc);
106} 106}
107 107
108/* KeyboardPicks::sizeHint {{{1 */ 108/* KeyboardPicks::sizeHint {{{1 */
109QSize KeyboardPicks::sizeHint() const 109QSize KeyboardPicks::sizeHint() const
110{ 110{
111 return QSize(240,fontMetrics().lineSpacing()); 111 return QSize(240,fontMetrics().lineSpacing());
112} 112}
113 113