summaryrefslogtreecommitdiff
path: root/inputmethods/unikeyboard
authormickeyl <mickeyl>2005-01-05 15:22:09 (UTC)
committer mickeyl <mickeyl>2005-01-05 15:22:09 (UTC)
commit34ae22499b91f483f1cf505e515047ea11e8eaf0 (patch) (unidiff)
tree555ad0f77c87d445f1ca688f96a78fe903211190 /inputmethods/unikeyboard
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/unikeyboard') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/unikeyboard/unikeyboard.cpp12
1 files changed, 10 insertions, 2 deletions
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
@@ -1,278 +1,286 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
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 "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>
28#if defined(Q_WS_QWS) || defined(_WS_QWS_) 28#if defined(Q_WS_QWS) || defined(_WS_QWS_)
29#include <qwindowsystem_qws.h> 29#include <qwindowsystem_qws.h>
30#endif 30#endif
31 31
32static const int nw = 8; 32static const int nw = 8;
33 33
34typedef struct BlockMap { 34typedef struct BlockMap {
35 ushort start; 35 ushort start;
36 ushort stop; 36 ushort stop;
37 const char *name; 37 const char *name;
38}; 38};
39 39
40//# Start Code; Block Name 40//# Start Code; Block Name
41 41
42static const BlockMap blockMap[] = 42static const BlockMap blockMap[] =
43{ 43{
44{0x0000, 0x007F, "Basic Latin"}, 44{0x0000, 0x007F, "Basic Latin"},
45{0x0080, 0x00FF, "Latin-1 Supplement"}, 45{0x0080, 0x00FF, "Latin-1 Supplement"},
46{0x0100, 0x017F, "Latin Extended-A"}, 46{0x0100, 0x017F, "Latin Extended-A"},
47{0x0180, 0x024F, "Latin Extended-B"}, 47{0x0180, 0x024F, "Latin Extended-B"},
48{0x0250, 0x02AF, "IPA Extensions"}, 48{0x0250, 0x02AF, "IPA Extensions"},
49{0x02B0, 0x02FF, "Spacing Modifier Letters"}, 49{0x02B0, 0x02FF, "Spacing Modifier Letters"},
50{0x0300, 0x036F, "Combining Diacritical Marks"}, 50{0x0300, 0x036F, "Combining Diacritical Marks"},
51{0x0370, 0x03FF, "Greek"}, 51{0x0370, 0x03FF, "Greek"},
52{0x0400, 0x04FF, "Cyrillic"}, 52{0x0400, 0x04FF, "Cyrillic"},
53{0x0530, 0x058F, "Armenian"}, 53{0x0530, 0x058F, "Armenian"},
54{0x0590, 0x05FF, "Hebrew"}, 54{0x0590, 0x05FF, "Hebrew"},
55{0x0600, 0x06FF, "Arabic"}, 55{0x0600, 0x06FF, "Arabic"},
56{0x0700, 0x074F, "Syriac "}, 56{0x0700, 0x074F, "Syriac "},
57{0x0780, 0x07BF, "Thaana"}, 57{0x0780, 0x07BF, "Thaana"},
58{0x0900, 0x097F, "Devanagari"}, 58{0x0900, 0x097F, "Devanagari"},
59{0x0980, 0x09FF, "Bengali"}, 59{0x0980, 0x09FF, "Bengali"},
60{0x0A00, 0x0A7F, "Gurmukhi"}, 60{0x0A00, 0x0A7F, "Gurmukhi"},
61{0x0A80, 0x0AFF, "Gujarati"}, 61{0x0A80, 0x0AFF, "Gujarati"},
62{0x0B00, 0x0B7F, "Oriya"}, 62{0x0B00, 0x0B7F, "Oriya"},
63{0x0B80, 0x0BFF, "Tamil"}, 63{0x0B80, 0x0BFF, "Tamil"},
64{0x0C00, 0x0C7F, "Telugu"}, 64{0x0C00, 0x0C7F, "Telugu"},
65{0x0C80, 0x0CFF, "Kannada"}, 65{0x0C80, 0x0CFF, "Kannada"},
66{0x0D00, 0x0D7F, "Malayalam"}, 66{0x0D00, 0x0D7F, "Malayalam"},
67{0x0D80, 0x0DFF, "Sinhala"}, 67{0x0D80, 0x0DFF, "Sinhala"},
68{0x0E00, 0x0E7F, "Thai"}, 68{0x0E00, 0x0E7F, "Thai"},
69{0x0E80, 0x0EFF, "Lao"}, 69{0x0E80, 0x0EFF, "Lao"},
70{0x0F00, 0x0FFF, "Tibetan"}, 70{0x0F00, 0x0FFF, "Tibetan"},
71{0x1000, 0x109F, "Myanmar "}, 71{0x1000, 0x109F, "Myanmar "},
72{0x10A0, 0x10FF, "Georgian"}, 72{0x10A0, 0x10FF, "Georgian"},
73{0x1100, 0x11FF, "Hangul Jamo"}, 73{0x1100, 0x11FF, "Hangul Jamo"},
74{0x1200, 0x137F, "Ethiopic"}, 74{0x1200, 0x137F, "Ethiopic"},
75{0x13A0, 0x13FF, "Cherokee"}, 75{0x13A0, 0x13FF, "Cherokee"},
76{0x1400, 0x167F, "Unified Canadian Aboriginal Syllabics"}, 76{0x1400, 0x167F, "Unified Canadian Aboriginal Syllabics"},
77{0x1680, 0x169F, "Ogham"}, 77{0x1680, 0x169F, "Ogham"},
78{0x16A0, 0x16FF, "Runic"}, 78{0x16A0, 0x16FF, "Runic"},
79{0x1780, 0x17FF, "Khmer"}, 79{0x1780, 0x17FF, "Khmer"},
80{0x1800, 0x18AF, "Mongolian"}, 80{0x1800, 0x18AF, "Mongolian"},
81{0x1E00, 0x1EFF, "Latin Extended Additional"}, 81{0x1E00, 0x1EFF, "Latin Extended Additional"},
82{0x1F00, 0x1FFF, "Greek Extended"}, 82{0x1F00, 0x1FFF, "Greek Extended"},
83{0x2000, 0x206F, "General Punctuation"}, 83{0x2000, 0x206F, "General Punctuation"},
84{0x2070, 0x209F, "Superscripts and Subscripts"}, 84{0x2070, 0x209F, "Superscripts and Subscripts"},
85{0x20A0, 0x20CF, "Currency Symbols"}, 85{0x20A0, 0x20CF, "Currency Symbols"},
86{0x20D0, 0x20FF, "Combining Marks for Symbols"}, 86{0x20D0, 0x20FF, "Combining Marks for Symbols"},
87{0x2100, 0x214F, "Letterlike Symbols"}, 87{0x2100, 0x214F, "Letterlike Symbols"},
88{0x2150, 0x218F, "Number Forms"}, 88{0x2150, 0x218F, "Number Forms"},
89{0x2190, 0x21FF, "Arrows"}, 89{0x2190, 0x21FF, "Arrows"},
90{0x2200, 0x22FF, "Mathematical Operators"}, 90{0x2200, 0x22FF, "Mathematical Operators"},
91{0x2300, 0x23FF, "Miscellaneous Technical"}, 91{0x2300, 0x23FF, "Miscellaneous Technical"},
92{0x2400, 0x243F, "Control Pictures"}, 92{0x2400, 0x243F, "Control Pictures"},
93{0x2440, 0x245F, "Optical Character Recognition"}, 93{0x2440, 0x245F, "Optical Character Recognition"},
94{0x2460, 0x24FF, "Enclosed Alphanumerics"}, 94{0x2460, 0x24FF, "Enclosed Alphanumerics"},
95{0x2500, 0x257F, "Box Drawing"}, 95{0x2500, 0x257F, "Box Drawing"},
96{0x2580, 0x259F, "Block Elements"}, 96{0x2580, 0x259F, "Block Elements"},
97{0x25A0, 0x25FF, "Geometric Shapes"}, 97{0x25A0, 0x25FF, "Geometric Shapes"},
98{0x2600, 0x26FF, "Miscellaneous Symbols"}, 98{0x2600, 0x26FF, "Miscellaneous Symbols"},
99{0x2700, 0x27BF, "Dingbats"}, 99{0x2700, 0x27BF, "Dingbats"},
100{0x2800, 0x28FF, "Braille Patterns"}, 100{0x2800, 0x28FF, "Braille Patterns"},
101{0x2E80, 0x2EFF, "CJK Radicals Supplement"}, 101{0x2E80, 0x2EFF, "CJK Radicals Supplement"},
102{0x2F00, 0x2FDF, "Kangxi Radicals"}, 102{0x2F00, 0x2FDF, "Kangxi Radicals"},
103{0x2FF0, 0x2FFF, "Ideographic Description Characters"}, 103{0x2FF0, 0x2FFF, "Ideographic Description Characters"},
104{0x3000, 0x303F, "CJK Symbols and Punctuation"}, 104{0x3000, 0x303F, "CJK Symbols and Punctuation"},
105{0x3040, 0x309F, "Hiragana"}, 105{0x3040, 0x309F, "Hiragana"},
106{0x30A0, 0x30FF, "Katakana"}, 106{0x30A0, 0x30FF, "Katakana"},
107{0x3100, 0x312F, "Bopomofo"}, 107{0x3100, 0x312F, "Bopomofo"},
108{0x3130, 0x318F, "Hangul Compatibility Jamo"}, 108{0x3130, 0x318F, "Hangul Compatibility Jamo"},
109{0x3190, 0x319F, "Kanbun"}, 109{0x3190, 0x319F, "Kanbun"},
110{0x31A0, 0x31BF, "Bopomofo Extended"}, 110{0x31A0, 0x31BF, "Bopomofo Extended"},
111{0x3200, 0x32FF, "Enclosed CJK Letters and Months"}, 111{0x3200, 0x32FF, "Enclosed CJK Letters and Months"},
112{0x3300, 0x33FF, "CJK Compatibility"}, 112{0x3300, 0x33FF, "CJK Compatibility"},
113{0x3400, 0x4DB5, "CJK Unified Ideographs Extension A"}, 113{0x3400, 0x4DB5, "CJK Unified Ideographs Extension A"},
114{0x4E00, 0x9FFF, "CJK Unified Ideographs"}, 114{0x4E00, 0x9FFF, "CJK Unified Ideographs"},
115{0xA000, 0xA48F, "Yi Syllables"}, 115{0xA000, 0xA48F, "Yi Syllables"},
116{0xA490, 0xA4CF, "Yi Radicals"}, 116{0xA490, 0xA4CF, "Yi Radicals"},
117{0xAC00, 0xD7A3, "Hangul Syllables"}, 117{0xAC00, 0xD7A3, "Hangul Syllables"},
118{0xD800, 0xDB7F, "High Surrogates"}, 118{0xD800, 0xDB7F, "High Surrogates"},
119{0xDB80, 0xDBFF, "High Private Use Surrogates"}, 119{0xDB80, 0xDBFF, "High Private Use Surrogates"},
120{0xDC00, 0xDFFF, "Low Surrogates"}, 120{0xDC00, 0xDFFF, "Low Surrogates"},
121{0xE000, 0xF8FF, "Private Use"}, 121{0xE000, 0xF8FF, "Private Use"},
122{0xF900, 0xFAFF, "CJK Compatibility Ideographs"}, 122{0xF900, 0xFAFF, "CJK Compatibility Ideographs"},
123{0xFB00, 0xFB4F, "Alphabetic Presentation Forms"}, 123{0xFB00, 0xFB4F, "Alphabetic Presentation Forms"},
124{0xFB50, 0xFDFF, "Arabic Presentation Forms-A"}, 124{0xFB50, 0xFDFF, "Arabic Presentation Forms-A"},
125{0xFE20, 0xFE2F, "Combining Half Marks"}, 125{0xFE20, 0xFE2F, "Combining Half Marks"},
126{0xFE30, 0xFE4F, "CJK Compatibility Forms"}, 126{0xFE30, 0xFE4F, "CJK Compatibility Forms"},
127{0xFE50, 0xFE6F, "Small Form Variants"}, 127{0xFE50, 0xFE6F, "Small Form Variants"},
128{0xFE70, 0xFEFE, "Arabic Presentation Forms-B"}, 128{0xFE70, 0xFEFE, "Arabic Presentation Forms-B"},
129{0xFF00, 0xFEFF, "Halfwidth and Fullwidth Forms"}, 129{0xFF00, 0xFEFF, "Halfwidth and Fullwidth Forms"},
130{0xFFF0, 0xFFEF, "Specials"}, 130{0xFFF0, 0xFFEF, "Specials"},
131 {0xFFFF, 0xFFFF, 0} }; 131 {0xFFFF, 0xFFFF, 0} };
132 132
133 133
134UniScrollview::UniScrollview(QWidget* parent, const char* name, int f) : 134UniScrollview::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 ) );
142 QFontMetrics fm( font() ); 150 QFontMetrics fm( font() );
143 cellsize = fm.lineSpacing() + 2; 151 cellsize = fm.lineSpacing() + 2;
144 resizeContents( cellsize*nw, cellsize*65536/nw ); 152 resizeContents( cellsize*nw, cellsize*65536/nw );
145 verticalScrollBar()->setLineStep(cellsize); 153 verticalScrollBar()->setLineStep(cellsize);
146 154
147 viewport()->setBackgroundMode( QWidget::PaletteBase ); 155 viewport()->setBackgroundMode( QWidget::PaletteBase );
148} 156}
149 157
150 158
151 159
152void UniScrollview::contentsMousePressEvent(QMouseEvent* e) 160void UniScrollview::contentsMousePressEvent(QMouseEvent* e)
153{ 161{
154 if ( e->x() < xoff || e->x() > xoff + nw*cellsize ) 162 if ( e->x() < xoff || e->x() > xoff + nw*cellsize )
155 return; 163 return;
156 int row = e->y()/cellsize; 164 int row = e->y()/cellsize;
157 int col = (e->x()-xoff)/cellsize; 165 int col = (e->x()-xoff)/cellsize;
158 int u = row*nw+col; 166 int u = row*nw+col;
159#if defined(Q_WS_QWS) || defined(_WS_QWS_) 167#if defined(Q_WS_QWS) || defined(_WS_QWS_)
160 emit key( u, 0, 0, true, false ); 168 emit key( u, 0, 0, true, false );
161 emit key( u, 0, 0, false, false ); 169 emit key( u, 0, 0, false, false );
162#endif 170#endif
163} 171}
164 172
165 173
166void UniScrollview::contentsMouseReleaseEvent(QMouseEvent*) 174void UniScrollview::contentsMouseReleaseEvent(QMouseEvent*)
167{ 175{
168} 176}
169 177
170void UniScrollview::scrollTo( int unicode ) 178void UniScrollview::scrollTo( int unicode )
171{ 179{
172 int row = unicode / nw; 180 int row = unicode / nw;
173 setContentsPos( 0, row*cellsize ); 181 setContentsPos( 0, row*cellsize );
174} 182}
175 183
176 184
177void UniScrollview::drawContents( QPainter *p, int /*cx*/, int cy, int /*cw*/, int ch ) 185void UniScrollview::drawContents( QPainter *p, int /*cx*/, int cy, int /*cw*/, int ch )
178{ 186{
179 QFontMetrics fm = fontMetrics(); 187 QFontMetrics fm = fontMetrics();
180 int row = cy / cellsize; 188 int row = cy / cellsize;
181 int y = row*cellsize; 189 int y = row*cellsize;
182 while ( y < cy+ch ) { 190 while ( y < cy+ch ) {
183 p->drawLine( xoff, y, xoff+nw*cellsize, y ); 191 p->drawLine( xoff, y, xoff+nw*cellsize, y );
184 if ( row*nw%16 == 0 ) { 192 if ( row*nw%16 == 0 ) {
185 p->setFont( smallFont ); 193 p->setFont( smallFont );
186 QString s; 194 QString s;
187 s.sprintf( "%03X", row*nw/16 ); 195 s.sprintf( "%03X", row*nw/16 );
188 p->drawText( 0, y, xoff, cellsize, AlignLeft, s ); 196 p->drawText( 0, y, xoff, cellsize, AlignLeft, s );
189 p->setFont( font() ); 197 p->setFont( font() );
190 } 198 }
191 for ( int i = 0; i < nw; i++ ) { 199 for ( int i = 0; i < nw; i++ ) {
192 p->drawLine( xoff+i*cellsize, y, xoff+i*cellsize, y+cellsize ); 200 p->drawLine( xoff+i*cellsize, y, xoff+i*cellsize, y+cellsize );
193 QChar u = row*nw + i; 201 QChar u = row*nw + i;
194 if ( fm.inFont( u ) ) 202 if ( fm.inFont( u ) )
195 p->drawText( xoff+i*cellsize, y, cellsize, cellsize, AlignCenter, 203 p->drawText( xoff+i*cellsize, y, cellsize, cellsize, AlignCenter,
196 u ); 204 u );
197 } 205 }
198 p->drawLine( xoff+nw*cellsize, y, xoff+nw*cellsize, y+cellsize ); 206 p->drawLine( xoff+nw*cellsize, y, xoff+nw*cellsize, y+cellsize );
199 row++; 207 row++;
200 y += cellsize; 208 y += cellsize;
201 } 209 }
202} 210}
203 211
204 212
205 213
206 214
207UniKeyboard::UniKeyboard(QWidget* parent, const char* name, int f ) 215UniKeyboard::UniKeyboard(QWidget* parent, const char* name, int f )
208 : QFrame( parent, name, f ) 216 : QFrame( parent, name, f )
209{ 217{
210 setFrameStyle( NoFrame ); 218 setFrameStyle( NoFrame );
211 sv = new UniScrollview( this ); 219 sv = new UniScrollview( this );
212 cb = new QComboBox( FALSE, this ); 220 cb = new QComboBox( FALSE, this );
213 currentBlock = 0; 221 currentBlock = 0;
214 QFontMetrics fm = sv->fontMetrics(); 222 QFontMetrics fm = sv->fontMetrics();
215 cbmap = new int[sizeof(blockMap)/sizeof(blockMap[0])]; 223 cbmap = new int[sizeof(blockMap)/sizeof(blockMap[0])];
216 for ( int i = 0; blockMap[i].name; i++ ) { 224 for ( int i = 0; blockMap[i].name; i++ ) {
217 bool any=FALSE; 225 bool any=FALSE;
218 for ( int c=blockMap[i].start; !any && c<=blockMap[i].stop; c++ ) 226 for ( int c=blockMap[i].start; !any && c<=blockMap[i].stop; c++ )
219 any = fm.inFont(QChar(c)); 227 any = fm.inFont(QChar(c));
220 if ( any ) { 228 if ( any ) {
221 cbmap[cb->count()]=i; 229 cbmap[cb->count()]=i;
222 cb->insertItem( blockMap[i].name ); 230 cb->insertItem( blockMap[i].name );
223 } 231 }
224 } 232 }
225 connect( cb, SIGNAL( activated(int)), this, SLOT( handleCombo(int)) ); 233 connect( cb, SIGNAL( activated(int)), this, SLOT( handleCombo(int)) );
226 connect( sv, SIGNAL( contentsMoving(int,int)), this, SLOT( svMove(int,int)) ); 234 connect( sv, SIGNAL( contentsMoving(int,int)), this, SLOT( svMove(int,int)) );
227 connect( sv, SIGNAL( key(ushort,ushort,ushort,bool,bool)), 235 connect( sv, SIGNAL( key(ushort,ushort,ushort,bool,bool)),
228 this, SIGNAL( key(ushort,ushort,ushort,bool,bool)) ); 236 this, SIGNAL( key(ushort,ushort,ushort,bool,bool)) );
229} 237}
230 238
231UniKeyboard::~UniKeyboard() 239UniKeyboard::~UniKeyboard()
232{ 240{
233 delete [] cbmap; 241 delete [] cbmap;
234} 242}
235 243
236void UniKeyboard::resizeEvent(QResizeEvent *) 244void UniKeyboard::resizeEvent(QResizeEvent *)
237{ 245{
238 int d = frameWidth(); 246 int d = frameWidth();
239 cb->setGeometry( d, d, width()-2*d, cb->sizeHint().height() ); 247 cb->setGeometry( d, d, width()-2*d, cb->sizeHint().height() );
240 sv->setGeometry( d, cb->height()+d, width()-2*d, height()-cb->height()-2*d ); 248 sv->setGeometry( d, cb->height()+d, width()-2*d, height()-cb->height()-2*d );
241} 249}
242 250
243void UniKeyboard::svMove( int /*x*/, int y ) 251void UniKeyboard::svMove( int /*x*/, int y )
244{ 252{
245 int cs = sv->cellSize(); 253 int cs = sv->cellSize();
246 int u = ((y+cs-1)/cs) * nw; 254 int u = ((y+cs-1)/cs) * nw;
247 int i = currentBlock; 255 int i = currentBlock;
248 while ( i > 0 && blockMap[i].start > u ) { 256 while ( i > 0 && blockMap[i].start > u ) {
249 i--; 257 i--;
250 } 258 }
251 while ( blockMap[i+1].name && blockMap[i+1].start < u ) { 259 while ( blockMap[i+1].name && blockMap[i+1].start < u ) {
252 i++; 260 i++;
253 } 261 }
254 if ( i != currentBlock ) { 262 if ( i != currentBlock ) {
255 currentBlock = i; 263 currentBlock = i;
256 for (int ind=0; ind<cb->count(); ind++) { 264 for (int ind=0; ind<cb->count(); ind++) {
257 if ( cbmap[ind] == i ) { 265 if ( cbmap[ind] == i ) {
258 cb->setCurrentItem( ind ); 266 cb->setCurrentItem( ind );
259 break; 267 break;
260 } 268 }
261 } 269 }
262 } 270 }
263} 271}
264 272
265void UniKeyboard::handleCombo( int i ) 273void UniKeyboard::handleCombo( int i )
266{ 274{
267 currentBlock = cbmap[i]; 275 currentBlock = cbmap[i];
268 sv->scrollTo( blockMap[currentBlock].start ); 276 sv->scrollTo( blockMap[currentBlock].start );
269} 277}
270 278
271void UniKeyboard::resetState() 279void UniKeyboard::resetState()
272{ 280{
273} 281}
274 282
275QSize UniKeyboard::sizeHint() const 283QSize UniKeyboard::sizeHint() const
276{ 284{
277 return QSize( 240, 2+sv->cellSize()*4+cb->sizeHint().height() ); 285 return QSize( 240, 2+sv->cellSize()*4+cb->sizeHint().height() );
278} 286}