diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 11d04fdd8..f19bfee5a 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -250,6 +250,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->setupUi(this); //setUpdateWhenInvisible(true); + updateFontSize(); //mUpdating = false; mUnreadCount = 0; @@ -367,6 +368,8 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget blankPost(); + + ui->subscribeToolButton->setToolTip(tr( "
Subscribing to the forum will gather \ available posts from your subscribed friends, and make the \ forum visible to all other friends.
Afterwards you can unsubscribe from the context menu of the forum list at left.
")); @@ -2099,3 +2102,27 @@ void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg) MainWindow::showWindow(MainWindow::People); idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId)); } + +void GxsForumThreadWidget::showEvent(QShowEvent *event) +{ + if (!event->spontaneous()) { + updateFontSize(); + } +} + +void GxsForumThreadWidget::updateFontSize() +{ +#if defined(Q_OS_DARWIN) + int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 13).toInt(); +#else + int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 12).toInt(); +#endif + QFont newFont = ui->threadTreeWidget->font(); + if (newFont.pointSize() != customFontSize) { + newFont.setPointSize(customFontSize); + QFontMetricsF fontMetrics(newFont); + ui->threadTreeWidget->setFont(newFont); + int iconHeight = fontMetrics.height() * 1.4; + ui->threadTreeWidget->setIconSize(QSize(iconHeight, iconHeight)); + } +} diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 322c64fae..b867c2399 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -97,6 +97,7 @@ public: protected: //bool eventFilter(QObject *obj, QEvent *ev); //void changeEvent(QEvent *e); + virtual void showEvent(QShowEvent *) override; /* RsGxsUpdateBroadcastWidget */ virtual void updateDisplay(bool complete); @@ -160,6 +161,8 @@ private slots: void filterColumnChanged(int column); void filterItems(const QString &text); + void updateFontSize(); + #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) void expandSubtree(); #endif