Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0209e511
Commit
0209e511
authored
Jan 20, 2022
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Jan 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/treeview: Support themed check boxes for TVS_CHECKBOXES style.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b4b87987
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
treeview.c
dlls/comctl32/treeview.c
+49
-0
No files found.
dlls/comctl32/treeview.c
View file @
0209e511
...
...
@@ -2962,6 +2962,52 @@ TREEVIEW_Invalidate(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
InvalidateRect
(
infoPtr
->
hwnd
,
NULL
,
TRUE
);
}
static
BOOL
TREEVIEW_InitThemedCheckboxes
(
TREEVIEW_INFO
*
info
)
{
HBITMAP
bitmap
,
old_bitmap
;
HDC
hdc
,
hdc_screen
;
HTHEME
theme
;
RECT
rect
;
SIZE
size
;
if
(
!
GetWindowTheme
(
info
->
hwnd
))
return
FALSE
;
theme
=
OpenThemeDataForDpi
(
NULL
,
L"Button"
,
GetDpiForWindow
(
info
->
hwnd
));
if
(
!
theme
)
return
FALSE
;
hdc_screen
=
GetDC
(
0
);
hdc
=
CreateCompatibleDC
(
hdc_screen
);
GetThemePartSize
(
theme
,
hdc
,
BP_CHECKBOX
,
0
,
NULL
,
TS_DRAW
,
&
size
);
bitmap
=
CreateCompatibleBitmap
(
hdc_screen
,
size
.
cx
*
3
,
size
.
cy
);
old_bitmap
=
SelectObject
(
hdc
,
bitmap
);
SetRect
(
&
rect
,
0
,
0
,
size
.
cx
*
3
,
size
.
cy
);
FillRect
(
hdc
,
&
rect
,
(
HBRUSH
)(
COLOR_WINDOW
+
1
));
rect
.
left
=
size
.
cx
;
rect
.
right
=
rect
.
left
+
size
.
cx
;
DrawThemeBackground
(
theme
,
hdc
,
BP_CHECKBOX
,
CBS_UNCHECKEDNORMAL
,
&
rect
,
NULL
);
rect
.
left
=
size
.
cx
*
2
;
rect
.
right
=
rect
.
left
+
size
.
cx
;
DrawThemeBackground
(
theme
,
hdc
,
BP_CHECKBOX
,
CBS_CHECKEDNORMAL
,
&
rect
,
NULL
);
SelectObject
(
hdc
,
old_bitmap
);
info
->
himlState
=
ImageList_Create
(
size
.
cx
,
size
.
cy
,
ILC_COLOR32
,
3
,
0
);
ImageList_Add
(
info
->
himlState
,
bitmap
,
NULL
);
DeleteObject
(
bitmap
);
DeleteDC
(
hdc
);
ReleaseDC
(
0
,
hdc_screen
);
CloseThemeData
(
theme
);
info
->
stateImageWidth
=
size
.
cx
;
info
->
stateImageHeight
=
size
.
cy
;
return
TRUE
;
}
static
void
TREEVIEW_InitCheckboxes
(
TREEVIEW_INFO
*
infoPtr
)
{
...
...
@@ -2970,6 +3016,9 @@ TREEVIEW_InitCheckboxes(TREEVIEW_INFO *infoPtr)
HDC
hdc
,
hdcScreen
;
int
nIndex
;
if
(
TREEVIEW_InitThemedCheckboxes
(
infoPtr
))
return
;
infoPtr
->
himlState
=
ImageList_Create
(
16
,
16
,
ILC_COLOR
|
ILC_MASK
,
3
,
0
);
hdcScreen
=
GetDC
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment