2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +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
4 changed files with 8 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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