Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e0cc9a79
Commit
e0cc9a79
authored
Jan 12, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/syslink: Fix painting of background color for transparent controls.
parent
84075591
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
syslink.c
dlls/comctl32/syslink.c
+24
-12
No files found.
dlls/comctl32/syslink.c
View file @
e0cc9a79
...
...
@@ -94,7 +94,6 @@ typedef struct
COLORREF
TextColor
;
/* Color of the text */
COLORREF
LinkColor
;
/* Color of links */
COLORREF
VisitedColor
;
/* Color of visited links */
COLORREF
BackColor
;
/* Background color, set on creation */
WCHAR
BreakChar
;
/* Break Character for the current font */
BOOL
IgnoreReturn
;
/* (infoPtr->Style & LWS_IGNORERETURN) on creation */
}
SYSLINK_INFO
;
...
...
@@ -819,11 +818,13 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
HFONT
hOldFont
;
COLORREF
OldTextColor
,
OldBkColor
;
HBRUSH
hBrush
;
UINT
text_flags
=
ETO_CLIPPED
;
UINT
mode
=
GetBkMode
(
hdc
);
hOldFont
=
SelectObject
(
hdc
,
infoPtr
->
Font
);
OldTextColor
=
SetTextColor
(
hdc
,
infoPtr
->
TextColor
);
OldBkColor
=
SetBkColor
(
hdc
,
infoPtr
->
BackColor
);
OldBkColor
=
SetBkColor
(
hdc
,
comctl32_color
.
clrWindow
);
GetClientRect
(
infoPtr
->
Self
,
&
rc
);
rc
.
right
-=
SL_RIGHTMARGIN
+
SL_LEFTMARGIN
;
rc
.
bottom
-=
SL_BOTTOMMARGIN
+
SL_TOPMARGIN
;
...
...
@@ -832,9 +833,13 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
hBrush
=
(
HBRUSH
)
SendMessageW
(
infoPtr
->
Notify
,
WM_CTLCOLORSTATIC
,
(
WPARAM
)
hdc
,
(
LPARAM
)
infoPtr
->
Self
);
if
(
!
hBrush
)
hBrush
=
CreateSolidBrush
(
infoPtr
->
BackColor
);
FillRect
(
hdc
,
&
rc
,
hBrush
);
if
(
!
(
infoPtr
->
Style
&
LWS_TRANSPARENT
))
{
FillRect
(
hdc
,
&
rc
,
hBrush
);
if
(
GetBkMode
(
hdc
)
==
OPAQUE
)
text_flags
|=
ETO_OPAQUE
;
}
else
SetBkMode
(
hdc
,
TRANSPARENT
);
DeleteObject
(
hBrush
);
for
(
Current
=
infoPtr
->
Items
;
Current
!=
NULL
;
Current
=
Current
->
Next
)
...
...
@@ -863,7 +868,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
while
(
n
>
0
)
{
tx
+=
bl
->
nSkip
;
ExtTextOutW
(
hdc
,
bl
->
rc
.
left
,
bl
->
rc
.
top
,
ETO_OPAQUE
|
ETO_CLIPPED
,
&
bl
->
rc
,
tx
,
bl
->
nChars
,
NULL
);
ExtTextOutW
(
hdc
,
bl
->
rc
.
left
,
bl
->
rc
.
top
,
text_flags
,
&
bl
->
rc
,
tx
,
bl
->
nChars
,
NULL
);
if
((
Current
->
Type
==
slLink
)
&&
(
Current
->
u
.
Link
.
state
&
LIS_FOCUSED
)
&&
infoPtr
->
HasFocus
)
{
COLORREF
PrevTextColor
;
...
...
@@ -881,7 +886,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
SetBkColor
(
hdc
,
OldBkColor
);
SetTextColor
(
hdc
,
OldTextColor
);
SelectObject
(
hdc
,
hOldFont
);
SetBkMode
(
hdc
,
mode
);
return
0
;
}
...
...
@@ -1549,6 +1554,17 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
return
SYSLINK_Paint
(
infoPtr
,
(
HDC
)
wParam
);
case
WM_ERASEBKGND
:
if
(
!
(
infoPtr
->
Style
&
LWS_TRANSPARENT
))
{
HDC
hdc
=
(
HDC
)
wParam
;
HBRUSH
brush
=
CreateSolidBrush
(
comctl32_color
.
clrWindow
);
RECT
rect
;
GetClipBox
(
hdc
,
&
rect
);
FillRect
(
hdc
,
&
rect
,
brush
);
DeleteObject
(
brush
);
return
1
;
}
return
0
;
case
WM_SETCURSOR
:
...
...
@@ -1731,8 +1747,6 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
infoPtr
->
TextColor
=
comctl32_color
.
clrWindowText
;
infoPtr
->
LinkColor
=
comctl32_color
.
clrHighlight
;
infoPtr
->
VisitedColor
=
comctl32_color
.
clrHighlight
;
infoPtr
->
BackColor
=
infoPtr
->
Style
&
LWS_TRANSPARENT
?
comctl32_color
.
clrWindow
:
comctl32_color
.
clrBtnFace
;
infoPtr
->
BreakChar
=
' '
;
infoPtr
->
IgnoreReturn
=
infoPtr
->
Style
&
LWS_IGNORERETURN
;
TRACE
(
"SysLink Ctrl creation, hwnd=%p
\n
"
,
hwnd
);
...
...
@@ -1750,8 +1764,6 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
case
WM_SYSCOLORCHANGE
:
COMCTL32_RefreshSysColors
();
if
(
infoPtr
->
Style
&
LWS_TRANSPARENT
)
infoPtr
->
BackColor
=
comctl32_color
.
clrWindow
;
return
0
;
default:
...
...
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