2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-29 13:47:47 +00:00

Allow to change font size (#177)

This commit is contained in:
ilya-fedin 2021-05-30 01:24:56 +00:00 committed by GitHub
parent b0fed1a6a0
commit c49444b152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 0 deletions

View File

@ -119,6 +119,7 @@ style::CustomFontSettings UiIntegration::fontSettings() {
cMainFont(),
cSemiboldFont(),
cMonospaceFont(),
cFontSize(),
cSemiboldFontIsBold(),
cUseSystemFont(),
cUseOriginalMetrics(),

View File

@ -386,6 +386,7 @@ QByteArray GenerateSettingsJson(bool areDefault = false) {
settings.insert(qsl("forward_retain_selection"), cForwardRetainSelection());
settings.insert(qsl("forward_on_click"), cForwardChatOnClick());
settingsFonts.insert(qsl("size"), cFontSize());
settingsFonts.insert(qsl("use_system_font"), cUseSystemFont());
settingsFonts.insert(qsl("use_original_metrics"), cUseOriginalMetrics());
@ -477,6 +478,10 @@ bool Manager::readCustomFile() {
cSetMonospaceFont(v);
});
ReadIntOption(o, "size", [&](auto v) {
cSetFontSize(v);
});
ReadBoolOption(o, "use_system_font", [&](auto v) {
cSetUseSystemFont(v);
});

View File

@ -12,6 +12,7 @@ https://github.com/kotatogram/kotatogram-desktop/blob/dev/LEGAL
bool gKotatoFirstRun = true;
QString gMainFont, gSemiboldFont, gMonospaceFont;
int gFontSize = 0;
bool gSemiboldFontIsBold = false;
#ifdef DESKTOP_APP_USE_PACKAGED_FONTS

View File

@ -30,6 +30,7 @@ DeclareSetting(QString, MainFont);
DeclareSetting(QString, SemiboldFont);
DeclareSetting(bool, SemiboldFontIsBold);
DeclareSetting(QString, MonospaceFont);
DeclareSetting(int, FontSize);
DeclareSetting(bool, UseSystemFont);
DeclareSetting(bool, UseOriginalMetrics);