diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2023-10-31 14:48:52 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2023-10-31 14:32:59 +0000 |
commit | 76a8f81ea7b3fe163ad2072342e77db993e31be9 (patch) | |
tree | 80b84bb7f4663b0667e4c81bd805833c6c04bb1b /src/plugins/welcome | |
parent | 141cf78b2d51ed80b828649d14a302c7303d835b (diff) |
Welcome: Fix initial welcome screen layout for small window
The visibility of some Welcome screen elements depends on the size of
the Welcome screen.
When starting Qt Creator with a small initial window size, the hiding
of the side bar did not work.
This change removes the check for visibility as the main fix for
QTCREATORBUG-29800. The QTimer::singleShot is replaced with immediate
layout calculation in order to avoid another initial layout issue which
is only visible during startup.
Amends: 1c24ef6406d56c4e5e45741caf5ea023ae5f9f31
Fixes: QTCREATORBUG-29800
Change-Id: I4b058791f2ed2e85b9cbca932585b71a985445f9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/welcome')
-rw-r--r-- | src/plugins/welcome/welcomeplugin.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 342375c4e2f..c0a2f25ac94 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -80,8 +80,7 @@ signals: void ResizeSignallingWidget::resizeEvent(QResizeEvent *event) { - if (isVisible()) - emit resized(event->size(), event->oldSize()); + emit resized(event->size(), event->oldSize()); } class WelcomeMode : public IMode @@ -357,11 +356,9 @@ WelcomeMode::WelcomeMode() const bool hideSideArea = size.width() <= 750; const bool hideBottomArea = size.width() <= 850; const bool compactVertically = size.height() <= 530; - QTimer::singleShot(0, this, [this, hideSideArea, hideBottomArea, compactVertically] { - m_sideArea->setVisible(!hideSideArea); - m_bottomArea->setVisible(!(hideBottomArea || compactVertically)); - m_topArea->setCompact(compactVertically); - }); + m_sideArea->setVisible(!hideSideArea); + m_bottomArea->setVisible(!(hideBottomArea || compactVertically)); + m_topArea->setCompact(compactVertically); }); m_sideArea = new SideArea(m_modeWidget); |