From b4d13907148f2790482df5608b4e6c4ae6a68bc8 Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Tue, 29 Dec 2020 18:25:13 +0100 Subject: [PATCH] LibGFX: Move default_xxx_font() methods from Font to FontDatabase When we have an abstract font class it makes no sense to keep these methods in the Font class. --- Applications/Browser/ConsoleWidget.cpp | 3 +- Applications/Calculator/CalculatorWidget.cpp | 3 +- Applications/Calendar/AddEventDialog.cpp | 3 +- Applications/Calendar/main.cpp | 3 +- Applications/FontEditor/main.cpp | 3 +- Applications/HexEditor/HexEditor.cpp | 5 ++- Applications/Piano/RollWidget.cpp | 3 +- Applications/Spreadsheet/CellTypeDialog.cpp | 3 +- .../Spreadsheet/SpreadsheetWidget.cpp | 3 +- .../SystemMonitor/MemoryStatsWidget.cpp | 3 +- Applications/Welcome/main.cpp | 7 ++-- Demos/LibGfxDemo/main.cpp | 9 +++-- Demos/WidgetGallery/main.cpp | 3 +- DevTools/HackStudio/EditorWrapper.cpp | 3 +- DevTools/HackStudio/FindInFilesWidget.cpp | 3 +- DevTools/HackStudio/Git/DiffViewer.cpp | 3 +- DevTools/HackStudio/HackStudioWidget.cpp | 3 +- Games/Chess/ChessWidget.cpp | 5 ++- Games/Snake/SnakeGame.cpp | 3 +- Games/Solitaire/Card.cpp | 3 +- Libraries/LibGUI/AboutDialog.cpp | 3 +- Libraries/LibGUI/Button.cpp | 3 +- Libraries/LibGUI/Calendar.cpp | 9 +++-- Libraries/LibGUI/FilePicker.cpp | 3 +- Libraries/LibGUI/HeaderView.cpp | 3 +- Libraries/LibGUI/TextEditor.cpp | 2 +- Libraries/LibGUI/Widget.cpp | 5 ++- Libraries/LibGfx/ClassicWindowTheme.cpp | 9 +++-- Libraries/LibGfx/Font.cpp | 40 ------------------- Libraries/LibGfx/Font.h | 6 --- Libraries/LibGfx/FontDatabase.cpp | 40 +++++++++++++++++++ Libraries/LibGfx/FontDatabase.h | 6 +++ Libraries/LibGfx/Painter.cpp | 3 +- Libraries/LibVT/TerminalWidget.cpp | 4 +- Libraries/LibWeb/CSS/StyleProperties.cpp | 2 +- Libraries/LibWeb/HTML/HTMLInputElement.cpp | 5 ++- Libraries/LibWeb/Layout/ImageBox.cpp | 5 ++- MenuApplets/Audio/main.cpp | 3 +- MenuApplets/Clock/main.cpp | 5 ++- MenuApplets/UserName/main.cpp | 5 ++- .../NotificationServer/NotificationWindow.cpp | 3 +- Services/SystemMenu/ShutdownDialog.cpp | 3 +- Services/Taskbar/TaskbarButton.cpp | 3 +- Services/WindowServer/Menu.cpp | 6 +-- Services/WindowServer/Menu.h | 3 +- Services/WindowServer/MenuBar.cpp | 2 +- Services/WindowServer/WindowManager.cpp | 4 +- Userland/test-gfx-font.cpp | 8 ++-- 48 files changed, 152 insertions(+), 115 deletions(-) diff --git a/Applications/Browser/ConsoleWidget.cpp b/Applications/Browser/ConsoleWidget.cpp index 826b0a50a5..55c545dc55 100644 --- a/Applications/Browser/ConsoleWidget.cpp +++ b/Applications/Browser/ConsoleWidget.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -67,7 +68,7 @@ ConsoleWidget::ConsoleWidget() m_input = bottom_container.add(); m_input->set_syntax_highlighter(make()); // FIXME: Syntax Highlighting breaks the cursor's position on non fixed-width fonts. - m_input->set_font(Gfx::Font::default_fixed_width_font()); + m_input->set_font(Gfx::FontDatabase::default_fixed_width_font()); m_input->set_history_enabled(true); m_input->on_return_pressed = [this] { diff --git a/Applications/Calculator/CalculatorWidget.cpp b/Applications/Calculator/CalculatorWidget.cpp index 0be7c8c059..5ad951f112 100644 --- a/Applications/Calculator/CalculatorWidget.cpp +++ b/Applications/Calculator/CalculatorWidget.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include CalculatorWidget::CalculatorWidget() @@ -39,7 +40,7 @@ CalculatorWidget::CalculatorWidget() m_entry = add(); m_entry->set_relative_rect(5, 5, 244, 26); m_entry->set_text_alignment(Gfx::TextAlignment::CenterRight); - m_entry->set_font(Gfx::Font::default_fixed_width_font()); + m_entry->set_font(Gfx::FontDatabase::default_fixed_width_font()); m_label = add(); m_label->set_relative_rect(12, 42, 27, 27); diff --git a/Applications/Calendar/AddEventDialog.cpp b/Applications/Calendar/AddEventDialog.cpp index c3a427c9c1..dbb70d33c1 100644 --- a/Applications/Calendar/AddEventDialog.cpp +++ b/Applications/Calendar/AddEventDialog.cpp @@ -38,6 +38,7 @@ #include #include #include +#include static const char* short_month_names[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", @@ -65,7 +66,7 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, Window* parent_window) auto& add_label = top_container.add("Add title & date:"); add_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); add_label.set_fixed_height(14); - add_label.set_font(Gfx::Font::default_bold_font()); + add_label.set_font(Gfx::FontDatabase::default_bold_font()); auto& event_title_textbox = top_container.add(); event_title_textbox.set_fixed_height(20); diff --git a/Applications/Calendar/main.cpp b/Applications/Calendar/main.cpp index 81840c4fe4..95dec9d301 100644 --- a/Applications/Calendar/main.cpp +++ b/Applications/Calendar/main.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include int main(int argc, char** argv) @@ -136,7 +137,7 @@ int main(int argc, char** argv) selected_calendar_button = toolbar.add(calendar_widget.selected_calendar_text()); selected_calendar_button->set_fixed_width(70); selected_calendar_button->set_button_style(Gfx::ButtonStyle::CoolBar); - selected_calendar_button->set_font(Gfx::Font::default_bold_fixed_width_font()); + selected_calendar_button->set_font(Gfx::FontDatabase::default_bold_fixed_width_font()); selected_calendar_button->on_click = [&](auto) { calendar_widget.toggle_mode(); selected_calendar_button->set_text(calendar_widget.selected_calendar_text()); diff --git a/Applications/FontEditor/main.cpp b/Applications/FontEditor/main.cpp index 10481c8f5a..9108445f1b 100644 --- a/Applications/FontEditor/main.cpp +++ b/Applications/FontEditor/main.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -62,7 +63,7 @@ int main(int argc, char** argv) RefPtr edited_font; if (path == nullptr) { path = "/tmp/saved.font"; - edited_font = Gfx::Font::default_font().clone(); + edited_font = Gfx::FontDatabase::default_font().clone(); } else { edited_font = Gfx::Font::load_from_file(path)->clone(); if (!edited_font) { diff --git a/Applications/HexEditor/HexEditor.cpp b/Applications/HexEditor/HexEditor.cpp index dd464d3861..f4999661f8 100644 --- a/Applications/HexEditor/HexEditor.cpp +++ b/Applications/HexEditor/HexEditor.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,7 @@ HexEditor::HexEditor() { set_focus_policy(GUI::FocusPolicy::StrongFocus); set_scrollbars_enabled(true); - set_font(Gfx::Font::default_fixed_width_font()); + set_font(Gfx::FontDatabase::default_fixed_width_font()); set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); vertical_scrollbar().set_step(line_height()); @@ -520,7 +521,7 @@ void HexEditor::paint_event(GUI::PaintEvent& event) painter.draw_text( side_offset_rect, line, - is_current_line ? Gfx::Font::default_bold_font() : font(), + is_current_line ? Gfx::FontDatabase::default_bold_font() : font(), Gfx::TextAlignment::TopLeft, is_current_line ? palette().ruler_active_text() : palette().ruler_inactive_text()); } diff --git a/Applications/Piano/RollWidget.cpp b/Applications/Piano/RollWidget.cpp index e6c655aa44..2677fed384 100644 --- a/Applications/Piano/RollWidget.cpp +++ b/Applications/Piano/RollWidget.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include constexpr int note_height = 20; @@ -142,7 +143,7 @@ void RollWidget::paint_event(GUI::PaintEvent& event) const char* note_name = note_names[note % notes_per_octave]; painter.draw_text(note_name_rect, note_name, Gfx::TextAlignment::CenterLeft); - note_name_rect.move_by(Gfx::Font::default_font().width(note_name) + 2, 0); + note_name_rect.move_by(Gfx::FontDatabase::default_font().width(note_name) + 2, 0); if (note % notes_per_octave == 0) painter.draw_text(note_name_rect, String::formatted("{}", note / notes_per_octave + 1), Gfx::TextAlignment::CenterLeft); } diff --git a/Applications/Spreadsheet/CellTypeDialog.cpp b/Applications/Spreadsheet/CellTypeDialog.cpp index dc2a3f04d4..a353e15d86 100644 --- a/Applications/Spreadsheet/CellTypeDialog.cpp +++ b/Applications/Spreadsheet/CellTypeDialog.cpp @@ -43,6 +43,7 @@ #include #include #include +#include REGISTER_WIDGET(Spreadsheet, ConditionsView); @@ -437,7 +438,7 @@ ConditionView::ConditionView(ConditionalFormat& fmt) formula_editor.set_syntax_highlighter(make()); formula_editor.set_should_hide_unnecessary_scrollbars(true); - formula_editor.set_font(&Gfx::Font::default_fixed_width_font()); + formula_editor.set_font(&Gfx::FontDatabase::default_fixed_width_font()); formula_editor.on_change = [&] { m_format.condition = formula_editor.text(); }; diff --git a/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Applications/Spreadsheet/SpreadsheetWidget.cpp index fbe10f54ca..7635c4ff39 100644 --- a/Applications/Spreadsheet/SpreadsheetWidget.cpp +++ b/Applications/Spreadsheet/SpreadsheetWidget.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include namespace Spreadsheet { @@ -65,7 +66,7 @@ SpreadsheetWidget::SpreadsheetWidget(NonnullRefPtrVector&& sheets, bool s }; auto& cell_value_editor = top_bar.add(GUI::TextEditor::Type::SingleLine); - cell_value_editor.set_font(Gfx::Font::default_fixed_width_font()); + cell_value_editor.set_font(Gfx::FontDatabase::default_fixed_width_font()); cell_value_editor.set_scrollbars_enabled(false); cell_value_editor.set_syntax_highlighter(make()); diff --git a/Applications/SystemMonitor/MemoryStatsWidget.cpp b/Applications/SystemMonitor/MemoryStatsWidget.cpp index 2d7b4df23b..feaf7631f1 100644 --- a/Applications/SystemMonitor/MemoryStatsWidget.cpp +++ b/Applications/SystemMonitor/MemoryStatsWidget.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -61,7 +62,7 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph) container.set_layout(); container.set_fixed_size(275, 12); auto& description_label = container.add(description); - description_label.set_font(Gfx::Font::default_bold_font()); + description_label.set_font(Gfx::FontDatabase::default_bold_font()); description_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); auto& label = container.add(); label.set_text_alignment(Gfx::TextAlignment::CenterRight); diff --git a/Applications/Welcome/main.cpp b/Applications/Welcome/main.cpp index 78c4d70889..101b35fd97 100644 --- a/Applications/Welcome/main.cpp +++ b/Applications/Welcome/main.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -195,14 +196,14 @@ int main(int argc, char** argv) } auto& content_title = title_box.add(); - content_title.set_font(Gfx::Font::default_bold_font()); + content_title.set_font(Gfx::FontDatabase::default_bold_font()); content_title.set_text(page.title); content_title.set_text_alignment(Gfx::TextAlignment::CenterLeft); content_title.set_fixed_height(10); for (auto& paragraph : page.content) { auto& content_text = content.add(); - content_text.set_font(Gfx::Font::default_font()); + content_text.set_font(Gfx::FontDatabase::default_font()); content_text.set_text(paragraph); content_text.set_text_alignment(Gfx::TextAlignment::TopLeft); content_text.set_line_height(12); @@ -210,7 +211,7 @@ int main(int argc, char** argv) } auto& menu_option = menu.add(); - menu_option.set_font(Gfx::Font::default_font()); + menu_option.set_font(Gfx::FontDatabase::default_font()); menu_option.set_text(page.menu_name); menu_option.set_text_alignment(Gfx::TextAlignment::CenterLeft); menu_option.set_fixed_height(20); diff --git a/Demos/LibGfxDemo/main.cpp b/Demos/LibGfxDemo/main.cpp index 9a5d6caa34..c60c0e56d6 100644 --- a/Demos/LibGfxDemo/main.cpp +++ b/Demos/LibGfxDemo/main.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -161,10 +162,10 @@ void Canvas::draw() painter.draw_text({ 520, 360, 240, 30 }, "Emojis! 🙂😂🐞🦄", Gfx::TextAlignment::Center, Color::White); painter.draw_rect({ 520, 410, 240, 80 }, Color::DarkGray); - painter.draw_text({ 520, 415, 240, 20 }, "Normal text", Gfx::Font::default_font(), Gfx::TextAlignment::CenterLeft, Color::Red); - painter.draw_text({ 520, 430, 240, 20 }, "Bold text", Gfx::Font::default_bold_font(), Gfx::TextAlignment::CenterLeft, Color::Green); - painter.draw_text({ 520, 450, 240, 20 }, "Normal text (fixed width)", Gfx::Font::default_fixed_width_font(), Gfx::TextAlignment::CenterLeft, Color::Blue); - painter.draw_text({ 520, 465, 240, 20 }, "Bold text (fixed width)", Gfx::Font::default_bold_fixed_width_font(), Gfx::TextAlignment::CenterLeft, Color::Yellow); + painter.draw_text({ 520, 415, 240, 20 }, "Normal text", Gfx::FontDatabase::default_font(), Gfx::TextAlignment::CenterLeft, Color::Red); + painter.draw_text({ 520, 430, 240, 20 }, "Bold text", Gfx::FontDatabase::default_bold_font(), Gfx::TextAlignment::CenterLeft, Color::Green); + painter.draw_text({ 520, 450, 240, 20 }, "Normal text (fixed width)", Gfx::FontDatabase::default_fixed_width_font(), Gfx::TextAlignment::CenterLeft, Color::Blue); + painter.draw_text({ 520, 465, 240, 20 }, "Bold text (fixed width)", Gfx::FontDatabase::default_bold_fixed_width_font(), Gfx::TextAlignment::CenterLeft, Color::Yellow); auto font = Gfx::Font::load_from_file("/res/fonts/PebbletonBold14.font"); painter.draw_rect({ 520, 510, 240, 30 }, Color::DarkGray); diff --git a/Demos/WidgetGallery/main.cpp b/Demos/WidgetGallery/main.cpp index 47cd73a259..bee4663b5e 100644 --- a/Demos/WidgetGallery/main.cpp +++ b/Demos/WidgetGallery/main.cpp @@ -55,6 +55,7 @@ #include #include #include +#include template class ListViewModel final : public GUI::Model { @@ -442,7 +443,7 @@ int main(int argc, char** argv) input_group_box.layout()->add_spacer(); auto& input_label = input_group_box.add("Valued user input goes here."); - input_label.set_font(Gfx::Font::default_bold_font()); + input_label.set_font(Gfx::FontDatabase::default_bold_font()); input_group_box.layout()->add_spacer(); diff --git a/DevTools/HackStudio/EditorWrapper.cpp b/DevTools/HackStudio/EditorWrapper.cpp index c21396f251..e4b6a346c7 100644 --- a/DevTools/HackStudio/EditorWrapper.cpp +++ b/DevTools/HackStudio/EditorWrapper.cpp @@ -32,6 +32,7 @@ #include #include #include +#include namespace HackStudio { @@ -77,7 +78,7 @@ EditorWrapper::~EditorWrapper() void EditorWrapper::set_editor_has_focus(Badge, bool focus) { - m_filename_label->set_font(focus ? Gfx::Font::default_bold_font() : Gfx::Font::default_font()); + m_filename_label->set_font(focus ? Gfx::FontDatabase::default_bold_font() : Gfx::FontDatabase::default_font()); } } diff --git a/DevTools/HackStudio/FindInFilesWidget.cpp b/DevTools/HackStudio/FindInFilesWidget.cpp index 7c823ed42b..8347e73c81 100644 --- a/DevTools/HackStudio/FindInFilesWidget.cpp +++ b/DevTools/HackStudio/FindInFilesWidget.cpp @@ -32,6 +32,7 @@ #include #include #include +#include namespace HackStudio { @@ -78,7 +79,7 @@ public: return Gfx::TextAlignment::CenterLeft; if (role == GUI::ModelRole::Font) { if (index.column() == Column::MatchedText) - return Gfx::Font::default_fixed_width_font(); + return Gfx::FontDatabase::default_fixed_width_font(); return {}; } if (role == GUI::ModelRole::Display) { diff --git a/DevTools/HackStudio/Git/DiffViewer.cpp b/DevTools/HackStudio/Git/DiffViewer.cpp index e4725131fe..9633ff6d1d 100644 --- a/DevTools/HackStudio/Git/DiffViewer.cpp +++ b/DevTools/HackStudio/Git/DiffViewer.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include // #define DEBUG_DIFF @@ -180,7 +181,7 @@ DiffViewer::DiffViewer(const String& original, const String& diff) void DiffViewer::setup_properties() { - set_font(Gfx::Font::default_fixed_width_font()); + set_font(Gfx::FontDatabase::default_fixed_width_font()); set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); } diff --git a/DevTools/HackStudio/HackStudioWidget.cpp b/DevTools/HackStudio/HackStudioWidget.cpp index 588c3ee80b..0fed336232 100644 --- a/DevTools/HackStudio/HackStudioWidget.cpp +++ b/DevTools/HackStudio/HackStudioWidget.cpp @@ -75,6 +75,7 @@ #include #include #include +#include #include #include #include @@ -718,7 +719,7 @@ void HackStudioWidget::create_form_editor(GUI::Widget& parent) auto& label = wrapper.add(text); label.set_fill_with_background_color(true); label.set_text_alignment(Gfx::TextAlignment::CenterLeft); - label.set_font(Gfx::Font::default_bold_font()); + label.set_font(Gfx::FontDatabase::default_bold_font()); label.set_fixed_height(16); wrapper.add_child(pane_widget); }; diff --git a/Games/Chess/ChessWidget.cpp b/Games/Chess/ChessWidget.cpp index 9888d817f0..61586fedac 100644 --- a/Games/Chess/ChessWidget.cpp +++ b/Games/Chess/ChessWidget.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -83,10 +84,10 @@ void ChessWidget::paint_event(GUI::PaintEvent& event) auto shrunken_rect = tile_rect; shrunken_rect.shrink(4, 4); if (sq.rank == coord_rank_file) - painter.draw_text(shrunken_rect, coord.substring_view(0, 1), Gfx::Font::default_bold_font(), Gfx::TextAlignment::BottomRight, text_color); + painter.draw_text(shrunken_rect, coord.substring_view(0, 1), Gfx::FontDatabase::default_bold_font(), Gfx::TextAlignment::BottomRight, text_color); if (sq.file == coord_rank_file) - painter.draw_text(shrunken_rect, coord.substring_view(1, 1), Gfx::Font::default_bold_font(), Gfx::TextAlignment::TopLeft, text_color); + painter.draw_text(shrunken_rect, coord.substring_view(1, 1), Gfx::FontDatabase::default_bold_font(), Gfx::TextAlignment::TopLeft, text_color); } for (auto& m : m_board_markings) { diff --git a/Games/Snake/SnakeGame.cpp b/Games/Snake/SnakeGame.cpp index 70e8f85dbf..4c96a7aee9 100644 --- a/Games/Snake/SnakeGame.cpp +++ b/Games/Snake/SnakeGame.cpp @@ -29,12 +29,13 @@ #include #include #include +#include #include #include SnakeGame::SnakeGame() { - set_font(Gfx::Font::default_bold_fixed_width_font()); + set_font(Gfx::FontDatabase::default_bold_fixed_width_font()); m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/paprika.png")); m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/eggplant.png")); m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/cauliflower.png")); diff --git a/Games/Solitaire/Card.cpp b/Games/Solitaire/Card.cpp index c98de8a90b..23c3473632 100644 --- a/Games/Solitaire/Card.cpp +++ b/Games/Solitaire/Card.cpp @@ -27,6 +27,7 @@ #include "Card.h" #include #include +#include static const NonnullRefPtr s_diamond = Gfx::CharacterBitmap::create_from_ascii( " # " @@ -105,7 +106,7 @@ Card::Card(Type type, uint8_t value) } Gfx::Painter painter(m_front); - auto& font = Gfx::Font::default_bold_font(); + auto& font = Gfx::FontDatabase::default_bold_font(); static const String labels[] = { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" }; auto label = labels[value]; diff --git a/Libraries/LibGUI/AboutDialog.cpp b/Libraries/LibGUI/AboutDialog.cpp index 8021b05d2f..38d4571a3d 100644 --- a/Libraries/LibGUI/AboutDialog.cpp +++ b/Libraries/LibGUI/AboutDialog.cpp @@ -33,6 +33,7 @@ #include #include #include +#include namespace GUI { @@ -82,7 +83,7 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Window label.set_text_alignment(Gfx::TextAlignment::CenterLeft); label.set_fixed_height(14); if (bold) - label.set_font(Gfx::Font::default_bold_font()); + label.set_font(Gfx::FontDatabase::default_bold_font()); }; make_label(m_name, true); // If we are displaying a dialog for an application, insert 'SerenityOS' below the application name diff --git a/Libraries/LibGUI/Button.cpp b/Libraries/LibGUI/Button.cpp index 633d416e08..d1f20f4b80 100644 --- a/Libraries/LibGUI/Button.cpp +++ b/Libraries/LibGUI/Button.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -89,7 +90,7 @@ void Button::paint_event(PaintEvent& event) painter.blit_disabled(icon_location, *m_icon, m_icon->rect(), palette()); } } - auto& font = is_checked() ? Gfx::Font::default_bold_font() : this->font(); + auto& font = is_checked() ? Gfx::FontDatabase::default_bold_font() : this->font(); if (m_icon && !text().is_empty()) { content_rect.move_by(m_icon->width() + 4, 0); content_rect.set_width(content_rect.width() - m_icon->width() - 4); diff --git a/Libraries/LibGUI/Calendar.cpp b/Libraries/LibGUI/Calendar.cpp index 8671cbee9a..c02a17d0e5 100644 --- a/Libraries/LibGUI/Calendar.cpp +++ b/Libraries/LibGUI/Calendar.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include namespace GUI { @@ -72,7 +73,7 @@ Calendar::Calendar(Core::DateTime date_time) m_day_name_container->set_background_role(Gfx::ColorRole::HoverHighlight); for (auto& day : m_day_names) { day = m_day_name_container->add(); - day->set_font(Gfx::Font::default_bold_font()); + day->set_font(Gfx::FontDatabase::default_bold_font()); } m_calendar_tile_container = add(); @@ -357,13 +358,13 @@ void Calendar::CalendarTile::paint_event(GUI::PaintEvent& event) } else if (is_selected()) { painter.draw_rect(frame_inner_rect(), palette().base_text()); } - painter.draw_text(day_rect, display_date, Gfx::Font::default_bold_font(), Gfx::TextAlignment::Center, palette().base_text()); + painter.draw_text(day_rect, display_date, Gfx::FontDatabase::default_bold_font(), Gfx::TextAlignment::Center, palette().base_text()); } else if (is_outside_selection()) { - painter.draw_text(day_rect, display_date, Gfx::Font::default_font(), Gfx::TextAlignment::Center, Color::LightGray); + painter.draw_text(day_rect, display_date, Gfx::FontDatabase::default_font(), Gfx::TextAlignment::Center, Color::LightGray); } else { if (!has_grid() && is_selected()) painter.draw_rect(frame_inner_rect(), palette().base_text()); - painter.draw_text(day_rect, display_date, Gfx::Font::default_font(), Gfx::TextAlignment::Center, palette().base_text()); + painter.draw_text(day_rect, display_date, Gfx::FontDatabase::default_font(), Gfx::TextAlignment::Center, palette().base_text()); } } diff --git a/Libraries/LibGUI/FilePicker.cpp b/Libraries/LibGUI/FilePicker.cpp index 3d21f7a963..576d49f09b 100644 --- a/Libraries/LibGUI/FilePicker.cpp +++ b/Libraries/LibGUI/FilePicker.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include namespace GUI { @@ -253,7 +254,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, Options options, const m_preview_image->set_fixed_size(160, 160); m_preview_name_label = m_preview_container->add