From 2473be1763dbd24560cab1af53ff55b4160178fe Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Tue, 16 Jan 2024 16:52:08 +0300 Subject: [PATCH] UI: MyFort: About: Show release text in scroll area --- src/ui/form/home/pages/aboutpage.cpp | 8 +++++--- src/ui/form/home/pages/aboutpage.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ui/form/home/pages/aboutpage.cpp b/src/ui/form/home/pages/aboutpage.cpp index 61d94e51..cbd76406 100644 --- a/src/ui/form/home/pages/aboutpage.cpp +++ b/src/ui/form/home/pages/aboutpage.cpp @@ -51,17 +51,19 @@ void AboutPage::setupNewVersionBox() m_labelRelease->setWordWrap(true); m_labelRelease->setOpenExternalLinks(true); + m_labelArea = ControlUtil::wrapToScrollArea(m_labelRelease); + m_labelArea->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); + // Buttons auto buttonsLayout = setupButtonsLayout(); auto layout = new QVBoxLayout(); layout->setSpacing(10); - layout->addWidget(m_labelRelease); + layout->addWidget(m_labelArea); layout->addLayout(buttonsLayout); m_gbNewVersion = new QGroupBox(); - m_gbNewVersion->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); m_gbNewVersion->setMinimumWidth(380); m_gbNewVersion->setLayout(layout); } @@ -94,7 +96,7 @@ void AboutPage::setupNewVersionUpdate() auto updateChecker = taskManager()->taskInfoUpdateChecker(); m_isNewVersion = updateChecker->isNewVersion(); - m_labelRelease->setVisible(m_isNewVersion); + m_labelArea->setVisible(m_isNewVersion); m_labelRelease->setText(updateChecker->releaseText()); m_btDownload->setVisible(m_isNewVersion); diff --git a/src/ui/form/home/pages/aboutpage.h b/src/ui/form/home/pages/aboutpage.h index 76dfb784..f96e6d3a 100644 --- a/src/ui/form/home/pages/aboutpage.h +++ b/src/ui/form/home/pages/aboutpage.h @@ -26,6 +26,7 @@ private: QGroupBox *m_gbNewVersion = nullptr; QLabel *m_labelRelease = nullptr; + QWidget *m_labelArea = nullptr; QToolButton *m_btDownload = nullptr; QToolButton *m_btCheckUpdate = nullptr; };