mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03: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
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());
|
tree_view.set_model(profile->model());
|
||||||
|
|
||||||
auto& disassembly_view = bottom_splitter.add<GUI::TableView>();
|
auto& disassembly_view = bottom_splitter.add<GUI::TableView>();
|
||||||
|
disassembly_view.set_visible(false);
|
||||||
|
|
||||||
tree_view.on_selection = [&](auto& index) {
|
tree_view.on_selection = [&](auto& index) {
|
||||||
profile->set_disassembly_index(index);
|
profile->set_disassembly_index(index);
|
||||||
disassembly_view.set_model(profile->disassembly_model());
|
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");
|
auto& samples_tab = tab_widget.add_tab<GUI::Widget>("Samples");
|
||||||
samples_tab.set_layout<GUI::VerticalBoxLayout>();
|
samples_tab.set_layout<GUI::VerticalBoxLayout>();
|
||||||
samples_tab.layout()->set_margins({ 4, 4, 4, 4 });
|
samples_tab.layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
@ -209,6 +214,8 @@ int main(int argc, char** argv)
|
|||||||
percent_action->set_checked(false);
|
percent_action->set_checked(false);
|
||||||
view_menu.add_action(percent_action);
|
view_menu.add_action(percent_action);
|
||||||
|
|
||||||
|
view_menu.add_action(disassembly_action);
|
||||||
|
|
||||||
auto& help_menu = menubar->add_menu("&Help");
|
auto& help_menu = menubar->add_menu("&Help");
|
||||||
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
|
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");
|
Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Profiler.md"), "/bin/Help");
|
||||||
|
Loading…
Reference in New Issue
Block a user