iOS: Use 160x160 as default normal window size, like on other platforms

For top level windows, the window size will still reflect the screen's
available geometry, as the window state will be maximized by default.

[ChangeLog][iOS] The default normalGeometry() of a window is now 160x160,
instead of following the screen geometry. Top level windows are still
maximized by default, as before.

Change-Id: Ice752f74d943bf4fbb9be9e39f07798431fc2b0c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
bb10
Tor Arne Vestbø 2023-11-16 17:10:21 +01:00
parent 19b17667da
commit 3c9017b0e2
1 changed files with 7 additions and 5 deletions

View File

@ -29,6 +29,11 @@
QT_BEGIN_NAMESPACE
enum {
defaultWindowWidth = 160,
defaultWindowHeight = 160
};
QIOSWindow::QIOSWindow(QWindow *window, WId nativeHandle)
: QPlatformWindow(window)
, m_windowLevel(0)
@ -54,12 +59,9 @@ QIOSWindow::QIOSWindow(QWindow *window, WId nativeHandle)
if (!isForeignWindow()) {
// Resolve default window geometry in case it was not set before creating the
// platform window. This picks up eg. minimum-size if set, and defaults to
// the "maxmized" geometry (even though we're not in that window state).
// FIXME: Detect if we apply a maximized geometry and send a window state
// change event in that case.
// platform window. This picks up eg. minimum-size if set.
m_normalGeometry = initialGeometry(window, QPlatformWindow::geometry(),
screen()->availableGeometry().width(), screen()->availableGeometry().height());
defaultWindowWidth, defaultWindowHeight);
setWindowState(window->windowStates());
setOpacity(window->opacity());