diff options
author | Pekka Gehör <pekka.gehor@qt.io> | 2021-02-05 11:24:10 +0200 |
---|---|---|
committer | Pekka Gehör <pekka.gehor@qt.io> | 2021-05-12 12:49:46 +0000 |
commit | 37d6fd60a800a0956b41870aca338a30e0bd5768 (patch) | |
tree | 5376757205e2371a0ef2f95742f7c17db215bc02 /src/android/jar | |
parent | 5b681bea902c9b9556ea8325df17338e78039d20 (diff) |
Android: Fix position issue of the EditPopupMenu
Set y for the EditPopupMenu from the previous correct value if select handles values are zero.
The SelectionHandle.bottom() is zero if selection handles have not yet been displayed on the screen.
Task-number: QTBUG-71900
Change-Id: I3694a8edd4f0d8f8799dbac1217a75c375038e66
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/android/jar')
-rw-r--r-- | src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java b/src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java index 131f2a103f..99940bbd02 100644 --- a/src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java +++ b/src/android/jar/src/org/qtproject/qt/android/EditPopupMenu.java @@ -113,10 +113,13 @@ public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, View.O y2 -= m_view.getHeight(); if (y2 < 0) { - if (cursorHandle != null) + if (cursorHandle != null) { y2 = cursorHandle.bottom(); - else if (leftSelectionHandle != null && rightSelectionHandle != null) + } else if (leftSelectionHandle != null && rightSelectionHandle != null) { y2 = Math.max(leftSelectionHandle.bottom(), rightSelectionHandle.bottom()); + if (y2 <= 0) + m_layout.requestLayout(); + } } if (m_layout.getWidth() < x + m_view.getWidth() / 2) |