mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
LibGUI: Convert custom widgets and subclasses to ObjectPtr
This commit is contained in:
parent
15a66dc8ab
commit
defafd72bc
30 changed files with 57 additions and 47 deletions
|
@ -162,7 +162,7 @@ int main(int argc, char** argv)
|
|||
window->set_double_buffering_enabled(false);
|
||||
|
||||
RefPtr<CConfigFile> config = CConfigFile::get_for_app("Terminal");
|
||||
auto* terminal = new TerminalWidget(ptm_fd, config);
|
||||
auto terminal = TerminalWidget::construct(ptm_fd, config);
|
||||
window->set_main_widget(terminal);
|
||||
window->move_to(300, 300);
|
||||
terminal->apply_size_increments_to_window(*window);
|
||||
|
@ -200,7 +200,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto font_menu = make<GMenu>("Font");
|
||||
GFontDatabase::the().for_each_fixed_width_font([&](const StringView& font_name) {
|
||||
font_menu->add_action(GAction::create(font_name, [terminal, &config](const GAction& action) {
|
||||
font_menu->add_action(GAction::create(font_name, [&](const GAction& action) {
|
||||
terminal->set_font(GFontDatabase::the().get_by_name(action.text()));
|
||||
auto metadata = GFontDatabase::the().get_metadata_by_name(action.text());
|
||||
ASSERT(metadata.has_value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue