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
567b6fac
Commit
567b6fac
authored
Jul 15, 2005
by
Frank Richter
Committed by
Alexandre Julliard
Jul 15, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for drawing gradient captions.
parent
9bea3bfc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
5 deletions
+68
-5
nonclient.c
dlls/user/nonclient.c
+67
-5
wingdi.h
include/wingdi.h
+1
-0
No files found.
dlls/user/nonclient.c
View file @
567b6fac
...
...
@@ -197,6 +197,67 @@ static HICON NC_IconForWindow( HWND hwnd )
return
hIcon
;
}
/* Draws the bar part(ie the big rectangle) of the caption */
static
void
NC_DrawCaptionBar
(
HDC
hdc
,
const
RECT
*
rect
,
DWORD
dwStyle
,
BOOL
active
,
BOOL
gradient
)
{
if
(
gradient
)
{
TRIVERTEX
vertices
[
6
];
DWORD
colLeft
=
GetSysColor
(
active
?
COLOR_ACTIVECAPTION
:
COLOR_INACTIVECAPTION
);
DWORD
colRight
=
GetSysColor
(
active
?
COLOR_GRADIENTACTIVECAPTION
:
COLOR_GRADIENTINACTIVECAPTION
);
int
v
;
int
buttonsAreaSize
=
GetSystemMetrics
(
SM_CYCAPTION
)
-
1
;
static
GRADIENT_RECT
mesh
[]
=
{{
0
,
1
},
{
2
,
3
},
{
4
,
5
}};
for
(
v
=
0
;
v
<
3
;
v
++
)
{
vertices
[
v
].
Red
=
GetRValue
(
colLeft
)
<<
8
;
vertices
[
v
].
Green
=
GetGValue
(
colLeft
)
<<
8
;
vertices
[
v
].
Blue
=
GetBValue
(
colLeft
)
<<
8
;
vertices
[
v
].
Alpha
=
0x8000
;
vertices
[
v
+
3
].
Red
=
GetRValue
(
colRight
)
<<
8
;
vertices
[
v
+
3
].
Green
=
GetGValue
(
colRight
)
<<
8
;
vertices
[
v
+
3
].
Blue
=
GetBValue
(
colRight
)
<<
8
;
vertices
[
v
+
3
].
Alpha
=
0x8000
;
}
if
((
dwStyle
&
WS_SYSMENU
)
&&
((
dwStyle
&
WS_MAXIMIZEBOX
)
||
(
dwStyle
&
WS_MINIMIZEBOX
)))
buttonsAreaSize
+=
2
*
(
GetSystemMetrics
(
SM_CXSIZE
)
+
1
);
/* area behind icon; solid filled with left color */
vertices
[
0
].
x
=
rect
->
left
;
vertices
[
0
].
y
=
rect
->
top
;
if
(
dwStyle
&
WS_SYSMENU
)
vertices
[
1
].
x
=
min
(
rect
->
left
+
GetSystemMetrics
(
SM_CXSMICON
),
rect
->
right
);
else
vertices
[
1
].
x
=
vertices
[
0
].
x
;
vertices
[
1
].
y
=
rect
->
bottom
;
/* area behind text; gradient */
vertices
[
2
].
x
=
vertices
[
1
].
x
;
vertices
[
2
].
y
=
rect
->
top
;
vertices
[
3
].
x
=
max
(
vertices
[
2
].
x
,
rect
->
right
-
buttonsAreaSize
);
vertices
[
3
].
y
=
rect
->
bottom
;
/* area behind buttons; solid filled with right color */
vertices
[
4
].
x
=
vertices
[
3
].
x
;
vertices
[
4
].
y
=
rect
->
top
;
vertices
[
5
].
x
=
rect
->
right
;
vertices
[
5
].
y
=
rect
->
bottom
;
GdiGradientFill
(
hdc
,
vertices
,
6
,
mesh
,
3
,
GRADIENT_FILL_RECT_H
);
}
else
FillRect
(
hdc
,
rect
,
GetSysColorBrush
(
active
?
COLOR_ACTIVECAPTION
:
COLOR_INACTIVECAPTION
));
}
/***********************************************************************
* DrawCaption (USER32.@) Draws a caption bar
*
...
...
@@ -214,7 +275,7 @@ static HICON NC_IconForWindow( HWND hwnd )
BOOL
WINAPI
DrawCaption
(
HWND
hwnd
,
HDC
hdc
,
const
RECT
*
lpRect
,
UINT
uFlags
)
{
return
DrawCaptionTemp
A
(
hwnd
,
hdc
,
lpRect
,
0
,
0
,
NULL
,
uFlags
&
0x1
F
);
return
DrawCaptionTemp
W
(
hwnd
,
hdc
,
lpRect
,
0
,
0
,
NULL
,
uFlags
&
0x103
F
);
}
...
...
@@ -265,8 +326,8 @@ BOOL WINAPI DrawCaptionTempW (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont,
}
}
else
{
FillRect
(
hdc
,
&
rc
,
GetSysColorBrush
((
uFlags
&
DC_ACTIVE
)
?
COLOR_ACTIVECAPTION
:
COLOR_INACTIVECAPTION
)
);
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
NC_DrawCaptionBar
(
hdc
,
rect
,
style
,
uFlags
&
DC_ACTIVE
,
uFlags
&
DC_GRADIENT
);
}
...
...
@@ -864,6 +925,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, DWORD style,
WCHAR
buffer
[
256
];
HPEN
hPrevPen
;
HMENU
hSysMenu
;
BOOL
gradient
=
FALSE
;
hPrevPen
=
SelectObject
(
hdc
,
SYSCOLOR_GetPen
(
((
exStyle
&
(
WS_EX_STATICEDGE
|
WS_EX_CLIENTEDGE
|
...
...
@@ -874,8 +936,8 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, DWORD style,
SelectObject
(
hdc
,
hPrevPen
);
r
.
bottom
--
;
FillRect
(
hdc
,
&
r
,
GetSysColorBrush
(
active
?
COLOR_ACTIVECAPTION
:
COLOR_INACTIVECAPTION
)
);
SystemParametersInfoW
(
SPI_GETGRADIENTCAPTIONS
,
0
,
&
gradient
,
0
);
NC_DrawCaptionBar
(
hdc
,
rect
,
style
,
active
,
gradient
);
if
((
style
&
WS_SYSMENU
)
&&
!
(
exStyle
&
WS_EX_TOOLWINDOW
))
{
if
(
NC_DrawSysButton
(
hwnd
,
hdc
,
FALSE
))
...
...
include/wingdi.h
View file @
567b6fac
...
...
@@ -3335,6 +3335,7 @@ BOOL WINAPI GdiAlphaBlend(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNC
BOOL
WINAPI
GdiComment
(
HDC
,
UINT
,
const
BYTE
*
);
DEVMODEW
*
WINAPI
GdiConvertToDevmodeW
(
const
DEVMODEA
*
);
BOOL
WINAPI
GdiFlush
(
void
);
BOOL
WINAPI
GdiGradientFill
(
HDC
,
PTRIVERTEX
,
ULONG
,
PVOID
,
ULONG
,
ULONG
);
BOOL
WINAPI
GdiIsMetaFileDC
(
HDC
);
BOOL
WINAPI
GdiIsMetaPrintDC
(
HDC
);
BOOL
WINAPI
GdiIsPlayMetafileDC
(
HDC
);
...
...
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