mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 20:25:07 +00:00
Add a bold variant of Katica and make that the system's default bold font.
..and do some minor tweaks to the font rendering code.
This commit is contained in:
parent
66a5ddd94a
commit
31d6b640eb
5 changed files with 10 additions and 5 deletions
|
@ -76,7 +76,7 @@ void GTextBox::paint_event(GPaintEvent& event)
|
|||
Painter painter(*this);
|
||||
painter.set_clip_rect(event.rect());
|
||||
|
||||
painter.fill_rect({ rect().x() + 1, rect().y() + 1, rect().width() - 2, rect().height() - 2 }, background_color());
|
||||
painter.fill_rect(rect().shrunken(2, 2), background_color());
|
||||
painter.draw_rect(rect(), foreground_color());
|
||||
|
||||
if (is_focused())
|
||||
|
@ -88,9 +88,9 @@ void GTextBox::paint_event(GPaintEvent& event)
|
|||
painter.set_clip_rect(inner_rect);
|
||||
painter.translate(-m_scroll_offset, 0);
|
||||
|
||||
int y = inner_rect.center().y() - font().glyph_height() / 2;
|
||||
int space_width = font().glyph_width(' ') + font().glyph_spacing();
|
||||
int x = inner_rect.x();
|
||||
int y = inner_rect.center().y() - font().glyph_height() / 2;
|
||||
|
||||
for (int i = 0; i < m_text.length(); ++i) {
|
||||
char ch = m_text[i];
|
||||
|
@ -103,7 +103,12 @@ void GTextBox::paint_event(GPaintEvent& event)
|
|||
}
|
||||
|
||||
if (is_focused() && m_cursor_blink_state) {
|
||||
Rect cursor_rect(inner_rect.x() + cursor_content_position().x(), inner_rect.y(), 1, inner_rect.height());
|
||||
Rect cursor_rect {
|
||||
inner_rect.x() + cursor_content_position().x(),
|
||||
inner_rect.y(),
|
||||
1,
|
||||
inner_rect.height()
|
||||
};
|
||||
painter.fill_rect(cursor_rect, foreground_color());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue