aboutsummaryrefslogtreecommitdiff
path: root/c/listview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-11 00:04:35 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-11 00:04:35 +0200
commitca56ce2c32b4479af32bf7fb5d065ee9a3a45d8a (patch)
tree50699f37a3ab7ded0faca02b2783132042f65844 /c/listview.cpp
parent295d423cc47f9ee8a72134dc544892a03b279311 (diff)
downloadEpisodeBrowser-ca56ce2c32b4479af32bf7fb5d065ee9a3a45d8a.tar.gz
Refactor, adjust minimum window size.
Diffstat (limited to 'c/listview.cpp')
-rw-r--r--c/listview.cpp29
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)
{