Android: simplify/refactor QAndroidPlatformWindow::setVisible()
Simplify the if condidions in this function for better readability. Task-number: QTBUG-132716 Change-Id: I4a4eee61d4b9111d82272205133d7719b7be4a9e Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
This commit is contained in:
parent
483768fb8e
commit
8047d2ec89
@ -163,10 +163,11 @@ void QAndroidPlatformWindow::setVisible(bool visible)
|
|||||||
{
|
{
|
||||||
if (isEmbeddingContainer())
|
if (isEmbeddingContainer())
|
||||||
return;
|
return;
|
||||||
m_nativeQtWindow.callMethod<void>("setVisible", visible);
|
|
||||||
|
|
||||||
if (visible) {
|
|
||||||
if (window()->isTopLevel()) {
|
if (window()->isTopLevel()) {
|
||||||
|
if (!visible && window() == qGuiApp->focusWindow()) {
|
||||||
|
platformScreen()->topVisibleWindowChanged();
|
||||||
|
} else {
|
||||||
updateSystemUiVisibility();
|
updateSystemUiVisibility();
|
||||||
if ((m_windowState & Qt::WindowFullScreen)
|
if ((m_windowState & Qt::WindowFullScreen)
|
||||||
|| (window()->flags() & Qt::ExpandedClientAreaHint)) {
|
|| (window()->flags() & Qt::ExpandedClientAreaHint)) {
|
||||||
@ -176,12 +177,13 @@ void QAndroidPlatformWindow::setVisible(bool visible)
|
|||||||
}
|
}
|
||||||
requestActivateWindow();
|
requestActivateWindow();
|
||||||
}
|
}
|
||||||
} else if (window()->isTopLevel() && window() == qGuiApp->focusWindow()) {
|
|
||||||
platformScreen()->topVisibleWindowChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect availableGeometry = screen()->availableGeometry();
|
m_nativeQtWindow.callMethod<void>("setVisible", visible);
|
||||||
if (geometry().width() > 0 && geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0)
|
|
||||||
|
if (geometry().isEmpty() || screen()->availableGeometry().isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
QPlatformWindow::setVisible(visible);
|
QPlatformWindow::setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user