diff --git a/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp b/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp index 56f9c44dc67..cb816cfa1f3 100644 --- a/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp +++ b/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -19,7 +20,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window) { set_title("Create new image"); set_icon(parent_window->icon()); - resize(200, 200); + resize(200, 220); auto& main_widget = set_main_widget(); main_widget.set_fill_with_background_color(true); @@ -47,11 +48,20 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window) auto& height_spinbox = main_widget.add(); + auto& set_defaults_checkbox = main_widget.add(); + set_defaults_checkbox.set_text("Use these settings as default"); + auto& button_container = main_widget.add(); button_container.set_layout(); auto& ok_button = button_container.add("OK"); - ok_button.on_click = [this](auto) { + ok_button.on_click = [&](auto) { + if (set_defaults_checkbox.is_checked()) { + Config::write_string("PixelPaint"sv, "NewImage"sv, "Name"sv, m_image_name); + Config::write_i32("PixelPaint"sv, "NewImage"sv, "Width"sv, m_image_size.width()); + Config::write_i32("PixelPaint"sv, "NewImage"sv, "Height"sv, m_image_size.height()); + } + done(ExecResult::OK); }; ok_button.set_default(true);