mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Profiler: Add a "Show Disassembly" action (and hide it by default)
This commit is contained in:
parent
863ac3af97
commit
29e00cda2e
Notes:
sideshowbarker
2024-07-18 17:31:51 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/29e00cda2e9
2 changed files with 7 additions and 0 deletions
BIN
Base/res/icons/16x16/x86.png
Normal file
BIN
Base/res/icons/16x16/x86.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 194 B |
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue