mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibGUI: Redraw widgets when default font changes
This commit is contained in:
parent
b40d771512
commit
8992271c5c
2 changed files with 8 additions and 2 deletions
|
@ -562,6 +562,8 @@ void Widget::theme_change_event(ThemeChangeEvent&)
|
||||||
|
|
||||||
void Widget::fonts_change_event(FontsChangeEvent&)
|
void Widget::fonts_change_event(FontsChangeEvent&)
|
||||||
{
|
{
|
||||||
|
if (m_default_font)
|
||||||
|
set_font(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::screen_rects_change_event(ScreenRectsChangeEvent&)
|
void Widget::screen_rects_change_event(ScreenRectsChangeEvent&)
|
||||||
|
@ -705,10 +707,13 @@ void Widget::set_font(const Gfx::Font* font)
|
||||||
if (m_font.ptr() == font)
|
if (m_font.ptr() == font)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!font)
|
if (!font) {
|
||||||
m_font = Gfx::FontDatabase::default_font();
|
m_font = Gfx::FontDatabase::default_font();
|
||||||
else
|
m_default_font = true;
|
||||||
|
} else {
|
||||||
m_font = *font;
|
m_font = *font;
|
||||||
|
m_default_font = false;
|
||||||
|
}
|
||||||
|
|
||||||
did_change_font();
|
did_change_font();
|
||||||
update();
|
update();
|
||||||
|
|
|
@ -361,6 +361,7 @@ private:
|
||||||
bool m_updates_enabled { true };
|
bool m_updates_enabled { true };
|
||||||
bool m_accepts_emoji_input { false };
|
bool m_accepts_emoji_input { false };
|
||||||
bool m_shrink_to_fit { false };
|
bool m_shrink_to_fit { false };
|
||||||
|
bool m_default_font { true };
|
||||||
|
|
||||||
NonnullRefPtr<Gfx::PaletteImpl> m_palette;
|
NonnullRefPtr<Gfx::PaletteImpl> m_palette;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue