From e62381e3ff190a8c93ffccebd53630af1a42454c Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Fri, 1 Nov 2024 14:33:49 +0500 Subject: [PATCH] UI: GraphPage: Simplify setupGraphColors() to have less lines --- src/ui/form/opt/pages/graphpage.cpp | 9 +++++++++ src/ui/form/opt/pages/graphpage.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/ui/form/opt/pages/graphpage.cpp b/src/ui/form/opt/pages/graphpage.cpp index 6efeccf7..c3d4233d 100644 --- a/src/ui/form/opt/pages/graphpage.cpp +++ b/src/ui/form/opt/pages/graphpage.cpp @@ -256,6 +256,12 @@ void GraphPage::setupColorsBox() } void GraphPage::setupGraphColors() +{ + setupGraphColors1(); + setupGraphColors2(); +} + +void GraphPage::setupGraphColors1() { m_graphColor = ControlUtil::createLabelColor( iniUser()->graphWindowColor(), iniUser()->graphWindowDarkColor(), @@ -289,7 +295,10 @@ void GraphPage::setupGraphColors() iniUser()->setGraphWindowDarkColorOut(v); ctrl()->setIniUserEdited(); }); +} +void GraphPage::setupGraphColors2() +{ m_graphAxisColor = ControlUtil::createLabelColor( iniUser()->graphWindowAxisColor(), iniUser()->graphWindowDarkAxisColor(), [&](const QColor &v) { diff --git a/src/ui/form/opt/pages/graphpage.h b/src/ui/form/opt/pages/graphpage.h index 394868e3..6ff65c97 100644 --- a/src/ui/form/opt/pages/graphpage.h +++ b/src/ui/form/opt/pages/graphpage.h @@ -31,6 +31,8 @@ private: QLayout *setupTrafUnitsLayout(); void setupColorsBox(); void setupGraphColors(); + void setupGraphColors1(); + void setupGraphColors2(); private: QGroupBox *m_gbGraph = nullptr;