aboutsummaryrefslogtreecommitdiff
path: root/c/listview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/listview.cpp')
-rw-r--r--c/listview.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/c/listview.cpp b/c/listview.cpp
index 6dfa888..b10ae88 100644
--- a/c/listview.cpp
+++ b/c/listview.cpp
@@ -4,7 +4,7 @@
#include "common.h"
#include "listview.h"
-#include "main.h"
+#include "layout.h"
extern HFONT g_hfNormal;
static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
@@ -25,7 +25,7 @@ ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle
m_proc0 = (WNDPROC)SetWindowLongPtr(hWnd,
GWLP_WNDPROC, (LONG_PTR)::WndProc);
- ListView_SetExtendedListViewStyle(hWnd, LVS_EX_FULLROWSELECT);
+ ListView_SetExtendedListViewStyle(hWnd, LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER);
SendMessage(hWnd, WM_SETFONT, (WPARAM)g_hfNormal, MAKELPARAM(FALSE, 0));
}
@@ -50,18 +50,15 @@ void ListView::ResizeColumns(int) {}
void ListView::UpdateTheme(const BOOL bThemeActive)
{
- DWORD dwStyle;
const wchar_t* theme;
WORD action;
extern int g_bThemes;
if (!g_bThemes) return;
if (bThemeActive) {
- dwStyle = LVS_EX_DOUBLEBUFFER;
theme = L"Explorer";
action = UIS_SET;
} else {
- dwStyle = 0;
theme = NULL;
action = UIS_CLEAR;
}
@@ -69,9 +66,6 @@ void ListView::UpdateTheme(const BOOL bThemeActive)
/* Use modern "Explorer" theme. */
SetWindowTheme(hWnd, theme, NULL);
- /* The modern theme requires double buffering. */
- ListView_SetExtendedListViewStyleEx(hWnd, LVS_EX_DOUBLEBUFFER, dwStyle);
-
/* Hide focus rectangles. */
SendMessage(hWnd, WM_UPDATEUISTATE, MAKEWPARAM(action, UISF_HIDEFOCUS), 0);
}
@@ -79,6 +73,7 @@ void ListView::UpdateTheme(const BOOL bThemeActive)
LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg,
const WPARAM wParam, const LPARAM lParam)
{
+ extern Dragger g_dragDlv;
switch (uMsg) {
case WM_NOTIFY:
switch (((NMHDR*)lParam)->code) {
@@ -87,6 +82,11 @@ LRESULT CALLBACK ListView::WndProc(const HWND hWnd, const UINT uMsg,
return TRUE;
}
break;
+ case WM_LBUTTONDOWN:
+ case WM_NCLBUTTONDOWN:
+ if (g_dragDlv.HandleDown())
+ return 0;
+ break;
}
return CallWindowProc(m_proc0, hWnd, uMsg, wParam, lParam);