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
7c9cacd4
Commit
7c9cacd4
authored
Nov 05, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Nov 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/button: Correctly place parts for themed group boxes.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4f912012
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
22 deletions
+27
-22
button.c
dlls/comctl32/button.c
+27
-22
No files found.
dlls/comctl32/button.c
View file @
7c9cacd4
...
...
@@ -2855,11 +2855,12 @@ cleanup:
static
void
GB_ThemedPaint
(
HTHEME
theme
,
const
BUTTON_INFO
*
infoPtr
,
HDC
hDC
,
int
state
,
UINT
dtFlags
,
BOOL
focused
)
{
RECT
bgRect
,
textRect
,
content
Rect
;
WCHAR
*
text
=
get_button_text
(
infoPtr
)
;
RECT
clientRect
,
contentRect
,
imageRect
,
textRect
,
bg
Rect
;
HRGN
region
,
textRegion
=
NULL
;
LOGFONTW
lf
;
HFONT
font
,
hPrevFont
=
NULL
;
BOOL
created_font
=
FALSE
;
TEXTMETRICW
textMetric
;
HRESULT
hr
=
GetThemeFont
(
theme
,
hDC
,
BP_GROUPBOX
,
state
,
TMT_FONT
,
&
lf
);
if
(
SUCCEEDED
(
hr
))
{
...
...
@@ -2875,37 +2876,41 @@ static void GB_ThemedPaint(HTHEME theme, const BUTTON_INFO *infoPtr, HDC hDC, in
SelectObject
(
hDC
,
infoPtr
->
font
);
}
GetClientRect
(
infoPtr
->
hwnd
,
&
bgRect
);
textRect
=
bgRect
;
GetClientRect
(
infoPtr
->
hwnd
,
&
clientRect
);
GetThemeBackgroundContentRect
(
theme
,
hDC
,
BP_GROUPBOX
,
state
,
&
clientRect
,
&
contentRect
);
region
=
set_control_clipping
(
hDC
,
&
clientRect
);
if
(
text
)
{
SIZE
textExtent
;
GetTextExtentPoint32W
(
hDC
,
text
,
lstrlenW
(
text
),
&
textExtent
);
bgRect
.
top
+=
(
textExtent
.
cy
/
2
);
textRect
.
left
+=
10
;
textRect
.
bottom
=
textRect
.
top
+
textExtent
.
cy
;
textRect
.
right
=
textRect
.
left
+
textExtent
.
cx
+
4
;
bgRect
=
contentRect
;
GetTextMetricsW
(
hDC
,
&
textMetric
);
bgRect
.
top
+=
(
textMetric
.
tmHeight
/
2
)
-
1
;
ExcludeClipRect
(
hDC
,
textRect
.
left
,
textRect
.
top
,
textRect
.
right
,
textRect
.
bottom
);
InflateRect
(
&
contentRect
,
-
7
,
1
);
dtFlags
=
BUTTON_CalcLayoutRects
(
infoPtr
,
hDC
,
&
contentRect
,
&
imageRect
,
&
textRect
);
if
(
dtFlags
!=
(
UINT
)
-
1
&&
!
show_image_only
(
infoPtr
))
{
textRegion
=
CreateRectRgnIndirect
(
&
textRect
);
ExtSelectClipRgn
(
hDC
,
textRegion
,
RGN_DIFF
);
}
GetThemeBackgroundContentRect
(
theme
,
hDC
,
BP_GROUPBOX
,
state
,
&
bgRect
,
&
contentRect
);
ExcludeClipRect
(
hDC
,
contentRect
.
left
,
contentRect
.
top
,
contentRect
.
right
,
contentRect
.
bottom
);
if
(
IsThemeBackgroundPartiallyTransparent
(
theme
,
BP_GROUPBOX
,
state
))
DrawThemeParentBackground
(
infoPtr
->
hwnd
,
hDC
,
NULL
);
DrawThemeBackground
(
theme
,
hDC
,
BP_GROUPBOX
,
state
,
&
bgRect
,
NULL
);
SelectClipRgn
(
hDC
,
NULL
);
if
(
text
)
if
(
dtFlags
!=
(
UINT
)
-
1
)
{
InflateRect
(
&
textRect
,
-
2
,
0
);
DrawThemeText
(
theme
,
hDC
,
BP_GROUPBOX
,
state
,
text
,
lstrlenW
(
text
),
0
,
0
,
&
textRect
);
heap_free
(
text
);
contentRect
.
left
--
;
contentRect
.
right
++
;
contentRect
.
bottom
++
;
if
(
textRegion
)
{
SelectClipRgn
(
hDC
,
textRegion
);
DeleteObject
(
textRegion
);
}
BUTTON_DrawThemedLabel
(
infoPtr
,
hDC
,
dtFlags
,
&
imageRect
,
&
textRect
,
theme
,
BP_GROUPBOX
,
state
);
}
SelectClipRgn
(
hDC
,
region
);
if
(
region
)
DeleteObject
(
region
);
if
(
created_font
)
DeleteObject
(
font
);
if
(
hPrevFont
)
SelectObject
(
hDC
,
hPrevFont
);
}
...
...
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