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

Base+LibGUI+LibGfx: Improve disabled text readability

Currently, disabled text colors are hardcoded. They look good in Default
and light themes, but no so good in dark ones. This PR adds new
variables for all themes to correctly display disabled text.
This commit is contained in:
Jaime Valenzuela Durán 2022-03-05 01:28:03 +01:00 committed by Andreas Kling
parent 26d29e9220
commit 7c32400431
22 changed files with 44 additions and 4 deletions

View file

@ -226,8 +226,8 @@ void AbstractButton::paint_text(Painter& painter, const Gfx::IntRect& rect, cons
auto clipped_rect = rect.intersected(this->rect());
if (!is_enabled()) {
painter.draw_text(clipped_rect.translated(1, 1), text(), font, text_alignment, Color::White, Gfx::TextElision::Right, text_wrapping);
painter.draw_text(clipped_rect, text(), font, text_alignment, Color::from_rgb(0x808080), Gfx::TextElision::Right, text_wrapping);
painter.draw_text(clipped_rect.translated(1, 1), text(), font, text_alignment, palette().disabled_text_back(), Gfx::TextElision::Right, text_wrapping);
painter.draw_text(clipped_rect, text(), font, text_alignment, palette().disabled_text_front(), Gfx::TextElision::Right, text_wrapping);
return;
}