summaryrefslogtreecommitdiff
path: root/Userland/DevTools/Profiler/main.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-22 22:48:48 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-22 22:49:19 +0200
commit29e00cda2e961957a44712ff8e21fa03c5efae7e (patch)
tree1bd4e856e27260de67bcff0332dcbad6b400a0bc /Userland/DevTools/Profiler/main.cpp
parent863ac3af9787d4c269ac99f2287c29a257aa474a (diff)
downloadserenity-29e00cda2e961957a44712ff8e21fa03c5efae7e.zip
Profiler: Add a "Show Disassembly" action (and hide it by default)
Diffstat (limited to 'Userland/DevTools/Profiler/main.cpp')
-rw-r--r--Userland/DevTools/Profiler/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp
index ece4ba2320..6cf7f55beb 100644
--- a/Userland/DevTools/Profiler/main.cpp
+++ b/Userland/DevTools/Profiler/main.cpp
@@ -141,12 +141,17 @@ int main(int argc, char** argv)
tree_view.set_model(profile->model());
auto& disassembly_view = bottom_splitter.add<GUI::TableView>();
+ disassembly_view.set_visible(false);
tree_view.on_selection = [&](auto& index) {
profile->set_disassembly_index(index);
disassembly_view.set_model(profile->disassembly_model());
};
+ auto disassembly_action = GUI::Action::create_checkable("Show &Disassembly", { Mod_Ctrl, Key_D }, Gfx::Bitmap::load_from_file("/res/icons/16x16/x86.png"), [&](auto& action) {
+ disassembly_view.set_visible(action.is_checked());
+ });
+
auto& samples_tab = tab_widget.add_tab<GUI::Widget>("Samples");
samples_tab.set_layout<GUI::VerticalBoxLayout>();
samples_tab.layout()->set_margins({ 4, 4, 4, 4 });
@@ -209,6 +214,8 @@ int main(int argc, char** argv)
percent_action->set_checked(false);
view_menu.add_action(percent_action);
+ view_menu.add_action(disassembly_action);
+
auto& help_menu = menubar->add_menu("&Help");
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Profiler.md"), "/bin/Help");