From cc30e923ff761f2c94186cfd5eceee2074f4e69d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 6 Mar 2024 20:39:39 +0100 Subject: [PATCH] Welcome: Also hide separator lines when collapsing top- and side areas This moves the separator lines into the respective areas, so that the lines also disappear when their area collapes. Looks cleaner (for pixel obsessed people like me). Change-Id: I314c2c462767666638eae57087606f2a6ca4ae4a Reviewed-by: Alessandro Portale --- src/plugins/welcome/welcomeplugin.cpp | 35 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 4b3a5074f95..8f969c107fe 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -156,12 +156,16 @@ public: using namespace Layouting; - Row { - ideIconLabel, - welcomeLabel, - st, - spacing(ExVPaddingGapXl), - customMargin({HPaddingM, VPaddingM, HPaddingM, VPaddingM}), + Column { + Row { + ideIconLabel, + welcomeLabel, + st, + spacing(ExVPaddingGapXl), + customMargin({HPaddingM, VPaddingM, HPaddingM, VPaddingM}), + }, + createRule(Qt::Horizontal), + noMargin(), spacing(0), }.attachTo(this); } }; @@ -182,7 +186,7 @@ public: using namespace Layouting; - Column mainLayout { + Column mainColumn { spacing(0), customMargin({ExVPaddingGapXl, 0, ExVPaddingGapXl, 0}), }; @@ -224,8 +228,8 @@ public: } essentials.attachTo(m_essentials); - mainLayout.addItem(m_essentials); - mainLayout.addItem(st); + mainColumn.addItem(m_essentials); + mainColumn.addItem(st); { auto label = new Label(Tr::tr("Explore more"), Label::Secondary); @@ -263,10 +267,17 @@ public: m_links = new QWidget; linksLayout.attachTo(m_links); - mainLayout.addItem(m_links); + mainColumn.addItem(m_links); } - QWidget *mainWidget = mainLayout.emerge(); + QWidget *mainWidget = new QWidget; + + Row { + mainColumn, + createRule(Qt::Vertical), + noMargin(), spacing(0), + }.attachTo(mainWidget); + setWidget(mainWidget); } @@ -327,10 +338,8 @@ WelcomeMode::WelcomeMode() Column { new StyledBar, m_topArea, - createRule(Qt::Horizontal), Row { m_sideArea, - createRule(Qt::Vertical), m_pageStack, }, noMargin(),