summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-12-09 21:05:28 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-12-09 21:05:44 +0100
commitfd5eb79d1959cbd4b43f624e3e0779e5dd5e0f17 (patch)
tree5898af512fb7afcdf185cf3dcec6ad449836022f /DevTools
parente9dda8d59261d021d046074f39bc2c0a140a723a (diff)
downloadserenity-fd5eb79d1959cbd4b43f624e3e0779e5dd5e0f17.zip
LibGUI: Make GMenu inherit from CObject
This is primarily to make it possible to pass a GMenu* where a CObject* is expected.
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/HackStudio/main.cpp12
-rw-r--r--DevTools/VisualBuilder/VBForm.cpp2
-rw-r--r--DevTools/VisualBuilder/VBForm.h2
-rw-r--r--DevTools/VisualBuilder/main.cpp6
4 files changed, 11 insertions, 11 deletions
diff --git a/DevTools/HackStudio/main.cpp b/DevTools/HackStudio/main.cpp
index eb5ff776e3..69fe4fa327 100644
--- a/DevTools/HackStudio/main.cpp
+++ b/DevTools/HackStudio/main.cpp
@@ -348,19 +348,19 @@ int main(int argc, char** argv)
});
auto menubar = make<GMenuBar>();
- auto app_menu = make<GMenu>("HackStudio");
+ auto app_menu = GMenu::construct("HackStudio");
app_menu->add_action(save_action);
app_menu->add_action(GCommonActions::make_quit_action([&](auto&) {
app.quit();
}));
menubar->add_menu(move(app_menu));
- auto project_menu = make<GMenu>("Project");
+ auto project_menu = GMenu::construct("Project");
project_menu->add_action(new_action);
project_menu->add_action(add_existing_file_action);
menubar->add_menu(move(project_menu));
- auto edit_menu = make<GMenu>("Edit");
+ auto edit_menu = GMenu::construct("Edit");
edit_menu->add_action(GAction::create("Find in files...", { Mod_Ctrl | Mod_Shift, Key_F }, [&](auto&) {
reveal_action_tab(find_in_files_widget);
find_in_files_widget->focus_textbox_and_select_all();
@@ -391,13 +391,13 @@ int main(int argc, char** argv)
toolbar->add_action(run_action);
toolbar->add_action(stop_action);
- auto build_menu = make<GMenu>("Build");
+ auto build_menu = GMenu::construct("Build");
build_menu->add_action(build_action);
build_menu->add_action(run_action);
build_menu->add_action(stop_action);
menubar->add_menu(move(build_menu));
- auto view_menu = make<GMenu>("View");
+ auto view_menu = GMenu::construct("View");
view_menu->add_action(hide_action_tabs_action);
view_menu->add_action(open_locator_action);
view_menu->add_separator();
@@ -407,7 +407,7 @@ int main(int argc, char** argv)
auto small_icon = GraphicsBitmap::load_from_file("/res/icons/16x16/app-hack-studio.png");
- auto help_menu = make<GMenu>("Help");
+ auto help_menu = GMenu::construct("Help");
help_menu->add_action(GAction::create("About", [&](auto&) {
GAboutDialog::show("HackStudio", small_icon, g_window);
}));
diff --git a/DevTools/VisualBuilder/VBForm.cpp b/DevTools/VisualBuilder/VBForm.cpp
index cd0aad11de..11a716fe05 100644
--- a/DevTools/VisualBuilder/VBForm.cpp
+++ b/DevTools/VisualBuilder/VBForm.cpp
@@ -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();
diff --git a/DevTools/VisualBuilder/VBForm.h b/DevTools/VisualBuilder/VBForm.h
index a2c0a27f90..384b7509e8 100644
--- a/DevTools/VisualBuilder/VBForm.h
+++ b/DevTools/VisualBuilder/VBForm.h
@@ -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;
};
diff --git a/DevTools/VisualBuilder/main.cpp b/DevTools/VisualBuilder/main.cpp
index 3d96db1e51..6647bae6fd 100644
--- a/DevTools/VisualBuilder/main.cpp
+++ b/DevTools/VisualBuilder/main.cpp
@@ -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);
}));