diff --git a/src/ui/form/opt/pages/addresses/addressescolumn.cpp b/src/ui/form/opt/pages/addresses/addressescolumn.cpp index b2951e9f..6774d1c4 100644 --- a/src/ui/form/opt/pages/addresses/addressescolumn.cpp +++ b/src/ui/form/opt/pages/addresses/addressescolumn.cpp @@ -29,8 +29,6 @@ void AddressesColumn::setZonesCount(qint8 v) void AddressesColumn::retranslateUi() { - m_btOpenZones->setToolTip(tr("Show Zones")); - retranslateZonesText(); m_btSelectZones->setToolTip(tr("Select Zones")); } @@ -46,22 +44,9 @@ void AddressesColumn::setupUi() layout->setContentsMargins(0, 0, 0, 0); // Header - auto headerLayout = new QHBoxLayout(); + auto headerLayout = setupHeaderLayout(); layout->addLayout(headerLayout); - m_labelTitle = ControlUtil::createLabel(); - m_labelTitle->setFont(ControlUtil::fontDemiBold()); - - m_cbUseAll = new QCheckBox(); - - headerLayout->addWidget(m_labelTitle); - headerLayout->addStretch(); - headerLayout->addWidget(m_cbUseAll); - - // Zones Row - auto zonesLayout = setupZonesRow(); - layout->addLayout(zonesLayout); - // Text Area m_editIpText = new PlainTextEdit(); m_editIpText->setTabChangesFocus(true); @@ -70,23 +55,23 @@ void AddressesColumn::setupUi() this->setLayout(layout); } -QLayout *AddressesColumn::setupZonesRow() +QLayout *AddressesColumn::setupHeaderLayout() { - auto layout = new QHBoxLayout(); - layout->setContentsMargins(0, 0, 0, 0); + m_labelTitle = ControlUtil::createLabel(); + m_labelTitle->setFont(ControlUtil::fontDemiBold()); - // Open Zones - m_btOpenZones = ControlUtil::createLinkButton(":/icons/ip_class.png"); - - connect(m_btOpenZones, &QPushButton::clicked, IoC(), - &WindowManager::showZonesWindow); + // Use All + m_cbUseAll = new QCheckBox(); // Select Zones - m_btSelectZones = ControlUtil::createButton(QString()); + m_btSelectZones = ControlUtil::createButton(":/icons/ip_class.png"); - layout->addWidget(m_btOpenZones); - layout->addWidget(m_btSelectZones); + auto layout = new QHBoxLayout(); + layout->addWidget(m_labelTitle); layout->addStretch(); + layout->addWidget(m_cbUseAll); + layout->addWidget(ControlUtil::createSeparator(Qt::Vertical)); + layout->addWidget(m_btSelectZones); return layout; } diff --git a/src/ui/form/opt/pages/addresses/addressescolumn.h b/src/ui/form/opt/pages/addresses/addressescolumn.h index 092eb7d9..e4ed8cc9 100644 --- a/src/ui/form/opt/pages/addresses/addressescolumn.h +++ b/src/ui/form/opt/pages/addresses/addressescolumn.h @@ -31,14 +31,13 @@ private: void retranslateZonesText(); void setupUi(); - QLayout *setupZonesRow(); + QLayout *setupHeaderLayout(); private: qint8 m_zonesCount = 0; QLabel *m_labelTitle = nullptr; QCheckBox *m_cbUseAll = nullptr; - QPushButton *m_btOpenZones = nullptr; QPushButton *m_btSelectZones = nullptr; PlainTextEdit *m_editIpText = nullptr; };