1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:05:07 +00:00

ProfileViewer: Add mode that shows percentages instead of sample counts

Sometimes it's much nicer to work with percentages than raw sample
counts when browsing through a profile. :^)
This commit is contained in:
Andreas Kling 2020-03-02 21:56:03 +01:00
parent 8effe0b632
commit 058cd1241e
4 changed files with 37 additions and 4 deletions

View file

@ -84,6 +84,15 @@ int main(int argc, char** argv)
invert_action->set_checked(false);
view_menu->add_action(invert_action);
auto percent_action = GUI::Action::create("Show percentages", { Mod_Ctrl, Key_P }, [&](auto& action) {
action.set_checked(!action.is_checked());
profile->set_show_percentages(action.is_checked());
tree_view->update();
});
percent_action->set_checkable(true);
percent_action->set_checked(false);
view_menu->add_action(percent_action);
menubar->add_menu(move(view_menu));
app.set_menubar(move(menubar));