1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 01:49:10 +00:00

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

Apply masked fill to background as well.
This commit is contained in:
2025-04-22 17:37:30 +01:00
committed by GitHub
parent 415ac07a08
commit 12118b201c

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};
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));
DrawFrameRect(button_rect, button_colour, {});
if (!clickable) {