[Bug 60216] New: notepad (and every application): grayed menu items are drawn in a fixed gray 0x808080, ignoring the GrayText system color
http://bugs.winehq.org/show_bug.cgi?id=60216 Bug ID: 60216 Summary: notepad (and every application): grayed menu items are drawn in a fixed gray 0x808080, ignoring the GrayText system color Product: Wine Version: 11.16 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: win32u Assignee: wine-bugs@list.winehq.org Reporter: loic.simond@protonmail.com Target Milestone: --- Distribution: --- Created attachment 81916 --> http://bugs.winehq.org/attachment.cgi?id=81916 Grayed 'Undo' in notepad on wine-11.16: default Aero prefix (top) and custom scheme (bottom), at rest and highlighted - text is 0x808080 in all four, GrayText is 106 106 106 / 0 200 0 Disabled (grayed) menu items do not follow the GrayText system color. Their text is always drawn in gray 0x808080, with a white copy offset by +1,+1 (embossed look) when the item is not highlighted. This happens in every application, including Wine's builtin notepad, with Wine's default configuration. Steps to reproduce, in a clean 64-bit prefix (no override, nothing changed): export WINEPREFIX=~/wine-bugtest wineboot wine reg query "HKCU\Control Panel\Colors" /v GrayText wine notepad In a new prefix the bundled Aero theme is active by default and the query shows GrayText = 106 106 106 (from the [SysMetrics] section of dlls/aero.msstyles/aero.rc). In notepad, open the Edit menu: "Undo" is grayed. Observed: "Undo" and its "Ctrl+Z" column are drawn in 0x808080 with a white (0xFFFFFF) copy shifted one pixel down-right (invisible on the white Aero menu, plainly visible on the dark scheme below); when highlighted, in 0x808080 on the highlight color (0x3096FA). Measured on the attached screenshots: the "Undo" row contains the exact value 0x808080 in both states, and 0x6A6A6A never appears. Expected: the text drawn with the GrayText system color (0x6A6A6A here), the way every other menu color (Menu, MenuText, Hilight...) follows the scheme. With a custom color scheme the effect is much worse. For instance, in the same prefix: wine reg add "HKCU\Control Panel\Colors" /v GrayText /t REG_SZ /d "0 200 0" /f wine reg add "HKCU\Control Panel\Colors" /v Menu /t REG_SZ /d "38 43 51" /f wine reg add "HKCU\Control Panel\Colors" /v MenuBar /t REG_SZ /d "38 43 51" /f wine reg add "HKCU\Control Panel\Colors" /v MenuText /t REG_SZ /d "220 220 220" /f wine reg add "HKCU\Control Panel\Colors" /v Hilight /t REG_SZ /d "143 134 184" /f wine notepad The green GrayText is ignored while the other four keys are honored: the white embossed copy glares on the dark menu (0x808080 + 0xFFFFFF on 0x262B33), and a highlighted grayed item is barely readable on the mid-luminance selection color (0x808080 on 0x8F86B8) — bottom row of the attached screenshots. High contrast schemes, which rely on GrayText for readable disabled text, are affected the same way. Analysis: in dlls/win32u/menu.c, draw_menu_item() selects get_sys_color(COLOR_GRAYTEXT) for grayed items in its "Setup colors" block (lines 2439 and 2448 in wine-11.16), but the text drawing code below overrides it with hardcoded literals: RGB(0x80,0x80,0x80) at lines 2700 and 2728 (main text and shortcut column), and RGB(0xff,0xff,0xff) for the embossed pass at lines 2696 and 2724. Using get_sys_color(COLOR_GRAYTEXT) (already computed by the function) instead of the gray literal, and get_sys_color(COLOR_3DHILIGHT) for the embossed pass, would keep the default rendering identical (both system colors default to the current literals) while honoring custom schemes. Tested on wine-11.16 (Arch Linux package, x86_64, unmodified); the code is identical on current git master. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60216 --- Comment #1 from Loïc <loic.simond@protonmail.com> --- Created attachment 81917 --> http://bugs.winehq.org/attachment.cgi?id=81917 Terminal output of 'wine --version' and 'wine notepad' (clean prefix) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla