1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:55:08 +00:00

Base: Add the PlaceholderText attribute to themes

This commit is contained in:
Peter Elliott 2020-09-20 13:22:54 -07:00 committed by Andreas Kling
parent 7907df7617
commit 253ab7536a
15 changed files with 16 additions and 1 deletions

View file

@ -465,7 +465,7 @@ void TextEditor::paint_event(PaintEvent& event)
if (!placeholder().is_empty() && document().is_empty() && !is_focused() && line_index == 0) {
auto line_rect = visual_line_rect;
line_rect.set_width(font().width(placeholder()));
painter.draw_text(line_rect, placeholder(), m_text_alignment, palette().color(Gfx::ColorRole::DisabledText));
painter.draw_text(line_rect, placeholder(), m_text_alignment, palette().color(Gfx::ColorRole::PlaceholderText));
} else if (!document().has_spans()) {
// Fast-path for plain text
auto color = palette().color(is_enabled() ? foreground_role() : Gfx::ColorRole::DisabledText);