From d010dbd190a45b28fc736abaef175f08a2bf790a Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sat, 2 Sep 2017 00:06:56 +0200 Subject: [PATCH] Welcome: Remove the big minimal height requirement The SideBar in the QtWidgets based Welcome mode had a high minimal height which cause whole Qt Creator not to fit on my HD(720) screen. This change wraps the SideBar into a vertical scroll area. Change-Id: I1d70ced1bbe803fb866159dd557a401c3ab6a9b2 Reviewed-by: hjk --- src/plugins/welcome/welcomeplugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index c7d6058012c..72823240ae3 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -289,6 +290,11 @@ WelcomeMode::WelcomeMode() m_modeWidget->setPalette(palette); m_sideBar = new SideBar(m_modeWidget); + auto scrollableSideBar = new QScrollArea(m_modeWidget); + scrollableSideBar->setWidget(m_sideBar); + scrollableSideBar->setWidgetResizable(true); + scrollableSideBar->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + scrollableSideBar->setFrameShape(QFrame::NoFrame); auto divider = new QWidget(m_modeWidget); divider->setMaximumWidth(1); @@ -300,7 +306,7 @@ WelcomeMode::WelcomeMode() m_pageStack->setAutoFillBackground(true); auto hbox = new QHBoxLayout; - hbox->addWidget(m_sideBar); + hbox->addWidget(scrollableSideBar); hbox->addWidget(divider); hbox->addWidget(m_pageStack); hbox->setStretchFactor(m_pageStack, 10);