summaryrefslogtreecommitdiff
path: root/core/launcher/inputmethods.cpp
Unidiff
Diffstat (limited to 'core/launcher/inputmethods.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/inputmethods.cpp20
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
@@ -90,9 +90,5 @@ InputMethods::InputMethods( QWidget *parent ) :
90 mkeyboard(0), imethod(0) 90 mkeyboard(0), imethod(0)
91{ 91{
92 Config cfg( "Launcher" ); 92 readConfig();
93 cfg.setGroup( "InputMethods" );
94 inputWidgetStyle = QWidget::WStyle_Customize | QWidget::WStyle_StaysOnTop | QWidget::WGroupLeader | QWidget::WStyle_Tool;
95 inputWidgetStyle |= cfg.readBoolEntry( "Float", false ) ? QWidget::WStyle_DialogBorder : 0;
96 inputWidgetWidth = cfg.readNumEntry( "Width", 100 );
97 93
98 setBackgroundMode( PaletteBackground ); 94 setBackgroundMode( PaletteBackground );
@@ -533,5 +529,5 @@ void InputMethods::showKbd( bool on )
533 529
534 int height = QMIN( mkeyboard->widget->sizeHint().height(), 134 ); 530 int height = QMIN( mkeyboard->widget->sizeHint().height(), 134 );
535 int width = qApp->desktop()->width() * (inputWidgetWidth*0.01); 531 int width = static_cast<int>( qApp->desktop()->width() * (inputWidgetWidth*0.01) );
536 int left = 0; 532 int left = 0;
537 int top = mapToGlobal( QPoint() ).y() - height; 533 int top = mapToGlobal( QPoint() ).y() - height;
@@ -609,5 +605,5 @@ void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool pr
609} 605}
610 606
611bool InputMethods::eventFilter( QObject* o, QEvent* e ) 607bool InputMethods::eventFilter( QObject* , QEvent* e )
612{ 608{
613 if ( e->type() == QEvent::Close ) 609 if ( e->type() == QEvent::Close )
@@ -620,2 +616,12 @@ bool InputMethods::eventFilter( QObject* o, QEvent* e )
620 return false; 616 return false;
621} 617}
618
619void InputMethods::readConfig() {
620 Config cfg( "Launcher" );
621 cfg.setGroup( "InputMethods" );
622
623 inputWidgetStyle = QWidget::WStyle_Customize | QWidget::WStyle_StaysOnTop | QWidget::WGroupLeader | QWidget::WStyle_Tool;
624 inputWidgetStyle |= cfg.readBoolEntry( "Float", false ) ?
625 QWidget::WStyle_DialogBorder : 0;
626 inputWidgetWidth = cfg.readNumEntry( "Width", 100 );
627}