1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 17:35:07 +00:00

LibGUI: Make SpinBox up/down buttons look right when disabled

This commit is contained in:
Andreas Kling 2020-12-30 16:11:57 +01:00
parent 0c7f3296e3
commit aa941a31ed

View file

@ -78,10 +78,14 @@ void ControlBoxButton::paint_event(PaintEvent& event)
if (type() == UpArrow) {
if (!s_up_arrow_bitmap)
s_up_arrow_bitmap = &Gfx::CharacterBitmap::create_from_ascii(s_up_arrow_bitmap_data, s_bitmap_width, s_bitmap_height).leak_ref();
if (!is_enabled())
painter.draw_bitmap(button_location.translated(1, 1), *s_up_arrow_bitmap, palette().threed_highlight());
painter.draw_bitmap(button_location, *s_up_arrow_bitmap, is_enabled() ? palette().button_text() : palette().threed_shadow1());
} else {
if (!s_down_arrow_bitmap)
s_down_arrow_bitmap = &Gfx::CharacterBitmap::create_from_ascii(s_down_arrow_bitmap_data, s_bitmap_width, s_bitmap_height).leak_ref();
if (!is_enabled())
painter.draw_bitmap(button_location.translated(1, 1), *s_down_arrow_bitmap, palette().threed_highlight());
painter.draw_bitmap(button_location, *s_down_arrow_bitmap, is_enabled() ? palette().button_text() : palette().threed_shadow1());
}
}