Android: Fix for hiding cursor handles
After c80f262258b7846bf199887bcfdbb6dcfda6ad6f commit (which fixed selection for read-only texts), checking if m_handleMode is Hidden was removed. Because of that hidding cursor handle stopped work correctly. This commit brings back check if m_handleMode is Hidden. Also when only one handle is visible, it should be hidden within the next 5 seconds regardless for keyboard visibility. That is how it is handled in pure Android apps. Pick-to: 6.5 Fixes: QTBUG-117367 Change-Id: I0400f9604234bfad7fe17d74673ae9a93088bab4 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> (cherry picked from commit 9c8651478b482cb162a6fd92bb79f0d7f6a2573c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
23c1b520bd
commit
0eff6dfe9c
@ -563,6 +563,11 @@ void QAndroidInputContext::updateSelectionHandles()
|
||||
bool readOnly = readOnlyVariant.toBool();
|
||||
QPlatformWindow *qPlatformWindow = qGuiApp->focusWindow()->handle();
|
||||
|
||||
if (!readOnly && ((m_handleMode & 0xff) == Hidden)) {
|
||||
QtAndroidInput::updateHandles(Hidden);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( cpos == anchor && (!readOnlyVariant.isValid() || readOnly)) {
|
||||
QtAndroidInput::updateHandles(Hidden);
|
||||
return;
|
||||
@ -589,9 +594,8 @@ void QAndroidInputContext::updateSelectionHandles()
|
||||
if (!query.value(Qt::ImSurroundingText).toString().isEmpty())
|
||||
buttons |= EditContext::SelectAllButton;
|
||||
QtAndroidInput::updateHandles(m_handleMode, editMenuPoint, buttons, cursorPointGlobal);
|
||||
// The VK is hidden, reset the timer
|
||||
if (m_hideCursorHandleTimer.isActive())
|
||||
m_hideCursorHandleTimer.start();
|
||||
m_hideCursorHandleTimer.start();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user