mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Scaling in PrintHostDialogs, FirmwareDialog, UpdateDialogs
This commit is contained in:
parent
051ca410f6
commit
14b4685ecb
5 changed files with 30 additions and 21 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "libslic3r/Utils.hpp"
|
||||
#include "avrdude/avrdude-slic3r.hpp"
|
||||
#include "GUI.hpp"
|
||||
#include "GUI_App.hpp"
|
||||
#include "I18N.hpp"
|
||||
#include "MsgDialog.hpp"
|
||||
#include "../Utils/HexFile.hpp"
|
||||
|
@ -36,7 +37,6 @@
|
|||
#include <wx/collpane.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/filefn.h>
|
||||
#include "GUI_App.hpp"
|
||||
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
@ -693,11 +693,16 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) :
|
|||
enum {
|
||||
DIALOG_MARGIN = 15,
|
||||
SPACING = 10,
|
||||
MIN_WIDTH = 600,
|
||||
MIN_HEIGHT = 200,
|
||||
MIN_HEIGHT_EXPANDED = 500,
|
||||
MIN_WIDTH = 50,
|
||||
MIN_HEIGHT = 18,
|
||||
MIN_HEIGHT_EXPANDED = 40,
|
||||
};
|
||||
|
||||
const int em = GUI::wxGetApp().em_unit();
|
||||
int min_width = MIN_WIDTH * em;
|
||||
int min_height = MIN_HEIGHT * em;
|
||||
int min_height_expanded = MIN_HEIGHT_EXPANDED * em;
|
||||
|
||||
wxFont status_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
status_font.MakeBold();
|
||||
wxFont mono_font(wxFontInfo().Family(wxFONTFAMILY_TELETYPE));
|
||||
|
@ -769,10 +774,10 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) :
|
|||
|
||||
auto *topsizer = new wxBoxSizer(wxVERTICAL);
|
||||
topsizer->Add(panel, 1, wxEXPAND | wxALL, DIALOG_MARGIN);
|
||||
SetMinSize(wxSize(MIN_WIDTH, MIN_HEIGHT));
|
||||
SetMinSize(wxSize(min_width, min_height));
|
||||
SetSizerAndFit(topsizer);
|
||||
const auto size = GetSize();
|
||||
SetSize(std::max(size.GetWidth(), static_cast<int>(MIN_WIDTH)), std::max(size.GetHeight(), static_cast<int>(MIN_HEIGHT)));
|
||||
SetSize(std::max(size.GetWidth(), static_cast<int>(min_width)), std::max(size.GetHeight(), static_cast<int>(min_height)));
|
||||
Layout();
|
||||
|
||||
SetEscapeId(wxID_CLOSE); // To close the dialog using "Esc" button
|
||||
|
@ -786,13 +791,13 @@ FirmwareDialog::FirmwareDialog(wxWindow *parent) :
|
|||
}
|
||||
});
|
||||
|
||||
p->spoiler->Bind(wxEVT_COLLAPSIBLEPANE_CHANGED, [this](wxCollapsiblePaneEvent &evt) {
|
||||
p->spoiler->Bind(wxEVT_COLLAPSIBLEPANE_CHANGED, [=](wxCollapsiblePaneEvent &evt) {
|
||||
if (evt.GetCollapsed()) {
|
||||
this->SetMinSize(wxSize(MIN_WIDTH, MIN_HEIGHT));
|
||||
this->SetMinSize(wxSize(min_width, min_height));
|
||||
const auto new_height = this->GetSize().GetHeight() - this->p->txt_stdout->GetSize().GetHeight();
|
||||
this->SetSize(this->GetSize().GetWidth(), new_height);
|
||||
} else {
|
||||
this->SetMinSize(wxSize(MIN_WIDTH, MIN_HEIGHT_EXPANDED));
|
||||
this->SetMinSize(wxSize(min_width, min_height_expanded));
|
||||
}
|
||||
|
||||
this->Layout();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue