diff --git a/src/plugins/coreplugin/welcomepagehelper.cpp b/src/plugins/coreplugin/welcomepagehelper.cpp index 62f8ef6054a..4826984d3d9 100644 --- a/src/plugins/coreplugin/welcomepagehelper.cpp +++ b/src/plugins/coreplugin/welcomepagehelper.cpp @@ -723,6 +723,15 @@ void SectionedGridView::setSearchString(const QString &searchString) filterModel->setSearchString(searchString); } +static QWidget *createSeparator(QWidget *parent) +{ + QWidget *line = Layouting::createHr(parent); + QSizePolicy linePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored); + linePolicy.setHorizontalStretch(2); + line->setSizePolicy(linePolicy); + return line; +} + ListModel *SectionedGridView::addSection(const Section §ion, const QList &items) { auto model = new ListModel(this); @@ -747,12 +756,8 @@ ListModel *SectionedGridView::addSection(const Section §ion, const QList" + Tr::tr("Show All") + " >", this); seeAllLink->setVisible(gridView->maxRows().has_value()); connect(seeAllLink, &QLabel::linkActivated, this, [this, section] { zoomInSection(section); }); - QWidget *line = createHr(this); - QSizePolicy linePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored); - linePolicy.setHorizontalStretch(2); - line->setSizePolicy(linePolicy); - QWidget *sectionLabel = Row{section.name, line, seeAllLink, Space(HSpacing)}.emerge( - Layouting::WithoutMargins); + QWidget *sectionLabel = Row{section.name, createSeparator(this), seeAllLink, Space(HSpacing)} + .emerge(Layouting::WithoutMargins); m_sectionLabels.append(sectionLabel); sectionLabel->setContentsMargins(0, ItemGap, 0, 0); sectionLabel->setFont(Core::WelcomePageHelpers::brandFont()); @@ -804,8 +809,8 @@ void SectionedGridView::zoomInSection(const Section §ion) delete zoomedInWidget; setCurrentIndex(0); }); - QWidget *sectionLabel = Column{hr, Row{section.name, st, backLink, Space(HSpacing)}}.emerge( - Layouting::WithoutMargins); + QWidget *sectionLabel = Row{section.name, createSeparator(this), backLink, Space(HSpacing)} + .emerge(Layouting::WithoutMargins); sectionLabel->setContentsMargins(0, ItemGap, 0, 0); sectionLabel->setFont(Core::WelcomePageHelpers::brandFont());