mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:35:07 +00:00
HackStudio: Add a Stop action to kill the current process
Also give the Run action a different icon that has the same style as the stop icon that's now alongside it. Closes https://github.com/SerenityOS/serenity/issues/771
This commit is contained in:
parent
1f5001c581
commit
c6a8b95643
1 changed files with 14 additions and 1 deletions
|
@ -367,21 +367,34 @@ int main(int argc, char** argv)
|
|||
}));
|
||||
menubar->add_menu(move(edit_menu));
|
||||
|
||||
auto stop_action = GAction::create("Stop", GraphicsBitmap::load_from_file("/res/icons/16x16/stop.png"), [&](auto&) {
|
||||
terminal_wrapper->kill_running_command();
|
||||
});
|
||||
|
||||
stop_action->set_enabled(false);
|
||||
terminal_wrapper->on_command_exit = [&] {
|
||||
stop_action->set_enabled(false);
|
||||
};
|
||||
|
||||
auto build_action = GAction::create("Build", { Mod_Ctrl, Key_B }, GraphicsBitmap::load_from_file("/res/icons/16x16/build.png"), [&](auto&) {
|
||||
reveal_action_tab(terminal_wrapper);
|
||||
build(terminal_wrapper);
|
||||
stop_action->set_enabled(true);
|
||||
});
|
||||
toolbar->add_action(build_action);
|
||||
|
||||
auto run_action = GAction::create("Run", { Mod_Ctrl, Key_R }, GraphicsBitmap::load_from_file("/res/icons/16x16/run.png"), [&](auto&) {
|
||||
auto run_action = GAction::create("Run", { Mod_Ctrl, Key_R }, GraphicsBitmap::load_from_file("/res/icons/16x16/play.png"), [&](auto&) {
|
||||
reveal_action_tab(terminal_wrapper);
|
||||
run(terminal_wrapper);
|
||||
stop_action->set_enabled(true);
|
||||
});
|
||||
toolbar->add_action(run_action);
|
||||
toolbar->add_action(stop_action);
|
||||
|
||||
auto build_menu = make<GMenu>("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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue