diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-11 00:04:35 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-11 00:04:35 +0200 |
commit | ca56ce2c32b4479af32bf7fb5d065ee9a3a45d8a (patch) | |
tree | 50699f37a3ab7ded0faca02b2783132042f65844 /c/listview.cpp | |
parent | 295d423cc47f9ee8a72134dc544892a03b279311 (diff) | |
download | EpisodeBrowser-ca56ce2c32b4479af32bf7fb5d065ee9a3a45d8a.tar.gz |
Refactor, adjust minimum window size.
Diffstat (limited to 'c/listview.cpp')
-rw-r--r-- | c/listview.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/c/listview.cpp b/c/listview.cpp index 9f24dc3..87b7dbc 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -46,6 +46,35 @@ ListView::HWnd() return m_hWnd; } +void +ListView::UpdateTheme(BOOL bThemeActive) +{ + DWORD dwStyle; + LPTSTR tszTheme; + WORD wAction; + extern int g_bThemes; + + if (!g_bThemes) return; + if (bThemeActive) { + dwStyle = LVS_EX_DOUBLEBUFFER; + tszTheme = TEXT("Explorer"); + wAction = UIS_SET; + } else { + dwStyle = 0; + tszTheme = NULL; + wAction = UIS_CLEAR; + } + + /* Use modern "Explorer" theme. */ + SetWindowTheme(m_hWnd, tszTheme, NULL); + + /* The modern theme requires double buffering. */ + ListView_SetExtendedListViewStyleEx(m_hWnd, LVS_EX_DOUBLEBUFFER, dwStyle); + + /* Hide focus rectangles. */ + SendMessage(m_hWnd, WM_UPDATEUISTATE, MAKEWPARAM(wAction, UISF_HIDEFOCUS), 0); +} + LRESULT CALLBACK ListView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { |