Replaced font handling by FontSizeHandler and reenabled deactivated item delegates

This commit is contained in:
thunder2 2025-03-26 01:24:14 +01:00
parent 93154fddc4
commit 973246624f
31 changed files with 196 additions and 383 deletions

View file

@ -230,7 +230,8 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
int ltwH = misc::getFontSizeFactor("LobbyTreeWidget", 1.5).height();
ui.lobbyTreeWidget->setIconSize(QSize(ltwH,ltwH));
updateFontSize();
mFontSizeHandler.registerFontSize(ui.lobbyTreeWidget);
}
ChatLobbyWidget::~ChatLobbyWidget()
@ -1369,25 +1370,3 @@ 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);
}
}