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

Terminal: Audible vs Visible beep option

This commit is contained in:
Christopher Dumas 2019-05-31 12:43:58 -07:00 committed by Andreas Kling
parent 9ac95d1867
commit f8a02d4733
7 changed files with 5995 additions and 9 deletions

View file

@ -106,6 +106,7 @@ int main(int argc, char** argv)
terminal.apply_size_increments_to_window(*window);
window->show();
window->set_icon_path("/res/icons/16x16/app-terminal.png");
terminal.set_should_beep(config->read_num_entry("Window", "AudibleBeep", 1) == 1);
auto* opacity_adjustment_window = new GWindow;
opacity_adjustment_window->set_title("Adjust opacity");
@ -124,6 +125,23 @@ int main(int argc, char** argv)
slider->set_range(0, 100);
slider->set_value(100);
auto* beep_choice_window = new GWindow;
beep_choice_window->set_title("Terminal beep settings");
beep_choice_window->set_rect(50, 50, 200, 100);
auto* radio_buttons = new GWidget;
beep_choice_window->set_main_widget(radio_buttons);
radio_buttons->set_fill_with_background_color(true);
radio_buttons->set_layout(make<GBoxLayout>(Orientation::Vertical));
radio_buttons->layout()->set_margins({ 4, 4, 4, 4 });
auto* sysbell_radio = new GRadioButton("Use (Audible) System Bell", radio_buttons);
auto* visbell_radio = new GRadioButton("Use (Visual) Terminal Bell", radio_buttons);
sysbell_radio->set_checked(terminal.should_beep());
sysbell_radio->on_checked = [&terminal] (const bool res) {
terminal.set_should_beep(res);
};
auto new_opacity = config->read_num_entry("Window", "Opacity", 255);
terminal.set_opacity((float)new_opacity / 255.0);
@ -131,8 +149,11 @@ int main(int argc, char** argv)
auto app_menu = make<GMenu>("Terminal");
app_menu->add_action(GAction::create("Adjust opacity...", [opacity_adjustment_window] (const GAction&) {
opacity_adjustment_window->show();
}));
opacity_adjustment_window->show();
}));
app_menu->add_action(GAction::create("Change audio output...", [beep_choice_window] (const GAction&) {
beep_choice_window->show();
}));
app_menu->add_action(GAction::create("Quit", { Mod_Alt, Key_F4 }, [] (const GAction&) {
dbgprintf("Terminal: Quit menu activated!\n");
GApplication::the().quit(0);