mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Merge remote-tracking branch 'origin/master' into dev
This commit is contained in:
commit
af6ef2cb8a
83 changed files with 5953 additions and 3249 deletions
|
@ -131,7 +131,7 @@ public:
|
|||
|
||||
memDC.SetFont(m_action_font);
|
||||
memDC.SetTextForeground(wxColour(237, 107, 33));
|
||||
memDC.DrawText(text, int(m_scale * 60), int(m_scale * 275));
|
||||
memDC.DrawText(text, int(m_scale * 60), m_action_line_y_position);
|
||||
|
||||
memDC.SelectObject(wxNullBitmap);
|
||||
set_bitmap(bitmap);
|
||||
|
@ -206,14 +206,22 @@ public:
|
|||
|
||||
memDc.SetFont(m_constant_text.version_font);
|
||||
memDc.DrawLabel(m_constant_text.version, banner_rect, wxALIGN_TOP | wxALIGN_LEFT);
|
||||
int version_height = memDc.GetTextExtent(m_constant_text.version).GetY();
|
||||
|
||||
memDc.SetFont(m_constant_text.credits_font);
|
||||
memDc.DrawLabel(m_constant_text.credits, banner_rect, wxALIGN_BOTTOM | wxALIGN_LEFT);
|
||||
int credits_height = memDc.GetMultiLineTextExtent(m_constant_text.credits).GetY();
|
||||
int text_height = memDc.GetTextExtent("text").GetY();
|
||||
|
||||
// calculate position for the dynamic text
|
||||
int logo_and_header_height = margin + logo_size + title_height + version_height;
|
||||
m_action_line_y_position = logo_and_header_height + 0.5 * (bmp.GetHeight() - margin - credits_height - logo_and_header_height - text_height);
|
||||
}
|
||||
|
||||
private:
|
||||
wxBitmap m_main_bitmap;
|
||||
wxFont m_action_font;
|
||||
int m_action_line_y_position;
|
||||
float m_scale {1.0};
|
||||
|
||||
struct ConstantText
|
||||
|
@ -258,7 +266,8 @@ private:
|
|||
float title_font_scale = (float)text_banner_width / GetTextExtent(m_constant_text.title).GetX();
|
||||
scale_font(m_constant_text.title_font, title_font_scale > 3.5f ? 3.5f : title_font_scale);
|
||||
|
||||
scale_font(m_constant_text.version_font, 2.f);
|
||||
float version_font_scale = (float)text_banner_width / GetTextExtent(m_constant_text.version).GetX();
|
||||
scale_font(m_constant_text.version_font, version_font_scale > 2.f ? 2.f : version_font_scale);
|
||||
|
||||
// The width of the credits information string doesn't respect to the banner width some times.
|
||||
// So, scale credits_font in the respect to the longest string width
|
||||
|
@ -753,7 +762,7 @@ bool GUI_App::on_init_inner()
|
|||
|
||||
#ifdef __linux__
|
||||
if (! check_old_linux_datadir(GetAppName())) {
|
||||
std::cerr << "Quitting, user chose to move his data to new location." << std::endl;
|
||||
std::cerr << "Quitting, user chose to move their data to new location." << std::endl;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -1879,11 +1888,9 @@ bool GUI_App::OnExceptionInMainLoop()
|
|||
void GUI_App::OSXStoreOpenFiles(const wxArrayString &fileNames)
|
||||
{
|
||||
size_t num_gcodes = 0;
|
||||
for (const wxString &filename : fileNames) {
|
||||
wxString fn = filename.Upper();
|
||||
if (fn.EndsWith(".G") || fn.EndsWith(".GCODE"))
|
||||
for (const wxString &filename : fileNames)
|
||||
if (is_gcode_file(into_u8(filename)))
|
||||
++ num_gcodes;
|
||||
}
|
||||
if (fileNames.size() == num_gcodes) {
|
||||
// Opening PrusaSlicer by drag & dropping a G-Code onto PrusaSlicer icon in Finder,
|
||||
// just G-codes were passed. Switch to G-code viewer mode.
|
||||
|
@ -1903,8 +1910,7 @@ void GUI_App::MacOpenFiles(const wxArrayString &fileNames)
|
|||
std::vector<wxString> gcode_files;
|
||||
std::vector<wxString> non_gcode_files;
|
||||
for (const auto& filename : fileNames) {
|
||||
wxString fn = filename.Upper();
|
||||
if (fn.EndsWith(".G") || fn.EndsWith(".GCODE"))
|
||||
if (is_gcode_file(into_u8(filename)))
|
||||
gcode_files.emplace_back(filename);
|
||||
else {
|
||||
files.emplace_back(into_u8(filename));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue