-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 @@ -10,16 +10,19 @@ #include <qspinbox.h> #include <qlistbox.h> #include <qlabel.h> #include <qcombobox.h> #include <qdir.h> +#define DEFAULT_ROWS 2 +#define DEFAULT_COLS 11 + /* FunctionKeyboard {{{1 */ FunctionKeyboard::FunctionKeyboard(QWidget *parent) : - QFrame(parent), numRows(2), numCols(11), + QFrame(parent), numRows(DEFAULT_ROWS), numCols(DEFAULT_COLS), pressedRow(0), pressedCol(0) { setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed)); /* * all the saving/loading is now done in a profile. downside is that you cant modify @@ -220,12 +223,16 @@ QSize FunctionKeyboard::sizeHint() const { return QSize(width(), keyHeight * numRows + 1); } void FunctionKeyboard::loadDefaults() { + numRows = DEFAULT_ROWS; + numCols = DEFAULT_COLS; + keyWidth = (double)width()/numCols; // have to reset this thing too + keys.insert( "r0c0", FKey ("Enter", "enter", Qt::Key_Enter, 0)); keys.insert( "r0c1", FKey ("Space", "space", Qt::Key_Space, Qt::Key_Space)); keys.insert( "r0c2", FKey ("Tab", "tab", Qt::Key_Tab, 0)); keys.insert( "r0c3", FKey ("Up", "up", Qt::Key_Up, 0)); keys.insert( "r0c4", FKey ("Down", "down", Qt::Key_Down, 0)); |