From 607784f691f132168e1b930c31ea26a13c0ce478 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Tue, 18 May 2021 19:38:13 +0300 Subject: [PATCH] Partially revert "UI: Smaller font size for date/time columns." This reverts commit 5c3c93cd8210f70b42564ae5ace53000e2f4d8cb. --- ChangeLog | 3 +-- src/ui/model/applistmodel.cpp | 9 +-------- src/ui/model/connlistmodel.cpp | 19 ------------------- src/ui/model/connlistmodel.h | 1 - src/ui/model/zonelistmodel.cpp | 21 --------------------- src/ui/model/zonelistmodel.h | 1 - src/ui/task/tasklistmodel.cpp | 21 --------------------- src/ui/task/tasklistmodel.h | 1 - 8 files changed, 2 insertions(+), 74 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44bcfdd9..0ad0ce1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,11 @@ Fort Firewall ChangeLog -v3.4.0, 2021-05-17: +v3.4.0, 2021-05-18: - UI: Options: Add "For all users" auto-run mode. - UI: Options: Add "Run as a Service in background" option. - UI: Use "%LocalAppData%\Fort Firewall\FortFirewall.user.ini" for user specific settings. - UI: Options: Hot Keys is applied immediately now. - UI: Options: Move Statistics page to Statistics window as Traffic page. -- UI: Smaller font size for date/time columns. Attention: For a Service the default profile path is "%ProgramData%\Fort Firewall\", else it's "%LocalAppData%\Fort Firewall\". diff --git a/src/ui/model/applistmodel.cpp b/src/ui/model/applistmodel.cpp index 1d2b7bda..05dbfcc6 100644 --- a/src/ui/model/applistmodel.cpp +++ b/src/ui/model/applistmodel.cpp @@ -197,18 +197,11 @@ QVariant AppListModel::dataFont(const QModelIndex &index) const { const int column = index.column(); - switch (column) { - case 2: { + if (column == 2) { QFont font; font.setWeight(QFont::DemiBold); return font; } - case 4: { - QFont font; - font.setPointSize(8); - return font; - } - } return QVariant(); } diff --git a/src/ui/model/connlistmodel.cpp b/src/ui/model/connlistmodel.cpp index 47220aaf..5c7ccc60 100644 --- a/src/ui/model/connlistmodel.cpp +++ b/src/ui/model/connlistmodel.cpp @@ -108,10 +108,6 @@ QVariant ConnListModel::data(const QModelIndex &index, int role) const // Icon case Qt::DecorationRole: return dataDecoration(index); - - // Font - case Qt::FontRole: - return dataFont(index); } return QVariant(); @@ -176,21 +172,6 @@ QVariant ConnListModel::dataDecoration(const QModelIndex &index) const return QVariant(); } -QVariant ConnListModel::dataFont(const QModelIndex &index) const -{ - const int column = index.column(); - - switch (column) { - case 6: { - QFont font; - font.setPointSize(8); - return font; - } - } - - return QVariant(); -} - QString ConnListModel::blockReasonText(const ConnBlockRow &blockRow) { switch (blockRow.blockReason) { diff --git a/src/ui/model/connlistmodel.h b/src/ui/model/connlistmodel.h index 3965d7b6..de7902f4 100644 --- a/src/ui/model/connlistmodel.h +++ b/src/ui/model/connlistmodel.h @@ -89,7 +89,6 @@ private: QVariant dataDisplay(const QModelIndex &index, int role) const; QVariant dataDisplayDirection(const ConnRow &connRow, int role) const; QVariant dataDecoration(const QModelIndex &index) const; - QVariant dataFont(const QModelIndex &index) const; static QString blockReasonText(const ConnBlockRow &blockRow); diff --git a/src/ui/model/zonelistmodel.cpp b/src/ui/model/zonelistmodel.cpp index 5625c931..cc9b8186 100644 --- a/src/ui/model/zonelistmodel.cpp +++ b/src/ui/model/zonelistmodel.cpp @@ -1,7 +1,6 @@ #include "zonelistmodel.h" #include -#include #include #include @@ -66,10 +65,6 @@ QVariant ZoneListModel::data(const QModelIndex &index, int role) const case Qt::ToolTipRole: return dataDisplay(index); - // Font - case Qt::FontRole: - return dataFont(index); - // Enabled case Qt::CheckStateRole: return dataCheckState(index); @@ -101,22 +96,6 @@ QVariant ZoneListModel::dataDisplay(const QModelIndex &index) const return QVariant(); } -QVariant ZoneListModel::dataFont(const QModelIndex &index) const -{ - const int column = index.column(); - - switch (column) { - case 2: - case 3: { - QFont font; - font.setPointSize(8); - return font; - } - } - - return QVariant(); -} - QVariant ZoneListModel::dataCheckState(const QModelIndex &index) const { if (index.column() == 0) { diff --git a/src/ui/model/zonelistmodel.h b/src/ui/model/zonelistmodel.h index 4689fb33..14122692 100644 --- a/src/ui/model/zonelistmodel.h +++ b/src/ui/model/zonelistmodel.h @@ -78,7 +78,6 @@ protected: private: QVariant dataDisplay(const QModelIndex &index) const; - QVariant dataFont(const QModelIndex &index) const; QVariant dataCheckState(const QModelIndex &index) const; void setupZoneTypes(); diff --git a/src/ui/task/tasklistmodel.cpp b/src/ui/task/tasklistmodel.cpp index 54e1c0b7..5a72fc51 100644 --- a/src/ui/task/tasklistmodel.cpp +++ b/src/ui/task/tasklistmodel.cpp @@ -1,7 +1,5 @@ #include "tasklistmodel.h" -#include - #include "taskinfo.h" #include "taskmanager.h" @@ -63,9 +61,6 @@ QVariant TaskListModel::data(const QModelIndex &index, int role) const case Qt::ToolTipRole: return dataDisplay(index); - case Qt::FontRole: - return dataFont(index); - case Qt::CheckStateRole: case RoleEnabled: return dataCheckState(index); @@ -103,22 +98,6 @@ QVariant TaskListModel::dataDisplay(const QModelIndex &index) const return QVariant(); } -QVariant TaskListModel::dataFont(const QModelIndex &index) const -{ - const int column = index.column(); - - switch (column) { - case 2: - case 3: { - QFont font; - font.setPointSize(8); - return font; - } - } - - return QVariant(); -} - QVariant TaskListModel::dataCheckState(const QModelIndex &index) const { if (index.column() == 0) { diff --git a/src/ui/task/tasklistmodel.h b/src/ui/task/tasklistmodel.h index 09bedad3..4ad37e7b 100644 --- a/src/ui/task/tasklistmodel.h +++ b/src/ui/task/tasklistmodel.h @@ -47,7 +47,6 @@ protected: private: QVariant dataDisplay(const QModelIndex &index) const; - QVariant dataFont(const QModelIndex &index) const; QVariant dataCheckState(const QModelIndex &index) const; bool taskEnabled(int row) const;