diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2017-01-06 11:14:07 +0200 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2017-01-20 17:37:41 +0000 |
commit | 839a0afec5c39c92ac7221e2c5b6a866d6848382 (patch) | |
tree | 12a6bf83805af3cecc2887518d4ce12098dac817 /src/virtualkeyboard/settings.cpp | |
parent | e2c4fde1804654e449465aee1b9d217e05f06075 (diff) |
Automatically hide word candidate list
This change adds support for automatically hiding word candidate list
when inactive. This feature includes the following enhancements:
- Added new settings:
* VirtualKeyboardSettings.wordCandidateList.autoHideDelay
* VirtualKeyboardSettings.wordCandidateList.alwaysVisible
- Automatic hiding of word candidate list when inactive and when
autoHideDelay elapsed.
- alwaysVisible setting restores the old functionality.
- Added new signal selectionListsChanged() to input method, allowing
the input method to dynamically allocate or deallocate selection
lists.
- HunspellInputMethod does not allocate selection list when
dictionary cannot be loaded, or Qt::ImhNoPredictiveText is enabled.
Also, it will no longer use pre-edit text in this case.
- OpenWnnInputMethod does not allocate selection list if not needed.
[ChangeLog] Automatically hide word candidate list when inactive.
Change-Id: Ifa95ae8a7c47a96719ffdc2929601ff2ef9c0d2e
Reviewed-by: Gordan Markus <gordan.markus@pelagicore.com>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/virtualkeyboard/settings.cpp')
-rw-r--r-- | src/virtualkeyboard/settings.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/virtualkeyboard/settings.cpp b/src/virtualkeyboard/settings.cpp index f01c506d..55faca8c 100644 --- a/src/virtualkeyboard/settings.cpp +++ b/src/virtualkeyboard/settings.cpp @@ -42,7 +42,9 @@ public: locale(), availableLocales(), activeLocales(), - layoutPath() + layoutPath(), + wclAutoHideDelay(5000), + wclAlwaysVisible(false) {} QString style; @@ -51,6 +53,8 @@ public: QStringList availableLocales; QStringList activeLocales; QUrl layoutPath; + int wclAutoHideDelay; + bool wclAlwaysVisible; }; static QScopedPointer<Settings> s_settingsInstance; @@ -162,4 +166,34 @@ void Settings::setLayoutPath(const QUrl &layoutPath) } } +int Settings::wclAutoHideDelay() const +{ + Q_D(const Settings); + return d->wclAutoHideDelay; +} + +void Settings::setWclAutoHideDelay(int wclAutoHideDelay) +{ + Q_D(Settings); + if (d->wclAutoHideDelay != wclAutoHideDelay) { + d->wclAutoHideDelay = wclAutoHideDelay; + emit wclAutoHideDelayChanged(); + } +} + +bool Settings::wclAlwaysVisible() const +{ + Q_D(const Settings); + return d->wclAlwaysVisible; +} + +void Settings::setWclAlwaysVisible(bool wclAlwaysVisible) +{ + Q_D(Settings); + if (d->wclAlwaysVisible != wclAlwaysVisible) { + d->wclAlwaysVisible = wclAlwaysVisible; + emit wclAlwaysVisibleChanged(); + } +} + } // namespace QtVirtualKeyboard |