Terminal: Make the settings window modal
This commit is contained in:
parent
bb27b212de
commit
f0482a4cab
Notes:
sideshowbarker
2024-07-19 00:17:41 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f0482a4cabb
1 changed files with 4 additions and 1 deletions
|
@ -178,10 +178,12 @@ static pid_t run_command(int ptm_fd, String command)
|
|||
|
||||
static RefPtr<GUI::Window> create_settings_window(TerminalWidget& terminal)
|
||||
{
|
||||
auto window = GUI::Window::construct();
|
||||
auto window = GUI::Window::construct(terminal.window());
|
||||
window->set_title("Terminal settings");
|
||||
window->set_minimizable(false);
|
||||
window->set_resizable(false);
|
||||
window->resize(200, 210);
|
||||
window->set_modal(true);
|
||||
|
||||
auto& settings = window->set_main_widget<GUI::Widget>();
|
||||
settings.load_from_gml(terminal_settings_window_gml);
|
||||
|
@ -397,6 +399,7 @@ int main(int argc, char** argv)
|
|||
if (!settings_window) {
|
||||
settings_window = create_settings_window(terminal);
|
||||
settings_window->on_close_request = [&] {
|
||||
settings_window->remove_from_parent();
|
||||
settings_window = nullptr;
|
||||
return GUI::Window::CloseRequestDecision::Close;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue