mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-24 07:00:57 -04:00
Added for settings list fonts settings
This commit is contained in:
parent
7399c42dfb
commit
b168110a58
2 changed files with 24 additions and 0 deletions
|
@ -239,3 +239,25 @@ void SettingsPage::notifySettingsChanged()
|
||||||
if (NotifyQt::getInstance())
|
if (NotifyQt::getInstance())
|
||||||
NotifyQt::getInstance()->notifySettingsChanged();
|
NotifyQt::getInstance()->notifySettingsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsPage::showEvent(QShowEvent *event)
|
||||||
|
{
|
||||||
|
if (!event->spontaneous()) {
|
||||||
|
updateFontSize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsPage::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.listWidget->font();
|
||||||
|
if (newFont.pointSize() != customFontSize) {
|
||||||
|
newFont.setPointSize(customFontSize);
|
||||||
|
QFontMetricsF fontMetrics(newFont);
|
||||||
|
ui.listWidget->setFont(newFont);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ protected:
|
||||||
~SettingsPage();
|
~SettingsPage();
|
||||||
|
|
||||||
void addPage(ConfigPage*) ;
|
void addPage(ConfigPage*) ;
|
||||||
|
virtual void showEvent(QShowEvent *) override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! Go to a specific part of the control panel.
|
//! Go to a specific part of the control panel.
|
||||||
|
@ -67,6 +68,7 @@ private slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initStackedWidget();
|
void initStackedWidget();
|
||||||
|
void updateFontSize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FloatingHelpBrowser *mHelpBrowser;
|
FloatingHelpBrowser *mHelpBrowser;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue