mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Terminal: Save settings to config file
When exiting the terminal settings window, the opacity, bell and maximum history size will be saved to the application config file. Because the color scheme is neither configurable nor will it be loaded on startup, it will not get saved for now.
This commit is contained in:
parent
2fec891d8e
commit
7d22713a72
Notes:
sideshowbarker
2024-07-18 07:17:06 +09:00
Author: https://github.com/hstde 🔰 Commit: https://github.com/SerenityOS/serenity/commit/7d22713a72d Pull-request: https://github.com/SerenityOS/serenity/pull/9276
1 changed files with 17 additions and 0 deletions
|
@ -357,6 +357,23 @@ int main(int argc, char** argv)
|
|||
settings_window = create_settings_window(terminal);
|
||||
settings_window->show();
|
||||
settings_window->move_to_front();
|
||||
settings_window->on_close = [&]() {
|
||||
config->write_num_entry("Window", "Opacity", terminal.opacity());
|
||||
config->write_num_entry("Terminal", "MaxHistorySize", terminal.max_history_size());
|
||||
|
||||
auto bell = terminal.bell_mode();
|
||||
auto bell_setting = String::empty();
|
||||
if (bell == VT::TerminalWidget::BellMode::AudibleBeep) {
|
||||
bell_setting = "AudibleBeep";
|
||||
} else if (bell == VT::TerminalWidget::BellMode::Disabled) {
|
||||
bell_setting = "Disabled";
|
||||
} else {
|
||||
bell_setting = "Visible";
|
||||
}
|
||||
config->write_entry("Window", "Bell", bell_setting);
|
||||
|
||||
config->sync();
|
||||
};
|
||||
});
|
||||
|
||||
terminal.context_menu().add_separator();
|
||||
|
|
Loading…
Reference in a new issue