mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:07:35 +00:00
Terminal: Make the settings window modal
This commit is contained in:
parent
bb27b212de
commit
f0482a4cab
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)
|
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_title("Terminal settings");
|
||||||
|
window->set_minimizable(false);
|
||||||
window->set_resizable(false);
|
window->set_resizable(false);
|
||||||
window->resize(200, 210);
|
window->resize(200, 210);
|
||||||
|
window->set_modal(true);
|
||||||
|
|
||||||
auto& settings = window->set_main_widget<GUI::Widget>();
|
auto& settings = window->set_main_widget<GUI::Widget>();
|
||||||
settings.load_from_gml(terminal_settings_window_gml);
|
settings.load_from_gml(terminal_settings_window_gml);
|
||||||
|
@ -397,6 +399,7 @@ int main(int argc, char** argv)
|
||||||
if (!settings_window) {
|
if (!settings_window) {
|
||||||
settings_window = create_settings_window(terminal);
|
settings_window = create_settings_window(terminal);
|
||||||
settings_window->on_close_request = [&] {
|
settings_window->on_close_request = [&] {
|
||||||
|
settings_window->remove_from_parent();
|
||||||
settings_window = nullptr;
|
settings_window = nullptr;
|
||||||
return GUI::Window::CloseRequestDecision::Close;
|
return GUI::Window::CloseRequestDecision::Close;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue