mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
CrashReporter: Don't crash when "Generating..." Window gets closed
This commit is contained in:
parent
1bc945860d
commit
fc2ed732df
Notes:
sideshowbarker
2024-07-18 03:09:08 +09:00
Author: https://github.com/sw1tchbl4d3r Commit: https://github.com/SerenityOS/serenity/commit/fc2ed732df3 Pull-request: https://github.com/SerenityOS/serenity/pull/10330 Issue: https://github.com/SerenityOS/serenity/issues/10264 Reviewed-by: https://github.com/BenWiederhake Reviewed-by: https://github.com/awesomekling
|
@ -41,19 +41,29 @@ struct TitleAndText {
|
|||
static NonnullRefPtr<GUI::Window> create_progress_window()
|
||||
{
|
||||
auto window = GUI::Window::construct();
|
||||
|
||||
window->set_title("CrashReporter");
|
||||
window->set_resizable(false);
|
||||
window->resize(240, 64);
|
||||
window->center_on_screen();
|
||||
|
||||
auto& main_widget = window->set_main_widget<GUI::Widget>();
|
||||
main_widget.set_fill_with_background_color(true);
|
||||
main_widget.set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto& label = main_widget.add<GUI::Label>("Generating crash report...");
|
||||
label.set_fixed_height(30);
|
||||
|
||||
auto& progressbar = main_widget.add<GUI::Progressbar>();
|
||||
progressbar.set_name("progressbar");
|
||||
progressbar.set_fixed_width(150);
|
||||
progressbar.set_fixed_height(22);
|
||||
|
||||
window->on_close = [&]() {
|
||||
if (progressbar.value() != progressbar.max())
|
||||
exit(0);
|
||||
};
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue