diff --git a/src/ui/form/controls/appinforow.cpp b/src/ui/form/controls/appinforow.cpp index 474193a2..074033da 100644 --- a/src/ui/form/controls/appinforow.cpp +++ b/src/ui/form/controls/appinforow.cpp @@ -33,7 +33,7 @@ void AppInfoRow::setupUi() m_lineAppPath = ControlUtil::createLineLabel(); m_labelAppProductName = ControlUtil::createLabel(); - m_labelAppProductName->setFont(ControlUtil::fontBold()); + m_labelAppProductName->setFont(GuiUtil::fontBold()); m_labelAppCompanyName = ControlUtil::createLabel(); diff --git a/src/ui/form/controls/controlutil.cpp b/src/ui/form/controls/controlutil.cpp index 9e55216f..97815eb3 100644 --- a/src/ui/form/controls/controlutil.cpp +++ b/src/ui/form/controls/controlutil.cpp @@ -315,13 +315,6 @@ QWidget *ControlUtil::wrapToScrollArea(QWidget *content, bool isBgTransparent) return c; } -QFont ControlUtil::fontBold() -{ - QFont font; - font.setBold(true); - return font; -} - LabelSpinCombo *ControlUtil::createSpinCombo(int v, int min, int max, const QVector &values, const QString &suffix, const std::function &onValueChanged) { diff --git a/src/ui/form/controls/controlutil.h b/src/ui/form/controls/controlutil.h index be50f202..fd0f9343 100644 --- a/src/ui/form/controls/controlutil.h +++ b/src/ui/form/controls/controlutil.h @@ -95,8 +95,6 @@ public: static QLayout *createScrollLayout(QLayout *content, bool isBgTransparent = true); static QWidget *wrapToScrollArea(QWidget *content, bool isBgTransparent = true); - static QFont fontBold(); - static LabelSpinCombo *createSpinCombo(int v, int min, int max, const QVector &values, const QString &suffix, const std::function &onValueChanged); static LabelSpin *createSpin(int v, int min, int max, const QString &suffix, diff --git a/src/ui/form/home/pages/homepage.cpp b/src/ui/form/home/pages/homepage.cpp index 0705e26e..b1d6a3ec 100644 --- a/src/ui/form/home/pages/homepage.cpp +++ b/src/ui/form/home/pages/homepage.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include HomePage::HomePage(HomeController *ctrl, QWidget *parent) : HomeBasePage(ctrl, parent) @@ -68,7 +69,7 @@ void HomePage::setupDriverBox() m_labelDriverMessage = ControlUtil::createLabel(); m_labelDriverMessage->setWordWrap(true); - m_labelDriverMessage->setFont(ControlUtil::fontBold()); + m_labelDriverMessage->setFont(GuiUtil::fontBold()); setupDriverIcon(); diff --git a/src/ui/form/opt/pages/addresses/addressescolumn.cpp b/src/ui/form/opt/pages/addresses/addressescolumn.cpp index f7048d74..b4253537 100644 --- a/src/ui/form/opt/pages/addresses/addressescolumn.cpp +++ b/src/ui/form/opt/pages/addresses/addressescolumn.cpp @@ -10,6 +10,7 @@ #include
#include #include +#include #include AddressesColumn::AddressesColumn(QWidget *parent) : QWidget(parent) @@ -41,7 +42,7 @@ void AddressesColumn::setupUi() QLayout *AddressesColumn::setupHeaderLayout() { m_labelTitle = ControlUtil::createLabel(); - m_labelTitle->setFont(ControlUtil::fontBold()); + m_labelTitle->setFont(GuiUtil::fontBold()); // Use All m_cbUseAll = new QCheckBox(); diff --git a/src/ui/form/opt/pages/applicationspage.cpp b/src/ui/form/opt/pages/applicationspage.cpp index 13b9762a..70759179 100644 --- a/src/ui/form/opt/pages/applicationspage.cpp +++ b/src/ui/form/opt/pages/applicationspage.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -376,7 +377,7 @@ void ApplicationsPage::setupGroupEnabled() pageAppGroupSetChecked(this, &AppGroup::setEnabled, checked, /*isFlag=*/true); }); - m_cbGroupEnabled->setFont(ControlUtil::fontBold()); + m_cbGroupEnabled->setFont(GuiUtil::fontBold()); } void ApplicationsPage::setupGroupPeriod() diff --git a/src/ui/form/opt/pages/apps/appscolumn.cpp b/src/ui/form/opt/pages/apps/appscolumn.cpp index 4d3f8748..d0eac6ed 100644 --- a/src/ui/form/opt/pages/apps/appscolumn.cpp +++ b/src/ui/form/opt/pages/apps/appscolumn.cpp @@ -6,6 +6,7 @@ #include #include +#include #include AppsColumn::AppsColumn(const QString &iconPath, QWidget *parent) : QWidget(parent) @@ -44,7 +45,7 @@ QLayout *AppsColumn::setupHeaderLayout() m_icon->setMaximumSize(16, 16); m_labelTitle = ControlUtil::createLabel(); - m_labelTitle->setFont(ControlUtil::fontBold()); + m_labelTitle->setFont(GuiUtil::fontBold()); m_labelTitle->setFixedHeight(24); m_btClear = diff --git a/src/ui/form/opt/pages/optionspage.cpp b/src/ui/form/opt/pages/optionspage.cpp index 256ab846..d325429b 100644 --- a/src/ui/form/opt/pages/optionspage.cpp +++ b/src/ui/form/opt/pages/optionspage.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -601,7 +602,7 @@ void OptionsPage::setupLogBlocked() } }); - m_cbLogBlocked->setFont(ControlUtil::fontBold()); + m_cbLogBlocked->setFont(GuiUtil::fontBold()); } QLayout *OptionsPage::setupColumn2() diff --git a/src/ui/form/opt/pages/schedulepage.cpp b/src/ui/form/opt/pages/schedulepage.cpp index 18b75f0f..25db1053 100644 --- a/src/ui/form/opt/pages/schedulepage.cpp +++ b/src/ui/form/opt/pages/schedulepage.cpp @@ -17,6 +17,7 @@ #include #include #include +#include namespace { @@ -145,7 +146,7 @@ void SchedulePage::setupTaskDetails() void SchedulePage::setupTaskInterval() { m_cscTaskInterval = new CheckSpinCombo(); - m_cscTaskInterval->checkBox()->setFont(ControlUtil::fontBold()); + m_cscTaskInterval->checkBox()->setFont(GuiUtil::fontBold()); m_cscTaskInterval->spinBox()->setRange(1, 24 * 30 * 12); // ~Year m_cscTaskInterval->setValues(taskIntervalHourValues); diff --git a/src/ui/form/opt/pages/statisticspage.cpp b/src/ui/form/opt/pages/statisticspage.cpp index cb104d0b..9115abf6 100644 --- a/src/ui/form/opt/pages/statisticspage.cpp +++ b/src/ui/form/opt/pages/statisticspage.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -213,7 +214,7 @@ void StatisticsPage::setupLogStat() } }); - m_cbLogStat->setFont(ControlUtil::fontBold()); + m_cbLogStat->setFont(GuiUtil::fontBold()); } void StatisticsPage::setupLogStatNoFilter() @@ -360,7 +361,7 @@ void StatisticsPage::setupLogBlockedIp() } }); - m_cbLogBlockedIp->setFont(ControlUtil::fontBold()); + m_cbLogBlockedIp->setFont(GuiUtil::fontBold()); m_cbLogAlertedBlockedIp = ControlUtil::createCheckBox(conf()->logAlertedBlockedIp(), [&](bool checked) { @@ -403,7 +404,7 @@ void StatisticsPage::setupLogAllowedIp() } }); - m_cbLogAllowedIp->setFont(ControlUtil::fontBold()); + m_cbLogAllowedIp->setFont(GuiUtil::fontBold()); const auto logIpKeepCountList = SpinCombo::makeValuesList(logIpKeepCountValues); m_lscAllowedIpKeepCount = ControlUtil::createSpinCombo( diff --git a/src/ui/model/rulelistmodel.cpp b/src/ui/model/rulelistmodel.cpp index 6e172e27..760e3918 100644 --- a/src/ui/model/rulelistmodel.cpp +++ b/src/ui/model/rulelistmodel.cpp @@ -1,5 +1,6 @@ #include "rulelistmodel.h" +#include #include #include @@ -9,6 +10,7 @@ #include #include +#include #include #include @@ -142,10 +144,6 @@ QVariant RuleListModel::data(const QModelIndex &index, int role) const // Enabled case Qt::CheckStateRole: return dataCheckState(index); - - // Row Height - case Qt::SizeHintRole: - return QSize(100, 24); } return QVariant(); @@ -162,9 +160,9 @@ QVariant RuleListModel::rootData(const QModelIndex &index, int role) const case Qt::ToolTipRole: return ruleTypeNames().value(index.row()); - // Row Height - case Qt::SizeHintRole: - return QSize(100, 24); + // Font + case Qt::FontRole: + return GuiUtil::fontBold(); } return QVariant(); diff --git a/src/ui/util/guiutil.cpp b/src/ui/util/guiutil.cpp index 9f5ad061..690c3efc 100644 --- a/src/ui/util/guiutil.cpp +++ b/src/ui/util/guiutil.cpp @@ -61,3 +61,10 @@ QIcon GuiUtil::overlayIcon( return pixmap; } + +QFont GuiUtil::fontBold() +{ + QFont font; + font.setBold(true); + return font; +} diff --git a/src/ui/util/guiutil.h b/src/ui/util/guiutil.h index bdf24055..ab0bdaf0 100644 --- a/src/ui/util/guiutil.h +++ b/src/ui/util/guiutil.h @@ -1,6 +1,7 @@ #ifndef GUIUTIL_H #define GUIUTIL_H +#include #include #include @@ -11,6 +12,8 @@ public: static QIcon overlayIcon(const QString &basePath, const QString &overlayPath, Qt::Alignment alignment = Qt::AlignRight | Qt::AlignBottom); + + static QFont fontBold(); }; #endif // GUIUTIL_H