1
0
Fork 0

Change: Enhance visibility of disabled bool button. (#14071)

Apply masked fill to background as well.
pull/8505/merge
Peter Nelson 2025-04-22 17:37:30 +01:00 committed by GitHub
parent 415ac07a08
commit 12118b201c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -1879,6 +1879,10 @@ void DrawBoolButton(int x, int y, Colours button_colour, Colours background, boo
{ {
Rect r = {x, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1}; Rect r = {x, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1};
DrawFrameRect(r, state ? COLOUR_GREEN : background, state ? FrameFlags{FrameFlag::Lowered} : FrameFlags{FrameFlag::Lowered, FrameFlag::BorderOnly}); DrawFrameRect(r, state ? COLOUR_GREEN : background, state ? FrameFlags{FrameFlag::Lowered} : FrameFlags{FrameFlag::Lowered, FrameFlag::BorderOnly});
if (!clickable) {
GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), GetColourGradient(state ? COLOUR_GREEN : background, SHADE_DARKER), FILLRECT_CHECKER);
}
Rect button_rect = r.WithWidth(SETTING_BUTTON_WIDTH / 3, state ^ (_current_text_dir == TD_RTL)); Rect button_rect = r.WithWidth(SETTING_BUTTON_WIDTH / 3, state ^ (_current_text_dir == TD_RTL));
DrawFrameRect(button_rect, button_colour, {}); DrawFrameRect(button_rect, button_colour, {});
if (!clickable) { if (!clickable) {