mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-26 18:21:18 -06:00
Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer
This commit is contained in:
commit
93c6915e9d
9 changed files with 90 additions and 40 deletions
|
|
@ -9,11 +9,6 @@
|
|||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
enum {
|
||||
DLG_WIDTH = 90,
|
||||
DLG_HEIGHT = 60
|
||||
};
|
||||
|
||||
KBShortcutsDialog::KBShortcutsDialog()
|
||||
: DPIDialog(NULL, wxID_ANY, wxString(SLIC3R_APP_NAME) + " - " + _(L("Keyboard Shortcuts")),
|
||||
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
|
|
@ -39,9 +34,7 @@ KBShortcutsDialog::KBShortcutsDialog()
|
|||
|
||||
fill_shortcuts();
|
||||
|
||||
const int em = em_unit();
|
||||
const wxSize& size = wxSize(DLG_WIDTH * em, DLG_HEIGHT * em);
|
||||
panel = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, size);
|
||||
panel = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, get_size());
|
||||
panel->SetScrollbars(1, 20, 1, 2);
|
||||
|
||||
auto main_grid_sizer = new wxFlexGridSizer(2, 10, 10);
|
||||
|
|
@ -216,7 +209,7 @@ void KBShortcutsDialog::on_dpi_changed(const wxRect &suggested_rect)
|
|||
|
||||
msw_buttons_rescale(this, em, { wxID_OK });
|
||||
|
||||
const wxSize& size = wxSize(DLG_WIDTH * em, DLG_HEIGHT * em);
|
||||
wxSize size = get_size();
|
||||
|
||||
panel->SetMinSize(size);
|
||||
|
||||
|
|
@ -231,5 +224,30 @@ void KBShortcutsDialog::onCloseDialog(wxEvent &)
|
|||
this->EndModal(wxID_CLOSE);
|
||||
}
|
||||
|
||||
wxSize KBShortcutsDialog::get_size()
|
||||
{
|
||||
wxTopLevelWindow* window = Slic3r::GUI::find_toplevel_parent(this);
|
||||
const int display_idx = wxDisplay::GetFromWindow(window);
|
||||
wxRect display;
|
||||
if (display_idx == wxNOT_FOUND) {
|
||||
display = wxDisplay(0u).GetClientArea();
|
||||
window->Move(display.GetTopLeft());
|
||||
}
|
||||
else {
|
||||
display = wxDisplay(display_idx).GetClientArea();
|
||||
}
|
||||
|
||||
const int em = em_unit();
|
||||
wxSize dialog_size = wxSize(90 * em, 85 * em);
|
||||
|
||||
const int margin = 10 * em;
|
||||
if (dialog_size.x > display.GetWidth())
|
||||
dialog_size.x = display.GetWidth() - margin;
|
||||
if (dialog_size.y > display.GetHeight())
|
||||
dialog_size.y = display.GetHeight() - margin;
|
||||
|
||||
return dialog_size;
|
||||
}
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ protected:
|
|||
|
||||
private:
|
||||
void onCloseDialog(wxEvent &);
|
||||
wxSize get_size();
|
||||
};
|
||||
|
||||
} // namespace GUI
|
||||
|
|
|
|||
|
|
@ -2215,7 +2215,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||
DynamicPrintConfig config;
|
||||
{
|
||||
DynamicPrintConfig config_loaded;
|
||||
model = Slic3r::Model::read_from_archive(path.string(), &config_loaded, false);
|
||||
model = Slic3r::Model::read_from_archive(path.string(), &config_loaded, false, load_config);
|
||||
if (load_config && !config_loaded.empty()) {
|
||||
// Based on the printer technology field found in the loaded config, select the base for the config,
|
||||
PrinterTechnology printer_technology = Preset::printer_technology(config_loaded);
|
||||
|
|
@ -2255,7 +2255,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||
}
|
||||
}
|
||||
else {
|
||||
model = Slic3r::Model::read_from_file(path.string(), nullptr, false);
|
||||
model = Slic3r::Model::read_from_file(path.string(), nullptr, false, load_config);
|
||||
for (auto obj : model.objects)
|
||||
if (obj->name.empty())
|
||||
obj->name = fs::path(obj->input_file).filename().string();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue