mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[0.4.7][WIN32SS] Fix RIGHT-expansion-arrow in submenus being drawn too large CORE-13211
A squashed port of 0.4.13-dev-702-g1e91a1690d
0.4.13-dev-809-g65e4efd475
0.4.14-dev-186-gb3033b81a4
which in sum brings us to the nice state of 0.4.13-release-0-g4ee3778a4ed2d80c96e7a0f7a1e52e78d3a6568e where I used the same trio successfully already. CORE-13211 "RIGHT-expansion-arrow in submenus being drawn too large" did affect many apps, e.g: UltraISO and Abiword It was fixed by 0.4.13-dev-702-g1e91a1690d
(#1752) but on its own it did introduce 2 regressions: The first was that the "upwards scrolling arrow in language selection submenu of UltraISO was now drawn much too large" (discussion and pics also in CORE-13211) That was fixed by the addendum 0.4.13-dev-809-g65e4efd475
(#1753) But we had still another regression from the first commit to solve: CORE-16470 "The checkmarks in Abiwords menubar became black boxes" That last regression was fixed by 0.4.14-dev-186-gb3033b81a4
(#2009)
This commit is contained in:
parent
2e512886e4
commit
cf57f9e92d
3 changed files with 38 additions and 33 deletions
|
@ -666,7 +666,10 @@ BOOL FASTCALL UITOOLS95_DFC_ButtonCheckRadio(HDC dc, LPRECT r, UINT uFlags, BOOL
|
|||
HFONT hFont, hOldFont;
|
||||
int i;
|
||||
WCHAR OutRight, OutLeft, InRight, InLeft, Center;
|
||||
RECT myr;
|
||||
INT cxy, nBkMode;
|
||||
|
||||
cxy = UITOOLS_MakeSquareRect(r, &myr);
|
||||
if (Radio)
|
||||
{
|
||||
OutRight = 'j'; // Outer right
|
||||
|
@ -684,7 +687,7 @@ BOOL FASTCALL UITOOLS95_DFC_ButtonCheckRadio(HDC dc, LPRECT r, UINT uFlags, BOOL
|
|||
}
|
||||
|
||||
RtlZeroMemory(&lf, sizeof(LOGFONTW));
|
||||
lf.lfHeight = r->top - r->bottom;
|
||||
lf.lfHeight = cxy;
|
||||
lf.lfWidth = 0;
|
||||
lf.lfWeight = FW_NORMAL;
|
||||
lf.lfCharSet = DEFAULT_CHARSET;
|
||||
|
@ -692,16 +695,18 @@ BOOL FASTCALL UITOOLS95_DFC_ButtonCheckRadio(HDC dc, LPRECT r, UINT uFlags, BOOL
|
|||
hFont = GreCreateFontIndirectW(&lf);
|
||||
hOldFont = NtGdiSelectFont(dc, hFont);
|
||||
|
||||
nBkMode = GreGetBkMode(dc);
|
||||
|
||||
if(Radio && ((uFlags & 0xff) == DFCS_BUTTONRADIOMASK))
|
||||
{
|
||||
IntGdiSetBkMode(dc, OPAQUE);
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_WINDOWFRAME));
|
||||
GreTextOutW(dc, r->left, r->top, &Center, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &Center, 1);
|
||||
IntGdiSetBkMode(dc, TRANSPARENT);
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_WINDOWFRAME));
|
||||
GreTextOutW(dc, r->left, r->top, &OutRight, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &OutRight, 1);
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_WINDOWFRAME));
|
||||
GreTextOutW(dc, r->left, r->top, &OutLeft, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &OutLeft, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -710,26 +715,26 @@ BOOL FASTCALL UITOOLS95_DFC_ButtonCheckRadio(HDC dc, LPRECT r, UINT uFlags, BOOL
|
|||
/* Center section, white for active, grey for inactive */
|
||||
i= !(uFlags & (DFCS_INACTIVE|DFCS_PUSHED)) ? COLOR_WINDOW : COLOR_BTNFACE;
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(i));
|
||||
GreTextOutW(dc, r->left, r->top, &Center, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &Center, 1);
|
||||
|
||||
if(uFlags & (DFCS_FLAT | DFCS_MONO))
|
||||
{
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_WINDOWFRAME));
|
||||
GreTextOutW(dc, r->left, r->top, &OutRight, 1);
|
||||
GreTextOutW(dc, r->left, r->top, &OutLeft, 1);
|
||||
GreTextOutW(dc, r->left, r->top, &InRight, 1);
|
||||
GreTextOutW(dc, r->left, r->top, &InLeft, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &OutRight, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &OutLeft, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &InRight, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &InLeft, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_BTNSHADOW));
|
||||
GreTextOutW(dc, r->left, r->top, &OutRight, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &OutRight, 1);
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_BTNHIGHLIGHT));
|
||||
GreTextOutW(dc, r->left, r->top, &OutLeft, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &OutLeft, 1);
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_3DDKSHADOW));
|
||||
GreTextOutW(dc, r->left, r->top, &InRight, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &InRight, 1);
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_3DLIGHT));
|
||||
GreTextOutW(dc, r->left, r->top, &InLeft, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &InLeft, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -738,12 +743,13 @@ BOOL FASTCALL UITOOLS95_DFC_ButtonCheckRadio(HDC dc, LPRECT r, UINT uFlags, BOOL
|
|||
WCHAR Check = (Radio) ? 'i' : 'b';
|
||||
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_WINDOWTEXT));
|
||||
GreTextOutW(dc, r->left, r->top, &Check, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &Check, 1);
|
||||
}
|
||||
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_WINDOWTEXT));
|
||||
NtGdiSelectFont(dc, hOldFont);
|
||||
GreDeleteObject(hFont);
|
||||
IntGdiSetBkMode(dc, nBkMode);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -943,9 +949,13 @@ BOOL FASTCALL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT uFlags)
|
|||
|
||||
BOOL FASTCALL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
|
||||
{
|
||||
// TODO: DFCS_TRANSPARENT upon DFCS_MENUARROWUP or DFCS_MENUARROWDOWN
|
||||
LOGFONTW lf;
|
||||
HFONT hFont, hOldFont;
|
||||
WCHAR Symbol;
|
||||
RECT myr;
|
||||
INT cxy;
|
||||
cxy = UITOOLS_MakeSquareRect(r, &myr);
|
||||
switch(uFlags & 0xff)
|
||||
{
|
||||
case DFCS_MENUARROWUP:
|
||||
|
@ -980,7 +990,7 @@ BOOL FASTCALL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
|
|||
}
|
||||
/* acquire ressources only if valid menu */
|
||||
RtlZeroMemory(&lf, sizeof(LOGFONTW));
|
||||
lf.lfHeight = r->bottom - r->top;
|
||||
lf.lfHeight = cxy;
|
||||
lf.lfWidth = 0;
|
||||
lf.lfWeight = FW_NORMAL;
|
||||
lf.lfCharSet = DEFAULT_CHARSET;
|
||||
|
@ -997,13 +1007,13 @@ BOOL FASTCALL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
|
|||
{
|
||||
/* draw shadow */
|
||||
IntGdiSetTextColor(dc, IntGetSysColor(COLOR_BTNHIGHLIGHT));
|
||||
GreTextOutW(dc, r->left + 1, r->top + 1, &Symbol, 1);
|
||||
GreTextOutW(dc, myr.left + 1, myr.top + 1, &Symbol, 1);
|
||||
}
|
||||
#endif
|
||||
IntGdiSetTextColor(dc, IntGetSysColor((uFlags & DFCS_INACTIVE) ? COLOR_BTNSHADOW : COLOR_BTNTEXT));
|
||||
}
|
||||
/* draw selected symbol */
|
||||
GreTextOutW(dc, r->left, r->top, &Symbol, 1);
|
||||
GreTextOutW(dc, myr.left, myr.top, &Symbol, 1);
|
||||
/* restore previous settings */
|
||||
NtGdiSelectFont(dc, hOldFont);
|
||||
GreDeleteObject(hFont);
|
||||
|
|
|
@ -2154,11 +2154,10 @@ static void MENU_MenuBarCalcSize( HDC hdc, LPRECT lprect, PMENU lppop, PWND pwnd
|
|||
*/
|
||||
static void MENU_DrawScrollArrows(PMENU lppop, HDC hdc)
|
||||
{
|
||||
UINT arrow_bitmap_width, arrow_bitmap_height;
|
||||
RECT rect, dfcrc;
|
||||
UINT arrow_bitmap_height;
|
||||
RECT rect;
|
||||
UINT Flags = 0;
|
||||
|
||||
arrow_bitmap_width = gpsi->oembmi[OBI_DNARROW].cx;
|
||||
arrow_bitmap_height = gpsi->oembmi[OBI_DNARROW].cy;
|
||||
|
||||
rect.left = 0;
|
||||
|
@ -2166,22 +2165,14 @@ static void MENU_DrawScrollArrows(PMENU lppop, HDC hdc)
|
|||
rect.right = lppop->cxMenu;
|
||||
rect.bottom = arrow_bitmap_height;
|
||||
FillRect(hdc, &rect, IntGetSysColorBrush(COLOR_MENU));
|
||||
dfcrc.left = (lppop->cxMenu - arrow_bitmap_width) / 2;
|
||||
dfcrc.top = 0;
|
||||
dfcrc.right = arrow_bitmap_width;
|
||||
dfcrc.bottom = arrow_bitmap_height;
|
||||
DrawFrameControl(hdc, &dfcrc, DFC_MENU, (lppop->iTop ? 0 : DFCS_INACTIVE)|DFCS_MENUARROWUP);
|
||||
DrawFrameControl(hdc, &rect, DFC_MENU, (lppop->iTop ? 0 : DFCS_INACTIVE)|DFCS_MENUARROWUP);
|
||||
|
||||
rect.top = lppop->cyMenu - arrow_bitmap_height;
|
||||
rect.bottom = lppop->cyMenu;
|
||||
FillRect(hdc, &rect, IntGetSysColorBrush(COLOR_MENU));
|
||||
if (!(lppop->iTop < lppop->iMaxTop - (MENU_GetMaxPopupHeight(lppop) - 2 * arrow_bitmap_height)))
|
||||
Flags = DFCS_INACTIVE;
|
||||
dfcrc.left = (lppop->cxMenu - arrow_bitmap_width) / 2;
|
||||
dfcrc.top = lppop->cyMenu - arrow_bitmap_height;
|
||||
dfcrc.right = arrow_bitmap_width;
|
||||
dfcrc.bottom = lppop->cyMenu;
|
||||
DrawFrameControl(hdc, &dfcrc, DFC_MENU, Flags|DFCS_MENUARROWDOWN);
|
||||
DrawFrameControl(hdc, &rect, DFC_MENU, Flags|DFCS_MENUARROWDOWN);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -976,9 +976,13 @@ static BOOL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT uFlags)
|
|||
|
||||
static BOOL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
|
||||
{
|
||||
// TODO: DFCS_TRANSPARENT upon DFCS_MENUARROWUP or DFCS_MENUARROWDOWN
|
||||
LOGFONTW lf;
|
||||
HFONT hFont, hOldFont;
|
||||
TCHAR Symbol;
|
||||
RECT myr;
|
||||
INT cxy;
|
||||
cxy = UITOOLS_MakeSquareRect(r, &myr);
|
||||
switch(uFlags & 0xff)
|
||||
{
|
||||
case DFCS_MENUARROWUP:
|
||||
|
@ -1011,7 +1015,7 @@ static BOOL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
|
|||
}
|
||||
/* acquire ressources only if valid menu */
|
||||
ZeroMemory(&lf, sizeof(LOGFONTW));
|
||||
lf.lfHeight = r->bottom - r->top;
|
||||
lf.lfHeight = cxy;
|
||||
lf.lfWidth = 0;
|
||||
lf.lfWeight = FW_NORMAL;
|
||||
lf.lfCharSet = DEFAULT_CHARSET;
|
||||
|
@ -1028,13 +1032,13 @@ static BOOL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
|
|||
{
|
||||
/* draw shadow */
|
||||
SetTextColor(dc, GetSysColor(COLOR_BTNHIGHLIGHT));
|
||||
TextOut(dc, r->left + 1, r->top + 1, &Symbol, 1);
|
||||
TextOut(dc, myr.left + 1, myr.top + 1, &Symbol, 1);
|
||||
}
|
||||
#endif
|
||||
SetTextColor(dc, GetSysColor((uFlags & DFCS_INACTIVE) ? COLOR_BTNSHADOW : COLOR_BTNTEXT));
|
||||
}
|
||||
/* draw selected symbol */
|
||||
TextOut(dc, r->left, r->top, &Symbol, 1);
|
||||
TextOut(dc, myr.left, myr.top, &Symbol, 1);
|
||||
/* restore previous settings */
|
||||
SelectObject(dc, hOldFont);
|
||||
DeleteObject(hFont);
|
||||
|
|
Loading…
Reference in a new issue