From b8065d1e496158895352f9fc54dc5ae2419ce6a3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 22 Apr 2021 21:49:17 +0200 Subject: [PATCH] Allow resizing of nag dialog; may help with #1978. --- src/wx/nag_dialog.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/wx/nag_dialog.cc b/src/wx/nag_dialog.cc index 85f2d0110..417b5f94c 100644 --- a/src/wx/nag_dialog.cc +++ b/src/wx/nag_dialog.cc @@ -29,14 +29,14 @@ using namespace boost::placeholders; #endif NagDialog::NagDialog (wxWindow* parent, Config::Nag nag, wxString message, bool can_cancel) - : wxDialog (parent, wxID_ANY, _("Important notice")) + : wxDialog (parent, wxID_ANY, _("Important notice"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) , _nag (nag) { - wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); + auto sizer = new wxBoxSizer (wxVERTICAL); _text = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize (400, 300)); sizer->Add (_text, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); - wxCheckBox* b = new CheckBox (this, _("Don't show this message again")); + auto b = new CheckBox (this, _("Don't show this message again")); sizer->Add (b, 0, wxALL, 6); b->Bind (wxEVT_CHECKBOX, bind (&NagDialog::shut_up, this, _1)); @@ -54,6 +54,11 @@ NagDialog::NagDialog (wxWindow* parent, Config::Nag nag, wxString message, bool sizer->SetSizeHints (this); _text->SetLabelMarkup (message); + + Bind (wxEVT_SIZE, [this](wxSizeEvent& ev) { + Layout(); + ev.Skip(); + }); } void -- 2.30.2