diff --git a/inputcontext/QskInputCompositionModel.cpp b/inputcontext/QskInputCompositionModel.cpp index c8cae853..ad9e2dd4 100644 --- a/inputcontext/QskInputCompositionModel.cpp +++ b/inputcontext/QskInputCompositionModel.cpp @@ -160,9 +160,9 @@ void QskInputCompositionModel::composeKey( Qt::Key key ) QCoreApplication::sendEvent( focusWindow, &keyRelease ); } - return; } #endif + return; } case Qt::Key_Left: diff --git a/inputcontext/inputcontext.pro b/inputcontext/inputcontext.pro index bcbb2622..c941b7b2 100644 --- a/inputcontext/inputcontext.pro +++ b/inputcontext/inputcontext.pro @@ -18,13 +18,26 @@ QSK_SUBDIRS = \ $${QSK_ROOT}/src/dialogs INCLUDEPATH *= $${QSK_SUBDIRS} -INCLUDEPATH += ../3rdparty/pinyin/include -DEPENDPATH += $${QSK_SUBDIRS} +DEPENDPATH *= $${QSK_SUBDIRS} DESTDIR = $${QSK_OUT_ROOT}/plugins/platforminputcontexts QMAKE_RPATHDIR *= $${QSK_OUT_ROOT}/lib -LIBS *= -L$${QSK_OUT_ROOT}/lib -lqskinny -Wl,-Bstatic -L$${DESTDIR} -lqskinputcontext_pinyin -lqskinputcontext_hunspell -Wl,-Bdynamic +LIBS *= -L$${QSK_OUT_ROOT}/lib -lqskinny + +# we need to write the lines below in a platform independent way: TODO ... + +pinyin { + INCLUDEPATH *= $${QSK_ROOT}/3rdparty/pinyin/include + LIBS *= -Wl,-Bstatic -L$${DESTDIR} -lqskinputcontext_pinyin +} + +hunspell { + INCLUDEPATH *= $${QSK_ROOT}/3rdparty/hunspell/src + LIBS *= -Wl,-Bstatic -L$${DESTDIR} -lqskinputcontext_hunspell +} + +LIBS *= -Wl,-Bdynamic win32 { contains(QSK_CONFIG, QskDll) { diff --git a/qskconfig.pri b/qskconfig.pri index 9952b919..e8ee580f 100644 --- a/qskconfig.pri +++ b/qskconfig.pri @@ -10,6 +10,9 @@ CONFIG += pedantic # CONFIG += debug # CONFIG += sanitize +CONFIG += pinyin +CONFIG += hunspell + MOC_DIR = moc OBJECTS_DIR = obj RCC_DIR = rcc diff --git a/src/controls/QskVirtualKeyboard.cpp b/src/controls/QskVirtualKeyboard.cpp index 2ed9a2c9..3e8a90e3 100644 --- a/src/controls/QskVirtualKeyboard.cpp +++ b/src/controls/QskVirtualKeyboard.cpp @@ -641,14 +641,14 @@ void QskVirtualKeyboard::createUI() setAutoLayoutChildren( true ); - auto& panelKeyData = keyData(); + auto outerBox = new QskLinearBox( Qt::Vertical, this ); - QskLinearBox* outterBox = new QskLinearBox( Qt::Vertical, this ); - outterBox->setAutoAddChildren( true ); - - m_data->candidateBox = new QskLinearBox( Qt::Horizontal, outterBox ); + m_data->candidateBox = new QskLinearBox( Qt::Horizontal, outerBox ); +#if 1 + // should be skin hints TODO ... QMarginsF margins( 0, 10, 0, 20 ); // ### m_data->candidateBox->setMargins( margins ); +#endif // to determine suggestions buttons width // (otherwise empty buttons would be too small when there are only a few suggestions): @@ -659,9 +659,12 @@ void QskVirtualKeyboard::createUI() for( int a = 0; a < QskVirtualKeyboardCandidateButton::maxCandidates(); ++a ) { - QskVirtualKeyboardCandidateButton* candidateButton = new QskVirtualKeyboardCandidateButton( this, m_data->candidateBox ); + auto candidateButton = new QskVirtualKeyboardCandidateButton( this, m_data->candidateBox ); qreal height = candidateButton->sizeHint().height(); - candidateButton->setPreferredHeight( height + 10 ); // ### propper padding by adding Panel subcontrol +#if 1 + // should be done by margins/paddings + candidateButton->setPreferredHeight( height + 10 ); +#endif candidateButton->setPreferredWidth( candidateButtonWidth ); candidateButton->installEventFilter( this ); @@ -670,13 +673,7 @@ void QskVirtualKeyboard::createUI() } m_data->candidateBox->setVisible( m_data->candidateBoxVisible ); - outterBox->setRetainSizeWhenHidden( m_data->candidateBox, true ); - - qreal candidatesHeight = m_data->candidateBox->sizeHint().height(); - - const auto contentsRect = layoutRect(); - const qreal sx = contentsRect.size().width(); - const qreal sy = contentsRect.size().height() - candidatesHeight; + outerBox->setRetainSizeWhenHidden( m_data->candidateBox, true ); } void QskVirtualKeyboard::updateUI()