author | zecke <zecke> | 2004-08-22 21:35:22 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-22 21:35:22 (UTC) |
commit | 8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5 (patch) (side-by-side diff) | |
tree | caf4d5d4cab240f2e7653b394666c5e2fb178798 /core/launcher/inputmethods.cpp | |
parent | 2304c546ec73f2643621f04d61128c2686812cd1 (diff) | |
download | opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.zip opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.tar.gz opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.tar.bz2 |
Reload InputMethods when LauncherSettings changed InputMethod Options
Diffstat (limited to 'core/launcher/inputmethods.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/inputmethods.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp index a0e8939..7e99796 100644 --- a/core/launcher/inputmethods.cpp +++ b/core/launcher/inputmethods.cpp @@ -89,11 +89,7 @@ InputMethods::InputMethods( QWidget *parent ) : QWidget( parent, "InputMethods", WStyle_Tool | WStyle_Customize ), mkeyboard(0), imethod(0) { - Config cfg( "Launcher" ); - cfg.setGroup( "InputMethods" ); - inputWidgetStyle = QWidget::WStyle_Customize | QWidget::WStyle_StaysOnTop | QWidget::WGroupLeader | QWidget::WStyle_Tool; - inputWidgetStyle |= cfg.readBoolEntry( "Float", false ) ? QWidget::WStyle_DialogBorder : 0; - inputWidgetWidth = cfg.readNumEntry( "Width", 100 ); + readConfig(); setBackgroundMode( PaletteBackground ); QHBoxLayout *hbox = new QHBoxLayout( this ); @@ -532,7 +528,7 @@ void InputMethods::showKbd( bool on ) mkeyboard->resetState(); int height = QMIN( mkeyboard->widget->sizeHint().height(), 134 ); - int width = qApp->desktop()->width() * (inputWidgetWidth*0.01); + int width = static_cast<int>( qApp->desktop()->width() * (inputWidgetWidth*0.01) ); int left = 0; int top = mapToGlobal( QPoint() ).y() - height; @@ -608,7 +604,7 @@ void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool pr #endif } -bool InputMethods::eventFilter( QObject* o, QEvent* e ) +bool InputMethods::eventFilter( QObject* , QEvent* e ) { if ( e->type() == QEvent::Close ) { @@ -619,3 +615,13 @@ bool InputMethods::eventFilter( QObject* o, QEvent* e ) } return false; } + +void InputMethods::readConfig() { + Config cfg( "Launcher" ); + cfg.setGroup( "InputMethods" ); + + inputWidgetStyle = QWidget::WStyle_Customize | QWidget::WStyle_StaysOnTop | QWidget::WGroupLeader | QWidget::WStyle_Tool; + inputWidgetStyle |= cfg.readBoolEntry( "Float", false ) ? + QWidget::WStyle_DialogBorder : 0; + inputWidgetWidth = cfg.readNumEntry( "Width", 100 ); +} |