-rw-r--r-- | noncore/apps/opie-console/function_keyboard.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index ce65052..5f3b5ec 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp | |||
@@ -13,10 +13,13 @@ | |||
13 | #include <qcombobox.h> | 13 | #include <qcombobox.h> |
14 | #include <qdir.h> | 14 | #include <qdir.h> |
15 | 15 | ||
16 | #define DEFAULT_ROWS 2 | ||
17 | #define DEFAULT_COLS 11 | ||
18 | |||
16 | /* FunctionKeyboard {{{1 */ | 19 | /* FunctionKeyboard {{{1 */ |
17 | 20 | ||
18 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : | 21 | FunctionKeyboard::FunctionKeyboard(QWidget *parent) : |
19 | QFrame(parent), numRows(2), numCols(11), | 22 | QFrame(parent), numRows(DEFAULT_ROWS), numCols(DEFAULT_COLS), |
20 | pressedRow(0), pressedCol(0) { | 23 | pressedRow(0), pressedCol(0) { |
21 | 24 | ||
22 | setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); | 25 | setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); |
@@ -223,6 +226,10 @@ QSize FunctionKeyboard::sizeHint() const { | |||
223 | 226 | ||
224 | void FunctionKeyboard::loadDefaults() { | 227 | void FunctionKeyboard::loadDefaults() { |
225 | 228 | ||
229 | numRows = DEFAULT_ROWS; | ||
230 | numCols = DEFAULT_COLS; | ||
231 | keyWidth = (double)width()/numCols; // have to reset this thing too | ||
232 | |||
226 | keys.insert( "r0c0", FKey ("Enter", "enter", Qt::Key_Enter, 0)); | 233 | keys.insert( "r0c0", FKey ("Enter", "enter", Qt::Key_Enter, 0)); |
227 | keys.insert( "r0c1", FKey ("Space", "space", Qt::Key_Space, Qt::Key_Space)); | 234 | keys.insert( "r0c1", FKey ("Space", "space", Qt::Key_Space, Qt::Key_Space)); |
228 | keys.insert( "r0c2", FKey ("Tab", "tab", Qt::Key_Tab, 0)); | 235 | keys.insert( "r0c2", FKey ("Tab", "tab", Qt::Key_Tab, 0)); |