mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:37:45 +00:00
LibGUI: Move Icon and FontDatabase into the GUI namespace
We also clean up some old references to the old G prefixed GUI classes This also fixes a potential bug with using: C_OBJECT_ABSTRACT(GAbstractButton) instead of C_OBJECT_ABSTRACT(AbstractButton)
This commit is contained in:
parent
57f1c919df
commit
6a3b12664a
24 changed files with 120 additions and 104 deletions
|
@ -144,8 +144,8 @@ DirectoryView::DirectoryView()
|
|||
};
|
||||
|
||||
// NOTE: We're using the on_update hook on the GSortingProxyModel here instead of
|
||||
// the GFileSystemModel's hook. This is because GSortingProxyModel has already
|
||||
// installed an on_update hook on the GFileSystemModel internally.
|
||||
// the GUI::FileSystemModel's hook. This is because GSortingProxyModel has already
|
||||
// installed an on_update hook on the GUI::FileSystemModel internally.
|
||||
// FIXME: This is an unfortunate design. We should come up with something better.
|
||||
m_table_view->model()->on_update = [this] {
|
||||
for_each_view_implementation([](auto& view) {
|
||||
|
|
|
@ -79,7 +79,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
|
|||
m_name_box->set_text(m_name);
|
||||
m_name_box->on_change = [&, disable_rename]() {
|
||||
if (disable_rename) {
|
||||
m_name_box->set_text(m_name); //FIXME: GTextBox does not support set_enabled yet...
|
||||
m_name_box->set_text(m_name); //FIXME: GUI::TextBox does not support set_enabled yet...
|
||||
} else {
|
||||
m_name_dirty = m_name != m_name_box->text();
|
||||
m_apply_button->set_enabled(true);
|
||||
|
|
|
@ -52,6 +52,6 @@ public:
|
|||
private:
|
||||
ManualModel();
|
||||
|
||||
GIcon m_section_icon;
|
||||
GIcon m_page_icon;
|
||||
GUI::Icon m_section_icon;
|
||||
GUI::Icon m_page_icon;
|
||||
};
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
HexEditor::HexEditor()
|
||||
{
|
||||
set_scrollbars_enabled(true);
|
||||
set_font(GFontDatabase::the().get_by_name("Csilla Thin"));
|
||||
set_font(GUI::FontDatabase::the().get_by_name("Csilla Thin"));
|
||||
set_background_role(ColorRole::Base);
|
||||
set_foreground_role(ColorRole::BaseText);
|
||||
vertical_scrollbar().set_step(line_height());
|
||||
|
|
|
@ -281,11 +281,11 @@ int main(int argc, char** argv)
|
|||
GUI::ActionGroup font_action_group;
|
||||
font_action_group.set_exclusive(true);
|
||||
auto font_menu = GUI::Menu::construct("Font");
|
||||
GFontDatabase::the().for_each_fixed_width_font([&](const StringView& font_name) {
|
||||
GUI::FontDatabase::the().for_each_fixed_width_font([&](const StringView& font_name) {
|
||||
auto action = GUI::Action::create(font_name, [&](GUI::Action& action) {
|
||||
action.set_checked(true);
|
||||
terminal.set_font(GFontDatabase::the().get_by_name(action.text()));
|
||||
auto metadata = GFontDatabase::the().get_metadata_by_name(action.text());
|
||||
terminal.set_font(GUI::FontDatabase::the().get_by_name(action.text()));
|
||||
auto metadata = GUI::FontDatabase::the().get_metadata_by_name(action.text());
|
||||
ASSERT(metadata.has_value());
|
||||
config->write_entry("Text", "Font", metadata.value().path);
|
||||
config->sync();
|
||||
|
|
|
@ -370,9 +370,9 @@ TextEditorWidget::TextEditorWidget()
|
|||
menubar->add_menu(move(edit_menu));
|
||||
|
||||
auto font_menu = GUI::Menu::construct("Font");
|
||||
GFontDatabase::the().for_each_fixed_width_font([&](const StringView& font_name) {
|
||||
GUI::FontDatabase::the().for_each_fixed_width_font([&](const StringView& font_name) {
|
||||
font_menu->add_action(GUI::Action::create(font_name, [this](const GUI::Action& action) {
|
||||
m_editor->set_font(GFontDatabase::the().get_by_name(action.text()));
|
||||
m_editor->set_font(GUI::FontDatabase::the().get_by_name(action.text()));
|
||||
m_editor->update();
|
||||
}));
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue