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

LibVT/Kernel: Make VT::Attribute::Flags enum class, use AK EnumBits

Noticed the TODO in `Attribute.h` and realized we have as solution
to this problem already. :^)
This commit is contained in:
Brian Gianforcaro 2022-03-17 23:14:50 -07:00 committed by Andreas Kling
parent 8601f74d5f
commit 913374163c
4 changed files with 22 additions and 22 deletions

View file

@ -342,7 +342,7 @@ void TerminalWidget::paint_event(GUI::PaintEvent& event)
auto underline_style = UnderlineStyle::None;
auto underline_color = text_color;
if (attribute.flags & VT::Attribute::Underline) {
if (has_flag(attribute.flags, VT::Attribute::Flags::Underline)) {
// Content has specified underline
underline_style = UnderlineStyle::Solid;
} else if (!attribute.href.is_empty()) {
@ -410,7 +410,7 @@ void TerminalWidget::paint_event(GUI::PaintEvent& event)
painter.draw_glyph_or_emoji(
character_rect.location(),
code_point,
attribute.flags & VT::Attribute::Bold ? bold_font : font,
has_flag(attribute.flags, VT::Attribute::Flags::Bold) ? bold_font : font,
text_color);
}
}