From 18f4ef5574137ea3cb65186a36792d0503c05ab7 Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 6 Feb 2025 19:02:40 +0100 Subject: [PATCH] Fix fonts --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 3 +++ .../src/gui/common/FriendSelectionWidget.cpp | 18 ++++++++++++++++++ .../src/gui/common/FriendSelectionWidget.h | 1 + 3 files changed, 22 insertions(+) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 8a099aac8..c69b71647 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -2617,5 +2617,8 @@ void IdDialog::updateFontSize() QFontMetricsF fontMetrics(newFont); ui->idTreeWidget->setFont(newFont); ui->treeWidget_membership->setFont(newFont); + contactsItem->setFont(RSID_COL_NICKNAME, newFont); + allItem->setFont(RSID_COL_NICKNAME, newFont); + ownItem->setFont(RSID_COL_NICKNAME, newFont); } } diff --git a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp index 4608d1796..2d42726c8 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp +++ b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp @@ -28,6 +28,7 @@ #include "gui/notifyqt.h" #include "gui/common/RSTreeWidgetItem.h" #include "gui/common/StatusDefs.h" +#include "gui/settings/rsharesettings.h" #include "util/qtthreadsutils.h" #include "gui/common/PeerDefs.h" #include "gui/common/GroupDefs.h" @@ -223,6 +224,8 @@ void FriendSelectionWidget::showEvent(QShowEvent */*e*/) { if(gxsIds.empty()) loadIdentities(); + + updateFontSize(); } void FriendSelectionWidget::start() { @@ -1271,3 +1274,18 @@ bool FriendSelectionWidget::isFilterConnected() { return mActionFilterConnected->isChecked(); } + +void FriendSelectionWidget::updateFontSize() +{ +#if defined(Q_OS_DARWIN) + int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 13).toInt(); +#else + int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 11).toInt(); +#endif + QFont newFont = ui->friendList->font(); + if (newFont.pointSize() != customFontSize) { + newFont.setPointSize(customFontSize); + QFontMetricsF fontMetrics(newFont); + ui->friendList->setFont(newFont); + } +} diff --git a/retroshare-gui/src/gui/common/FriendSelectionWidget.h b/retroshare-gui/src/gui/common/FriendSelectionWidget.h index f10a748fc..cde084ede 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionWidget.h +++ b/retroshare-gui/src/gui/common/FriendSelectionWidget.h @@ -144,6 +144,7 @@ private slots: void itemChanged(QTreeWidgetItem *item, int column); void selectAll() ; void deselectAll() ; + void updateFontSize(); private: void fillList();