forked from qt-creator/qt-creator
Squish: Fix helper function for small resolutions
Depending on the screen size the context menu may be oriented differently depending on the point where the context menu had been triggered. Change-Id: Iae3834283e8e34ed44e57237561f1367cdaae108 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
@@ -78,7 +78,10 @@ def menuVisibleAtEditor(editor, menuInList):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500)
|
menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500)
|
||||||
success = menu.visible and widgetContainsPoint(editor, menu.mapToGlobal(QPoint(0, 0)))
|
topLeft = menu.mapToGlobal(QPoint(0, 0))
|
||||||
|
bottomLeft = menu.mapToGlobal(QPoint(0, menu.height))
|
||||||
|
success = menu.visible and (widgetContainsPoint(editor, topLeft)
|
||||||
|
or widgetContainsPoint(editor, bottomLeft))
|
||||||
if success:
|
if success:
|
||||||
menuInList[0] = menu
|
menuInList[0] = menu
|
||||||
return success
|
return success
|
||||||
|
Reference in New Issue
Block a user