mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
LibVT: Don't cache bold variant of VT font in a member variable
Remove some leftovers from back when we had to resolve a bold variant of the terminal font manually. Now we can just use bold_variant().
This commit is contained in:
parent
636c43db6c
commit
ee5cf92b3d
2 changed files with 4 additions and 13 deletions
|
@ -380,6 +380,9 @@ void TerminalWidget::paint_event(GUI::PaintEvent& event)
|
||||||
painter.draw_rect(rect.inflated(2, 2).intersected(frame_inner_rect()), palette().base_text());
|
painter.draw_rect(rect.inflated(2, 2).intersected(frame_inner_rect()), palette().base_text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto& font = this->font();
|
||||||
|
auto& bold_font = font.bold_variant();
|
||||||
|
|
||||||
// Pass: Paint foreground (text).
|
// Pass: Paint foreground (text).
|
||||||
for (u16 visual_row = 0; visual_row < m_terminal.rows(); ++visual_row) {
|
for (u16 visual_row = 0; visual_row < m_terminal.rows(); ++visual_row) {
|
||||||
auto row_rect = this->row_rect(visual_row);
|
auto row_rect = this->row_rect(visual_row);
|
||||||
|
@ -408,7 +411,7 @@ void TerminalWidget::paint_event(GUI::PaintEvent& event)
|
||||||
painter.draw_glyph_or_emoji(
|
painter.draw_glyph_or_emoji(
|
||||||
character_rect.location(),
|
character_rect.location(),
|
||||||
code_point,
|
code_point,
|
||||||
attribute.flags & VT::Attribute::Bold ? bold_font() : font(),
|
attribute.flags & VT::Attribute::Bold ? bold_font : font,
|
||||||
text_color);
|
text_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1062,14 +1065,6 @@ void TerminalWidget::did_change_font()
|
||||||
{
|
{
|
||||||
GUI::Frame::did_change_font();
|
GUI::Frame::did_change_font();
|
||||||
m_line_height = font().glyph_height() + m_line_spacing;
|
m_line_height = font().glyph_height() + m_line_spacing;
|
||||||
|
|
||||||
const Gfx::Font& bold_font = font().bold_variant();
|
|
||||||
|
|
||||||
if (bold_font.glyph_height() == font().glyph_height() && bold_font.glyph_width(' ') == font().glyph_width(' '))
|
|
||||||
m_bold_font = &bold_font;
|
|
||||||
else
|
|
||||||
m_bold_font = font();
|
|
||||||
|
|
||||||
if (!size().is_empty())
|
if (!size().is_empty())
|
||||||
relayout(size());
|
relayout(size());
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,6 @@ public:
|
||||||
|
|
||||||
void apply_size_increments_to_window(GUI::Window&);
|
void apply_size_increments_to_window(GUI::Window&);
|
||||||
|
|
||||||
const Gfx::Font& bold_font() const { return *m_bold_font; }
|
|
||||||
|
|
||||||
void set_opacity(u8);
|
void set_opacity(u8);
|
||||||
float opacity() { return m_opacity; };
|
float opacity() { return m_opacity; };
|
||||||
|
|
||||||
|
@ -175,8 +173,6 @@ private:
|
||||||
bool m_cursor_blink_state { true };
|
bool m_cursor_blink_state { true };
|
||||||
bool m_automatic_size_policy { false };
|
bool m_automatic_size_policy { false };
|
||||||
|
|
||||||
RefPtr<Gfx::Font> m_bold_font;
|
|
||||||
|
|
||||||
enum class AutoScrollDirection {
|
enum class AutoScrollDirection {
|
||||||
None,
|
None,
|
||||||
Up,
|
Up,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue