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:
0GreenClover0 2023-08-02 03:40:51 +02:00 committed by Ali Mohammad Pur
parent 059857d26f
commit 259228d8d2
Notes: sideshowbarker 2024-07-17 05:23:40 +09:00
2 changed files with 1 additions and 1 deletions

View file

@ -66,6 +66,7 @@ HelpWindow::HelpWindow(GUI::Window* parent)
resize(530, 365);
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_window_mode(GUI::WindowMode::Modeless);
auto widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
widget->set_layout<GUI::VerticalBoxLayout>();

View file

@ -55,7 +55,6 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vector<NonnullR
auto docs = sheet_ptr->gather_documentation();
auto help_window = HelpWindow::the(window());
help_window->set_docs(move(docs));
help_window->set_window_mode(GUI::WindowMode::Modeless);
help_window->show();
}
};