mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibGfx: Move FontDatabase from LibGUI to LibGfx
Not sure why I put this into LibGUI in the first place.
This commit is contained in:
parent
e569f7fd1c
commit
982e066100
Notes:
sideshowbarker
2024-07-19 01:37:22 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/982e066100c
13 changed files with 12 additions and 17 deletions
|
@ -28,7 +28,6 @@
|
|||
#include <AK/StringBuilder.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Clipboard.h>
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/FilePicker.h>
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <LibGUI/ActionGroup.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <LibGUI/GroupBox.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
|
@ -330,7 +330,7 @@ int main(int argc, char** argv)
|
|||
GUI::ActionGroup font_action_group;
|
||||
font_action_group.set_exclusive(true);
|
||||
auto& font_menu = menubar->add_menu("Font");
|
||||
GUI::FontDatabase::the().for_each_fixed_width_font([&](const Gfx::Font& font) {
|
||||
Gfx::FontDatabase::the().for_each_fixed_width_font([&](const Gfx::Font& font) {
|
||||
auto action = GUI::Action::create_checkable(font.qualified_name(), [&](auto&) {
|
||||
terminal.set_font(font);
|
||||
config->write_entry("Text", "Font", font.qualified_name());
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/CppSyntaxHighlighter.h>
|
||||
#include <LibGUI/FilePicker.h>
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGUI/INISyntaxHighlighter.h>
|
||||
#include <LibGUI/JSSyntaxHighlighter.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
|
@ -55,6 +54,7 @@
|
|||
#include <LibGUI/ToolBar.h>
|
||||
#include <LibGUI/ToolBarContainer.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <LibMarkdown/Document.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <string.h>
|
||||
|
@ -396,7 +396,7 @@ TextEditorWidget::TextEditorWidget()
|
|||
font_actions.set_exclusive(true);
|
||||
|
||||
auto& font_menu = view_menu.add_submenu("Font");
|
||||
GUI::FontDatabase::the().for_each_fixed_width_font([&](const Gfx::Font& font) {
|
||||
Gfx::FontDatabase::the().for_each_fixed_width_font([&](const Gfx::Font& font) {
|
||||
auto action = GUI::Action::create_checkable(font.qualified_name(), [&](auto&) {
|
||||
m_editor->set_font(font);
|
||||
m_editor->update();
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include <LibGUI/CheckBox.h>
|
||||
#include <LibGUI/ColorInput.h>
|
||||
#include <LibGUI/ComboBox.h>
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGUI/GroupBox.h>
|
||||
#include <LibGUI/Icon.h>
|
||||
#include <LibGUI/ImageWidget.h>
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
*/
|
||||
|
||||
#include "BoardView.h"
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
BoardView::BoardView(const Game::Board* board)
|
||||
|
@ -63,7 +63,7 @@ void BoardView::pick_font()
|
|||
{
|
||||
String best_font_name;
|
||||
int best_font_size = -1;
|
||||
auto& font_database = GUI::FontDatabase::the();
|
||||
auto& font_database = Gfx::FontDatabase::the();
|
||||
font_database.for_each_font([&](const Gfx::Font& font) {
|
||||
if (font.family() != "Liza" || font.weight() != 700)
|
||||
return;
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "SnakeGame.h"
|
||||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Font.h>
|
||||
|
|
|
@ -28,7 +28,6 @@ set(SOURCES
|
|||
FilePicker.cpp
|
||||
FileSystemModel.cpp
|
||||
FilteringProxyModel.cpp
|
||||
FontDatabase.cpp
|
||||
Frame.cpp
|
||||
GroupBox.cpp
|
||||
HeaderView.cpp
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <LibCore/Timer.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Clipboard.h>
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
|
|
|
@ -9,6 +9,7 @@ set(SOURCES
|
|||
DisjointRectSet.cpp
|
||||
Emoji.cpp
|
||||
Font.cpp
|
||||
FontDatabase.cpp
|
||||
GIFLoader.cpp
|
||||
ICOLoader.cpp
|
||||
ImageDecoder.cpp
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <AK/QuickSort.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <dirent.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace GUI {
|
||||
namespace Gfx {
|
||||
|
||||
static FontDatabase* s_the;
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#include <AK/String.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
|
||||
namespace GUI {
|
||||
namespace Gfx {
|
||||
|
||||
class FontDatabase {
|
||||
public:
|
|
@ -39,12 +39,12 @@
|
|||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Clipboard.h>
|
||||
#include <LibGUI/DragOperation.h>
|
||||
#include <LibGUI/FontDatabase.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
@ -122,7 +122,7 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy, RefPtr<Co
|
|||
if (font_entry == "default")
|
||||
set_font(Gfx::Font::default_fixed_width_font());
|
||||
else
|
||||
set_font(GUI::FontDatabase::the().get_by_name(font_entry));
|
||||
set_font(Gfx::FontDatabase::the().get_by_name(font_entry));
|
||||
|
||||
m_line_height = font().glyph_height() + m_line_spacing;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue