mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 17:13:58 -05:00
Settings for default tree & listwidget fonts
This commit is contained in:
parent
8fcc52b304
commit
e14fc66ca3
14 changed files with 180 additions and 1 deletions
|
|
@ -55,6 +55,7 @@
|
|||
#include "gui/connect/ConnectProgressDialog.h"
|
||||
#include "gui/common/ElidedLabel.h"
|
||||
#include "gui/notifyqt.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
|
||||
#include "NewFriendList.h"
|
||||
#include "ui_NewFriendList.h"
|
||||
|
|
@ -1693,3 +1694,27 @@ void NewFriendList::expandGroup(const RsNodeGroupId& gid)
|
|||
QModelIndex index = mProxyModel->mapFromSource(mModel->getIndexOfGroup(gid));
|
||||
ui->peerTreeWidget->setExpanded(index,true) ;
|
||||
}
|
||||
|
||||
void NewFriendList::showEvent(QShowEvent *event)
|
||||
{
|
||||
if (!event->spontaneous()) {
|
||||
updateFontSize();
|
||||
}
|
||||
}
|
||||
|
||||
void NewFriendList::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->peerTreeWidget->font();
|
||||
if (newFont.pointSize() != customFontSize) {
|
||||
newFont.setPointSize(customFontSize);
|
||||
QFontMetricsF fontMetrics(newFont);
|
||||
int iconHeight = fontMetrics.height()*1.5;
|
||||
ui->peerTreeWidget->setFont(newFont);
|
||||
ui->peerTreeWidget->setIconSize(QSize(iconHeight, iconHeight));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue