mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:37:35 +00:00
LibGUI: Make GMenu inherit from CObject
This is primarily to make it possible to pass a GMenu* where a CObject* is expected.
This commit is contained in:
parent
e9dda8d592
commit
fd5eb79d19
39 changed files with 88 additions and 86 deletions
|
@ -28,7 +28,7 @@ VBForm::VBForm(const String& name, GWidget* parent)
|
|||
set_background_color(Color::WarmGray);
|
||||
set_greedy_for_hits(true);
|
||||
|
||||
m_context_menu = make<GMenu>();
|
||||
m_context_menu = GMenu::construct();
|
||||
m_context_menu->add_action(GCommonActions::make_move_to_front_action([this](auto&) {
|
||||
if (auto* widget = single_selected_widget())
|
||||
widget->gwidget()->move_to_front();
|
||||
|
|
|
@ -61,5 +61,5 @@ private:
|
|||
Point m_next_insertion_position;
|
||||
Direction m_resize_direction { Direction::None };
|
||||
Direction m_mouse_direction_type { Direction::None };
|
||||
OwnPtr<GMenu> m_context_menu;
|
||||
RefPtr<GMenu> m_context_menu;
|
||||
};
|
||||
|
|
|
@ -31,14 +31,14 @@ int main(int argc, char** argv)
|
|||
};
|
||||
|
||||
auto menubar = make<GMenuBar>();
|
||||
auto app_menu = make<GMenu>("Visual Builder");
|
||||
auto app_menu = GMenu::construct("Visual Builder");
|
||||
app_menu->add_action(GCommonActions::make_quit_action([](auto&) {
|
||||
GApplication::the().quit(0);
|
||||
return;
|
||||
}));
|
||||
menubar->add_menu(move(app_menu));
|
||||
|
||||
auto file_menu = make<GMenu>("File");
|
||||
auto file_menu = GMenu::construct("File");
|
||||
file_menu->add_action(GAction::create("Dump Form", [&](auto&) {
|
||||
form1->dump();
|
||||
}));
|
||||
|
@ -54,7 +54,7 @@ int main(int argc, char** argv)
|
|||
|
||||
window->show();
|
||||
|
||||
auto help_menu = make<GMenu>("Help");
|
||||
auto help_menu = GMenu::construct("Help");
|
||||
help_menu->add_action(GAction::create("About", [&](const GAction&) {
|
||||
GAboutDialog::show("Visual Builder", load_png("/res/icons/32x32/app-visual-builder.png"), window);
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue