Welcome: Fix scrolling in the sidebar

Some items did not move when the sidebar got scrolled. This change
assigns them the right parent widget, so that they also scroll
correctly.

Fixes: QTCREATORBUG-26956
Change-Id: I28c131ffaa867652a4d9e282566f7986a0df9383
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Alessandro Portale
2022-01-30 23:15:37 +01:00
parent 39d078700a
commit 64dea33250

View File

@@ -288,7 +288,7 @@ public:
newVBox->setSpacing(buttonSpacing / 3); newVBox->setSpacing(buttonSpacing / 3);
vbox->addItem(newVBox); vbox->addItem(newVBox);
auto newLabel = new QLabel(tr("New to Qt?"), this); auto newLabel = new QLabel(tr("New to Qt?"), mainWidget);
newLabel->setFont(brandFont()); newLabel->setFont(brandFont());
newLabel->setAlignment(Qt::AlignHCenter); newLabel->setAlignment(Qt::AlignHCenter);
newVBox->addWidget(newLabel); newVBox->addWidget(newLabel);
@@ -461,7 +461,7 @@ void WelcomeMode::addPage(IWelcomePage *page)
if (m_pluginList.at(idx)->priority() >= pagePriority) if (m_pluginList.at(idx)->priority() >= pagePriority)
break; break;
} }
auto pageButton = new WelcomePageButton(m_sideArea); auto pageButton = new WelcomePageButton(m_sideArea->widget());
auto pageId = page->id(); auto pageId = page->id();
pageButton->setText(page->title()); pageButton->setText(page->title());
pageButton->setActiveChecker([this, pageId] { return m_activePage == pageId; }); pageButton->setActiveChecker([this, pageId] { return m_activePage == pageId; });