ENH:adjust he maximum height of the message pop-up window
jira: none Change-Id: I6a2c23b15e4ef811b4a0a71aa3a8b3f6da9e3604
This commit is contained in:
parent
40dca9b7ea
commit
108a65a92c
|
@ -20,7 +20,7 @@
|
||||||
#include "wxExtensions.hpp"
|
#include "wxExtensions.hpp"
|
||||||
#include "slic3r/GUI/MainFrame.hpp"
|
#include "slic3r/GUI/MainFrame.hpp"
|
||||||
#include "GUI_App.hpp"
|
#include "GUI_App.hpp"
|
||||||
#define MSG_DLG_MAX_SIZE wxSize(-1, FromDIP(200))//notice:ban setting the maximum width value
|
#define MSG_DLG_MAX_SIZE wxSize(-1, FromDIP(464))//notice:ban setting the maximum width value
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
|
@ -58,9 +58,9 @@ MsgDialog::MsgDialog(wxWindow *parent, const wxString &title, const wxString &he
|
||||||
|
|
||||||
m_dsa_sizer = new wxBoxSizer(wxHORIZONTAL);
|
m_dsa_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
btn_sizer->Add(0, 0, 0, wxLEFT, FromDIP(120));
|
btn_sizer->Add(0, 0, 0, wxLEFT, FromDIP(120));
|
||||||
btn_sizer->Add(m_dsa_sizer, 0, wxEXPAND,0);
|
btn_sizer->AddStretchSpacer();
|
||||||
btn_sizer->Add(0, 0, 1, wxEXPAND, 5);
|
btn_sizer->Add(m_dsa_sizer, 0, wxEXPAND);
|
||||||
main_sizer->Add(btn_sizer, 0, wxBOTTOM | wxRIGHT | wxEXPAND, BORDER);
|
main_sizer->Add(btn_sizer, 0, wxBOTTOM | wxRIGHT | wxEXPAND | wxTOP, FromDIP(10));
|
||||||
|
|
||||||
apply_style(style);
|
apply_style(style);
|
||||||
SetSizerAndFit(main_sizer);
|
SetSizerAndFit(main_sizer);
|
||||||
|
@ -322,8 +322,6 @@ static void add_msg_content(wxWindow *parent,
|
||||||
wxScrolledWindow *scrolledWindow = new wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
|
wxScrolledWindow *scrolledWindow = new wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
|
||||||
scrolledWindow->SetBackgroundColour(*wxWHITE);
|
scrolledWindow->SetBackgroundColour(*wxWHITE);
|
||||||
scrolledWindow->SetScrollRate(0, 20);
|
scrolledWindow->SetScrollRate(0, 20);
|
||||||
scrolledWindow->SetMinSize(wxSize(info_width, -1));
|
|
||||||
scrolledWindow->SetMaxSize(wxSize(info_width, -1));
|
|
||||||
scrolledWindow->EnableScrolling(false, true);
|
scrolledWindow->EnableScrolling(false, true);
|
||||||
wxBoxSizer *sizer_scrolled = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *sizer_scrolled = new wxBoxSizer(wxHORIZONTAL);
|
||||||
Label *wrapped_text = new Label(scrolledWindow, font, msg, LB_AUTO_WRAP, wxSize(info_width, -1));
|
Label *wrapped_text = new Label(scrolledWindow, font, msg, LB_AUTO_WRAP, wxSize(info_width, -1));
|
||||||
|
@ -334,6 +332,12 @@ static void add_msg_content(wxWindow *parent,
|
||||||
sizer_scrolled->AddSpacer(5);
|
sizer_scrolled->AddSpacer(5);
|
||||||
sizer_scrolled->AddStretchSpacer();
|
sizer_scrolled->AddStretchSpacer();
|
||||||
scrolledWindow->SetSizer(sizer_scrolled);
|
scrolledWindow->SetSizer(sizer_scrolled);
|
||||||
|
auto info_height = 48 * em;
|
||||||
|
if (sizer_scrolled->GetMinSize().GetHeight() < info_height) {
|
||||||
|
info_height = sizer_scrolled->GetMinSize().GetHeight();
|
||||||
|
}
|
||||||
|
scrolledWindow->SetMinSize(wxSize(info_width, info_height));
|
||||||
|
scrolledWindow->SetMaxSize(wxSize(info_width, info_height));
|
||||||
scrolledWindow->FitInside();
|
scrolledWindow->FitInside();
|
||||||
content_sizer->Add(scrolledWindow, 1, wxEXPAND | wxRIGHT, 8);
|
content_sizer->Add(scrolledWindow, 1, wxEXPAND | wxRIGHT, 8);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue