mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:37:36 +00:00
Spreadsheet: Set Help window mode to Modeless in the constructor
And don't try to do it every time the Help button is clicked. This fixes a crash when clicking the Help button twice (setting window mode on an already visible window is not supported). This also fixes a situation where when opening the Help window with an action, we didn't set its mode to "Modeless".
This commit is contained in:
parent
059857d26f
commit
259228d8d2
2 changed files with 1 additions and 1 deletions
|
@ -66,6 +66,7 @@ HelpWindow::HelpWindow(GUI::Window* parent)
|
||||||
resize(530, 365);
|
resize(530, 365);
|
||||||
set_title("Spreadsheet Functions Help");
|
set_title("Spreadsheet Functions Help");
|
||||||
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors());
|
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors());
|
||||||
|
set_window_mode(GUI::WindowMode::Modeless);
|
||||||
|
|
||||||
auto widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
|
auto widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
|
||||||
widget->set_layout<GUI::VerticalBoxLayout>();
|
widget->set_layout<GUI::VerticalBoxLayout>();
|
||||||
|
|
|
@ -55,7 +55,6 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vector<NonnullR
|
||||||
auto docs = sheet_ptr->gather_documentation();
|
auto docs = sheet_ptr->gather_documentation();
|
||||||
auto help_window = HelpWindow::the(window());
|
auto help_window = HelpWindow::the(window());
|
||||||
help_window->set_docs(move(docs));
|
help_window->set_docs(move(docs));
|
||||||
help_window->set_window_mode(GUI::WindowMode::Modeless);
|
|
||||||
help_window->show();
|
help_window->show();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue