mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-26 16:05:48 -04:00
Attempt for forums tree fonts settings
This commit is contained in:
parent
49242e185b
commit
cd338613c1
2 changed files with 30 additions and 0 deletions
|
@ -250,6 +250,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
//setUpdateWhenInvisible(true);
|
//setUpdateWhenInvisible(true);
|
||||||
|
updateFontSize();
|
||||||
|
|
||||||
//mUpdating = false;
|
//mUpdating = false;
|
||||||
mUnreadCount = 0;
|
mUnreadCount = 0;
|
||||||
|
@ -367,6 +368,8 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
|
||||||
|
|
||||||
blankPost();
|
blankPost();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ui->subscribeToolButton->setToolTip(tr( "<p>Subscribing to the forum will gather \
|
ui->subscribeToolButton->setToolTip(tr( "<p>Subscribing to the forum will gather \
|
||||||
available posts from your subscribed friends, and make the \
|
available posts from your subscribed friends, and make the \
|
||||||
forum visible to all other friends.</p><p>Afterwards you can unsubscribe from the context menu of the forum list at left.</p>"));
|
forum visible to all other friends.</p><p>Afterwards you can unsubscribe from the context menu of the forum list at left.</p>"));
|
||||||
|
@ -2099,3 +2102,27 @@ void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg)
|
||||||
MainWindow::showWindow(MainWindow::People);
|
MainWindow::showWindow(MainWindow::People);
|
||||||
idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId));
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -97,6 +97,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
//bool eventFilter(QObject *obj, QEvent *ev);
|
//bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
//void changeEvent(QEvent *e);
|
//void changeEvent(QEvent *e);
|
||||||
|
virtual void showEvent(QShowEvent *) override;
|
||||||
|
|
||||||
/* RsGxsUpdateBroadcastWidget */
|
/* RsGxsUpdateBroadcastWidget */
|
||||||
virtual void updateDisplay(bool complete);
|
virtual void updateDisplay(bool complete);
|
||||||
|
@ -160,6 +161,8 @@ private slots:
|
||||||
void filterColumnChanged(int column);
|
void filterColumnChanged(int column);
|
||||||
void filterItems(const QString &text);
|
void filterItems(const QString &text);
|
||||||
|
|
||||||
|
void updateFontSize();
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
||||||
void expandSubtree();
|
void expandSubtree();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue