diff options
author | George Hazan <ghazan@miranda.im> | 2021-02-15 21:55:20 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-02-15 21:55:20 +0300 |
commit | 274073a8624710af166afbb8119565c18b4ef84e (patch) | |
tree | 91858dad78c4580f33e2fb41e79556fdf4133445 /src | |
parent | ae851ef2c40521b549283927aeecf02eb7cede3f (diff) |
fixes #2738 (Не сбрасываются в дефолт некоторые настройки шрифтов и цветов)
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdpopup/src/yapp.cpp | 6 | ||||
-rw-r--r-- | src/mir_app/src/FontOptions.cpp | 22 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/core/stdpopup/src/yapp.cpp b/src/core/stdpopup/src/yapp.cpp index 96f5e635a7..c71ec5de6e 100644 --- a/src/core/stdpopup/src/yapp.cpp +++ b/src/core/stdpopup/src/yapp.cpp @@ -97,7 +97,7 @@ static int TTBLoaded(WPARAM, LPARAM) static void InitFonts() { - font_id_firstline.flags = FIDF_ALLOWEFFECTS; + font_id_firstline.flags = FIDF_ALLOWEFFECTS | FIDF_DEFAULTVALID; wcsncpy_s(font_id_firstline.group, LPGENW("Popups"), _TRUNCATE); wcsncpy_s(font_id_firstline.name, LPGENW("First line"), _TRUNCATE); strncpy_s(font_id_firstline.dbSettingsGroup, MODULENAME, _TRUNCATE); @@ -107,7 +107,7 @@ static void InitFonts() font_id_firstline.order = 0; g_plugin.addFont(&font_id_firstline); - font_id_secondline.flags = FIDF_ALLOWEFFECTS; + font_id_secondline.flags = FIDF_ALLOWEFFECTS | FIDF_DEFAULTVALID; wcsncpy_s(font_id_secondline.group, LPGENW("Popups"), _TRUNCATE); wcsncpy_s(font_id_secondline.name, LPGENW("Second line"), _TRUNCATE); strncpy_s(font_id_secondline.dbSettingsGroup, MODULENAME, _TRUNCATE); @@ -117,7 +117,7 @@ static void InitFonts() font_id_secondline.order = 1; g_plugin.addFont(&font_id_secondline); - font_id_time.flags = FIDF_ALLOWEFFECTS; + font_id_time.flags = FIDF_ALLOWEFFECTS | FIDF_DEFAULTVALID; wcsncpy_s(font_id_time.group, LPGENW("Popups"), _TRUNCATE); wcsncpy_s(font_id_time.name, LPGENW("Time"), _TRUNCATE); strncpy_s(font_id_time.dbSettingsGroup, MODULENAME, _TRUNCATE); diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 5eca04b2d3..e92b7e7a96 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -889,11 +889,11 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, switch (LOWORD(wParam)) {
case IDC_FONTLIST:
if (HIWORD(wParam) == LBN_SELCHANGE) {
- char bEnableFont = 1;
- char bEnableClText = 1;
- char bEnableClBack = 1;
- char bEnableEffect = 1;
- char bEnableReset = 1;
+ bool bEnableFont = true;
+ bool bEnableClText = true;
+ bool bEnableClBack = true;
+ bool bEnableEffect = true;
+ bool bEnableReset = true;
COLORREF clBack = 0xffffffff;
COLORREF clText = 0xffffffff;
@@ -906,15 +906,15 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, if (IsBadReadPtr(itemData, sizeof(FSUIListItemData))) continue; // prevent possible problems with corrupted itemData
if (bEnableClBack && (itemData->colour_id < 0))
- bEnableClBack = 0;
+ bEnableClBack = false;
if (bEnableEffect && (itemData->effect_id < 0))
- bEnableEffect = 0;
+ bEnableEffect = false;
if (bEnableFont && (itemData->font_id < 0))
- bEnableFont = 0;
+ bEnableFont = false;
if (!bEnableFont || bEnableClText && (itemData->font_id < 0))
- bEnableClText = 0;
+ bEnableClText = false;
if (bEnableReset && (itemData->font_id >= 0) && !(font_id_list_w2[itemData->font_id].flags & FIDF_DEFAULTVALID))
- bEnableReset = 0;
+ bEnableReset = false;
if (bEnableClBack && (itemData->colour_id >= 0) && (clBack == 0xffffffff))
clBack = colour_id_list_w2[itemData->colour_id].value;
@@ -923,7 +923,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, }
mir_free(selItems);
}
- else bEnableFont = bEnableClText = bEnableClBack = bEnableReset = bEnableEffect = 0;
+ else bEnableFont = bEnableClText = bEnableClBack = bEnableReset = bEnableEffect = false;
EnableWindow(GetDlgItem(hwndDlg, IDC_BKGCOLOUR), bEnableClBack);
ShowEffectButton(hwndDlg, bEnableEffect && !bEnableClBack);
|