From ef902aa5b4ae64f8126330a45954348b80419891 Mon Sep 17 00:00:00 2001 From: Reupen Shah Date: Sat, 21 Dec 2024 21:01:44 +0000 Subject: [PATCH] Fix Filter field list in preferences not showing text on second access This resolves a bug where the field list on the Fields tab of the Filter preferences page would not show any text the second time the tab was opened. Additionally, it makes the list use the same font as the rest of the preferences page. --- CHANGELOG.md | 3 ++- foo_ui_columns/config_columns_v2.cpp | 3 +-- foo_ui_columns/config_filter.cpp | 3 +++ foo_ui_columns/foo_ui_columns.rc | 4 ++-- ui_helpers | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6c84eff3..1153b7970 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,8 @@ [#1030](https://github.com/reupen/columns_ui/pull/1030), [#1031](https://github.com/reupen/columns_ui/pull/1031), [#1037](https://github.com/reupen/columns_ui/pull/1037), - [#1039](https://github.com/reupen/columns_ui/pull/1039)] + [#1039](https://github.com/reupen/columns_ui/pull/1039), + [#1042](https://github.com/reupen/columns_ui/pull/1042)] This includes colour font support on Windows 8.1 and newer (allowing the use of, for example, colour emojis). diff --git a/foo_ui_columns/config_columns_v2.cpp b/foo_ui_columns/config_columns_v2.cpp index 1fc1bce5b..cd43395c1 100644 --- a/foo_ui_columns/config_columns_v2.cpp +++ b/foo_ui_columns/config_columns_v2.cpp @@ -576,12 +576,11 @@ INT_PTR TabColumns::on_message(HWND wnd, UINT msg, WPARAM wp, LPARAM lp) switch (msg) { case WM_INITDIALOG: { m_wnd = wnd; - // if (g_main_window && !cfg_nohscroll ) playlist_view::g_save_columns(); - m_columns_list_view.create(wnd, {7, 30, 79, 215}, true); LOGFONT font{}; GetObject(GetWindowFont(wnd), sizeof(font), &font); m_columns_list_view.set_font_from_log_font(font); + m_columns_list_view.create(wnd, {7, 30, 79, 215}, true); m_columns.set_entries_copy(g_columns, true); diff --git a/foo_ui_columns/config_filter.cpp b/foo_ui_columns/config_filter.cpp index a3a75a6cb..37c237d35 100644 --- a/foo_ui_columns/config_filter.cpp +++ b/foo_ui_columns/config_filter.cpp @@ -107,6 +107,9 @@ static class TabFilterFields : public PreferencesTab { switch (msg) { case WM_INITDIALOG: { { + LOGFONT font{}; + GetObject(GetWindowFont(wnd), sizeof(font), &font); + m_field_list.set_font_from_log_font(font); HWND wnd_fields = m_field_list.create(wnd, uih::WindowPosition(7, 30, 313, 213), true); SetWindowPos(wnd_fields, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); ShowWindow(wnd_fields, SW_SHOWNORMAL); diff --git a/foo_ui_columns/foo_ui_columns.rc b/foo_ui_columns/foo_ui_columns.rc index 5ae7a95a5..21b9808dc 100644 --- a/foo_ui_columns/foo_ui_columns.rc +++ b/foo_ui_columns/foo_ui_columns.rc @@ -388,9 +388,9 @@ BEGIN END IDD_PREFS_FILTER_FIELDS DIALOGEX 0, 0, 327, 271 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD +STYLE DS_SETFONT | DS_CONTROL | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 400, 0, 0x0 +FONT 8, "Tahoma", 400, 0, 0x0 BEGIN LTEXT "Fields",IDC_TITLE1,7,4,313,16 PUSHBUTTON "New",IDC_NEW,7,250,50,14 diff --git a/ui_helpers b/ui_helpers index ce9037172..aa87849da 160000 --- a/ui_helpers +++ b/ui_helpers @@ -1 +1 @@ -Subproject commit ce9037172963c12c4bfe2249f55b75b4fb71141a +Subproject commit aa87849da0892b162069324606f564fe286e8a40