UI: Statistics: Expand traf units combobox

This commit is contained in:
Nodir Temirkhodjaev 2024-01-31 19:49:25 +03:00
parent e66c2fe870
commit 9369484f00
2 changed files with 5 additions and 8 deletions

View File

@ -41,6 +41,7 @@ QSpinBox *ControlUtil::createSpinBox()
QComboBox *ControlUtil::createComboBox(const QStringList &texts)
{
auto c = new ComboBox();
c->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
c->addItems(texts);
return c;
}

View File

@ -133,20 +133,15 @@ void TrafficPage::setupUi()
QLayout *TrafficPage::setupHeader()
{
auto layout = new QHBoxLayout();
m_btRefresh = ControlUtil::createFlatToolButton(
":/icons/arrow_refresh_small.png", [&] { trafListModel()->reset(); });
setupClearMenu();
setupTrafUnits();
layout->addWidget(m_btRefresh);
layout->addWidget(m_btClear);
layout->addWidget(ControlUtil::createVSeparator());
layout->addWidget(m_traphUnits);
layout->addWidget(m_comboTrafUnit);
layout->addStretch();
auto layout = ControlUtil::createHLayoutByWidgets({ m_btRefresh, m_btClear,
ControlUtil::createVSeparator(), m_traphUnits, m_comboTrafUnit,
/*stretch*/ nullptr });
return layout;
}
@ -196,6 +191,7 @@ void TrafficPage::setupTrafUnits()
confManager()->saveIniUser();
});
m_comboTrafUnit->setMinimumWidth(100);
}
void TrafficPage::setupAppListView()