mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
ENH:adjust he maximum height of the message pop-up window
jira: none Change-Id: I6a2c23b15e4ef811b4a0a71aa3a8b3f6da9e3604 (cherry picked from commit 108a65a92cd72e1bbb4e61a2d248331e356bd35d)
This commit is contained in:
@@ -21,7 +21,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 {
|
||||||
|
|
||||||
@@ -59,9 +59,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);
|
||||||
@@ -301,8 +301,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));
|
||||||
@@ -313,6 +311,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;
|
||||||
|
|||||||
Reference in New Issue
Block a user