UI: Options: IP Addresses: Add "Show Zones" button

This commit is contained in:
Nodir Temirkhodjaev 2023-02-03 19:47:25 +03:00
parent a71ba9dd45
commit ae63c79a31
4 changed files with 13 additions and 1 deletions

View File

@ -4,10 +4,13 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QToolButton>
#include <QVBoxLayout>
#include <form/controls/controlutil.h>
#include <form/controls/plaintextedit.h>
#include <manager/windowmanager.h>
#include <util/ioc/ioccontainer.h>
AddressesColumn::AddressesColumn(QWidget *parent) : QWidget(parent)
{
@ -16,6 +19,8 @@ AddressesColumn::AddressesColumn(QWidget *parent) : QWidget(parent)
void AddressesColumn::retranslateUi()
{
m_btOpenZones->setToolTip(tr("Show Zones"));
m_btSelectZones->setText(tr("Zones"));
m_btSelectZones->setToolTip(tr("Select Zones"));
}
@ -55,6 +60,12 @@ QLayout *AddressesColumn::setupZonesRow()
auto layout = new QHBoxLayout();
layout->setContentsMargins(0, 0, 0, 0);
// Open Zones
m_btOpenZones = ControlUtil::createFlatToolButton(
":/icons/application_go.png", [&] { IoC<WindowManager>()->showZonesWindow(); });
layout->addWidget(m_btOpenZones);
// Select Zones
m_btSelectZones = ControlUtil::createButton(":/icons/ip_class.png");
layout->addWidget(m_btSelectZones);
@ -62,7 +73,6 @@ QLayout *AddressesColumn::setupZonesRow()
m_labelZones->setWordWrap(true);
auto font = ControlUtil::fontDemiBold();
font.setItalic(true);
m_labelZones->setFont(font);
layout->addWidget(m_labelZones, 1);

View File

@ -32,6 +32,7 @@ private:
private:
QLabel *m_labelTitle = nullptr;
QCheckBox *m_cbUseAll = nullptr;
QToolButton *m_btOpenZones = nullptr;
QPushButton *m_btSelectZones = nullptr;
QLabel *m_labelZones = nullptr;
PlainTextEdit *m_editIpText = nullptr;

View File

@ -6,6 +6,7 @@
<file>icons/application.png</file>
<file>icons/application-window-96.png</file>
<file>icons/application_double.png</file>
<file>icons/application_go.png</file>
<file>icons/arrow_refresh_small.png</file>
<file>icons/bin_closed.png</file>
<file>icons/cancel.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B