* Draw a toggle button. * @param x the x position to draw * @param y the y position to draw * @param button_colour the colour of the button. * @param background background colour. * @param state true = lowered * @param clickable is the button clickable? */
| 1945 | * @param clickable is the button clickable? |
| 1946 | */ |
| 1947 | void DrawBoolButton(int x, int y, Colours button_colour, Colours background, bool state, bool clickable) |
| 1948 | { |
| 1949 | Rect r = {x, y, x + SETTING_BUTTON_WIDTH - 1, y + SETTING_BUTTON_HEIGHT - 1}; |
| 1950 | DrawFrameRect(r, state ? COLOUR_GREEN : background, state ? FrameFlags{FrameFlag::Lowered} : FrameFlags{FrameFlag::Lowered, FrameFlag::BorderOnly}); |
| 1951 | if (!clickable) { |
| 1952 | GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), GetColourGradient(state ? COLOUR_GREEN : background, SHADE_DARKER), FILLRECT_CHECKER); |
| 1953 | } |
| 1954 | |
| 1955 | Rect button_rect = r.WithWidth(SETTING_BUTTON_WIDTH / 3, state ^ (_current_text_dir == TD_RTL)); |
| 1956 | DrawFrameRect(button_rect, button_colour, {}); |
| 1957 | if (!clickable) { |
| 1958 | GfxFillRect(button_rect.Shrink(WidgetDimensions::scaled.bevel), GetColourGradient(button_colour, SHADE_DARKER), FILLRECT_CHECKER); |
| 1959 | } |
| 1960 | } |
| 1961 | |
| 1962 | struct CustomCurrencyWindow : Window { |
| 1963 | WidgetID query_widget{}; |
no test coverage detected