mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-23 06:31:20 -04: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
|
@ -230,6 +230,7 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
|
|||
|
||||
int ltwH = misc::getFontSizeFactor("LobbyTreeWidget", 1.5).height();
|
||||
ui.lobbyTreeWidget->setIconSize(QSize(ltwH,ltwH));
|
||||
updateFontSize();
|
||||
}
|
||||
|
||||
ChatLobbyWidget::~ChatLobbyWidget()
|
||||
|
@ -1368,3 +1369,25 @@ int ChatLobbyWidget::getNumColVisible()
|
|||
}
|
||||
return iNumColVis;
|
||||
}
|
||||
|
||||
void ChatLobbyWidget::showEvent(QShowEvent *event)
|
||||
{
|
||||
if (!event->spontaneous()) {
|
||||
updateFontSize();
|
||||
}
|
||||
}
|
||||
|
||||
void ChatLobbyWidget::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.lobbyTreeWidget->font();
|
||||
if (newFont.pointSize() != customFontSize) {
|
||||
newFont.setPointSize(customFontSize);
|
||||
QFontMetricsF fontMetrics(newFont);
|
||||
ui.lobbyTreeWidget->setFont(newFont);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue