mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
LibGfx+Userland: Make TextAttributes::underline_style optional
Rather than having a style AND a field saying whether to use the style, just make the style Optional.
This commit is contained in:
parent
609b616085
commit
6d8f046fd0
10 changed files with 16 additions and 19 deletions
|
@ -503,7 +503,7 @@ void TextEditor::paint_event(PaintEvent& event)
|
|||
} else {
|
||||
painter.draw_text(rect, raw_text, font, alignment, attributes.color);
|
||||
}
|
||||
if (attributes.underline) {
|
||||
if (attributes.underline_style.has_value()) {
|
||||
auto bottom_left = [&]() {
|
||||
auto point = rect.bottom_left().translated(0, 1);
|
||||
|
||||
|
@ -2493,7 +2493,7 @@ void TextEditor::on_search_results(GUI::TextRange current, Vector<GUI::TextRange
|
|||
span.attributes.color = Color::from_argb(0xff000000); // So text without spans from a highlighter will have color
|
||||
if (i == m_search_result_index) {
|
||||
span.attributes.bold = true;
|
||||
span.attributes.underline = true;
|
||||
span.attributes.underline_style = Gfx::TextAttributes::UnderlineStyle::Solid;
|
||||
}
|
||||
spans.append(move(span));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue