mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 09:50:02 +00:00
UI improvement (window captions)
svn path=/trunk/; revision=21660
This commit is contained in:
parent
ffd89368ef
commit
990019c419
1 changed files with 47 additions and 42 deletions
|
@ -1150,7 +1150,7 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
|
||||||
if (uFlags & DC_GRADIENT)
|
if (uFlags & DC_GRADIENT)
|
||||||
{
|
{
|
||||||
static GRADIENT_RECT gcap = {0, 1};
|
static GRADIENT_RECT gcap = {0, 1};
|
||||||
TRIVERTEX vert[2];
|
TRIVERTEX vert[3];
|
||||||
COLORREF Colors[2];
|
COLORREF Colors[2];
|
||||||
LONG xx;
|
LONG xx;
|
||||||
|
|
||||||
|
@ -1160,64 +1160,69 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
|
||||||
else
|
else
|
||||||
ButtonWidth = GetSystemMetrics(SM_CXSIZE) - 2;
|
ButtonWidth = GetSystemMetrics(SM_CXSIZE) - 2;
|
||||||
|
|
||||||
if (Style & WS_SYSMENU)
|
//if (Style & WS_SYSMENU)
|
||||||
{
|
//{
|
||||||
r.right -= 3 + ButtonWidth;
|
// r.right -= 3 + ButtonWidth;
|
||||||
if (! (uFlags & DC_SMALLCAP))
|
// if (! (uFlags & DC_SMALLCAP))
|
||||||
{
|
// {
|
||||||
if(Style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
|
// if(Style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
|
||||||
r.right -= 2 + 2 * ButtonWidth;
|
// r.right -= 2 + 2 * ButtonWidth;
|
||||||
else
|
// else
|
||||||
r.right -= 2;
|
// r.right -= 2;
|
||||||
r.right -= 2;
|
// r.right -= 2;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
Colors[0] = GetSysColor((uFlags & DC_ACTIVE) ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION);
|
Colors[0] = GetSysColor((uFlags & DC_ACTIVE) ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION);
|
||||||
Colors[1] = GetSysColor((uFlags & DC_ACTIVE) ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION);
|
Colors[1] = GetSysColor((uFlags & DC_ACTIVE) ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION);
|
||||||
|
|
||||||
|
vert[0].x = r.left;
|
||||||
|
vert[0].y = 0;
|
||||||
|
vert[0].Red = GetRValue(Colors[1]) << 8;
|
||||||
|
vert[0].Green = GetGValue(Colors[1]) << 8;
|
||||||
|
vert[0].Blue = GetBValue(Colors[1]) << 8;
|
||||||
|
vert[0].Alpha = 0;
|
||||||
|
|
||||||
|
vert[1].x = r.right;
|
||||||
|
vert[1].y = (lprc->bottom - lprc->top) / 2;
|
||||||
|
vert[1].Red = GetRValue(Colors[0]) << 8;
|
||||||
|
vert[1].Green = GetGValue(Colors[0]) << 8;
|
||||||
|
vert[1].Blue = GetBValue(Colors[0]) << 8;
|
||||||
|
vert[1].Alpha = 0;
|
||||||
|
|
||||||
|
vert[2].x = r.right;
|
||||||
|
vert[2].y = lprc->bottom - lprc->top;
|
||||||
|
vert[2].Red = GetRValue(Colors[1]) << 8;
|
||||||
|
vert[2].Green = GetGValue(Colors[1]) << 8;
|
||||||
|
vert[2].Blue = GetBValue(Colors[1]) << 8;
|
||||||
|
vert[2].Alpha = 0;
|
||||||
|
|
||||||
|
GdiGradientFill(MemDC, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_V);
|
||||||
|
vert[1].x = r.left;
|
||||||
|
GdiGradientFill(MemDC, &vert[1], 2, &gcap, 1, GRADIENT_FILL_RECT_V);
|
||||||
|
|
||||||
if ((uFlags & DC_ICON) && (Style & WS_SYSMENU) && !(uFlags & DC_SMALLCAP))
|
if ((uFlags & DC_ICON) && (Style & WS_SYSMENU) && !(uFlags & DC_SMALLCAP))
|
||||||
{
|
{
|
||||||
OldBrush = SelectObject(MemDC, GetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION));
|
|
||||||
if (!OldBrush) goto cleanup;
|
|
||||||
xx = GetSystemMetrics(SM_CXSIZE) + Padding;
|
|
||||||
/* draw icon background */
|
|
||||||
PatBlt(MemDC, 0, 0, xx, lprc->bottom - lprc->top, PATCOPY);
|
|
||||||
/* For some reason the icon isn't centered correctly... */
|
|
||||||
r.top --;
|
r.top --;
|
||||||
|
SetBkMode( MemDC, TRANSPARENT );
|
||||||
|
xx = GetSystemMetrics(SM_CXSIZE) + Padding;
|
||||||
if (UserDrawSysMenuButton(hWnd, MemDC, &r, FALSE))
|
if (UserDrawSysMenuButton(hWnd, MemDC, &r, FALSE))
|
||||||
r.left += xx;
|
r.left += xx;
|
||||||
r.top ++;
|
r.top ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
vert[0].x = r.left;
|
|
||||||
vert[0].y = 0;
|
|
||||||
vert[0].Red = GetRValue(Colors[0]) << 8;
|
|
||||||
vert[0].Green = GetGValue(Colors[0]) << 8;
|
|
||||||
vert[0].Blue = GetBValue(Colors[0]) << 8;
|
|
||||||
vert[0].Alpha = 0;
|
|
||||||
|
|
||||||
vert[1].x = r.right;
|
|
||||||
vert[1].y = lprc->bottom - lprc->top;
|
|
||||||
vert[1].Red = GetRValue(Colors[1]) << 8;
|
|
||||||
vert[1].Green = GetGValue(Colors[1]) << 8;
|
|
||||||
vert[1].Blue = GetBValue(Colors[1]) << 8;
|
|
||||||
vert[1].Alpha = 0;
|
|
||||||
|
|
||||||
GdiGradientFill(MemDC, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_H);
|
|
||||||
|
|
||||||
if(OldBrush)
|
if(OldBrush)
|
||||||
{
|
{
|
||||||
SelectObject(MemDC, OldBrush);
|
SelectObject(MemDC, OldBrush);
|
||||||
OldBrush = NULL;
|
OldBrush = NULL;
|
||||||
}
|
}
|
||||||
xx = lprc->right - lprc->left - r.right;
|
//xx = lprc->right - lprc->left - r.right;
|
||||||
if(xx > 0)
|
//if(xx > 0)
|
||||||
{
|
//{
|
||||||
OldBrush = SelectObject(MemDC, GetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION));
|
// OldBrush = SelectObject(MemDC, GetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION));
|
||||||
if (!OldBrush) goto cleanup;
|
// if (!OldBrush) goto cleanup;
|
||||||
PatBlt(MemDC, r.right, 0, xx, lprc->bottom - lprc->top, PATCOPY);
|
// PatBlt(MemDC, r.right, 0, xx, lprc->bottom - lprc->top, PATCOPY);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue