mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-16 08:52:43 +00:00
* Add runtime display backend detection for Wayland support Add LinuxDisplayBackend utility to detect X11 vs Wayland at runtime using GDK_IS_X11_DISPLAY / GDK_IS_WAYLAND_DISPLAY macros. This is the foundation for removing the forced GDK_BACKEND=x11 and enabling native Wayland support. - New files: LinuxDisplayBackend.hpp/.cpp with get_linux_display_backend(), is_running_on_wayland(), and is_running_on_x11() - Propagate wxHAVE_GDK_X11 / wxHAVE_GDK_WAYLAND from FindGTK3.cmake as compile definitions to libslic3r_gui - No-op on non-Linux platforms (returns Unknown / false) * Fix Phase 1 code quality: pragma once, source ordering, static cache * Make X11 initialization conditional for Wayland support Remove the unconditional GDK_BACKEND=x11 force that blocked native Wayland. Replace with conditional logic: - EGL safety fallback: re-force X11 only when wxUSE_GLCANVAS_EGL is off and WAYLAND_DISPLAY is set, with a warning log - XInitThreads() only called when DISPLAY is set (X11 in use) - __GLX_VENDOR_LIBRARY_NAME only set when DISPLAY is present (GLX-specific) - WEBKIT_DISABLE_COMPOSITING_MODE only set under XWayland (both DISPLAY and WAYLAND_DISPLAY present) - Guard X11/Xlib.h include with __has_include for robustness - Restore display validation to accept either DISPLAY or WAYLAND_DISPLAY This is Phase 2 of the Wayland support plan. * Fix Phase 2: safer EGL macro check, add clarifying comments * Add GLAD2 library and replace GLEW linkage in build system Set up GLAD2 as a static library to replace GLEW for OpenGL loading. GLAD2 supports both GLX and EGL, which is required for Wayland support. - Create src/glad/ with pre-generated GLAD2 sources (GL 4.6 compat) - Add src/glad/CMakeLists.txt building glad as a static library - Wire glad into src/CMakeLists.txt before libvgcode - Modify libvgcode to use shared glad for GL path (keeps local copy only for GLES2/Emscripten) to avoid duplicate symbol conflicts - Replace GLEW::GLEW with glad in libslic3r_gui link libraries Note: GLEW is kept in deps for OpenCSG. Code migration from GL/glew.h to glad/gl.h headers will follow in Phase 3B+3C. * Fix Phase 3A+3D: libvgcode GLAD include, dead files, dlopen dep, OpenGL link var * Migrate from GLEW to GLAD: replace headers and API calls across codebase Replace all #include <GL/glew.h> with <glad/gl.h> across 49 source files. Migrate GLEW API calls to GLAD equivalents: - glewInit/glewExperimental -> gladLoaderLoadGL() - GLEW_EXT_* / GLEW_ARB_* extension checks -> GLAD_GL_EXT_* / GLAD_GL_ARB_* - Remove GLEW-specific EGL/GLX mismatch #error guards (not needed with GLAD) - Replace unavailable EXT symbols with core GL equivalents in GLCanvas3D.cpp (GL_MAX_SAMPLES, glRenderbufferStorageMultisample, glBlitFramebuffer, GL_READ/DRAW_FRAMEBUFFER) - Update log messages from glewInit to gladLoadGL * Fix Phase 3B+3C: remove GLEW find, clean EXT symbols, update attribution - Remove find_package(GLEW) block from root CMakeLists.txt since GLEW is no longer linked by any main application code - Remove "glew" from SLIC3R_STATIC option description - Replace all remaining EXT framebuffer symbols with core equivalents in render_thumbnail_framebuffer_ext and _rectangular_selection_picking_pass - Update AboutDialog credits from GLEW to GLAD * Enable EGL in wxWidgets and add runtime GLX/EGL selection for Wayland - Set wxUSE_GLCANVAS_EGL=ON in wxWidgets build and Flatpak manifest - Add PreferGLX() call on X11 sessions for driver compatibility - Remove Phase 2 safety fallback (EGL is now always compiled in) - Guard SwapBuffers against hidden canvases to prevent Wayland stalls * Fix Phase 4: move PreferGLX to app startup, fix FPS counter guard Move wxGLCanvas::PreferGLX() from OpenGLManager::create_wxglcanvas() (static initializer) to GUI_App::on_init_inner() before any wxGLCanvas is constructed. This prevents a race where SkipPartCanvas could trigger wxGLBackend::Init() before the GLX preference is set. The new location also adds explicit is_running_on_wayland() detection with a warning for unknown backends. Move increment_fps_counter() inside the IsShownOnScreen() guard so FPS is only counted when a frame is actually swapped. * Update GLFW from 3.3.7 to 3.4 for runtime Wayland/X11 backend selection Replace the compile-time GLFW_USE_WAYLAND flag (which locked to a single backend) with GLFW 3.4's GLFW_BUILD_WAYLAND + GLFW_BUILD_X11 flags that build both backends and auto-select at runtime based on the available display server. This enables the CLI thumbnail renderer to work on both Wayland and X11 sessions without separate builds. * wayland: Fix UI call sites that rely on global screen coordinates On Wayland, wxGetMousePosition() returns (0,0) and SetPosition() is a no-op for top-level windows. Fix the highest-impact call sites: - GLCanvas3D: Use cached m_mouse.position from event handlers instead of wxGetMousePosition() + ScreenToClient() in get_local_mouse_position() - Plater: Use event-relative coords via ClientToScreen(e.GetPosition()) instead of wxGetMousePosition() in 3 leave-window handlers - BBLTopbar: Use event.GetPosition() and FindToolByPosition() directly in mouse handlers instead of wxGetMousePosition()/FindToolByCurrentPosition() - Search: Use focus-based dismiss logic on Wayland instead of wxGetMousePosition()-based rect checks in SearchDialog and SearchObjectDialog - GUI_App: Skip SetPosition() in window_pos_restore() on Wayland where it is a no-op; still restore size and maximize state - Button: Position tooltip relative to button widget via ClientToScreen instead of wxGetMousePosition() * Fix SearchDialog Wayland dismiss: guard against search_line focus * flatpak: Add Wayland socket permission for native Wayland support * spec * Fix crash on Wayland when wxWidgets lacks EGL support Restore the safety fallback that forces GDK_BACKEND=x11 when wxWidgets was not built with wxUSE_GLCANVAS_EGL=ON. Without this, the GLX backend tries to access a non-existent X11 display on native Wayland, crashing in wxGLCanvas::IsDisplaySupported() with SIGSEGV at offset 0xe4. Also add a defense-in-depth guard in detect_multisample() that skips the IsDisplaySupported call entirely on Wayland without EGL. Root cause: deps/wxWidgets must be rebuilt after enabling EGL. The compile-time check in OrcaSlicer.cpp detects the mismatch and falls back safely. * Fix EGL detection: use wxHAS_EGL instead of wxUSE_GLCANVAS_EGL wxUSE_GLCANVAS_EGL is a CMake build option, NOT a C++ preprocessor macro. The actual macro defined in wxWidgets setup.h is wxHAS_EGL. All compile-time EGL checks were using the wrong macro, causing the safety fallback to always trigger even with a properly built EGL-enabled wxWidgets. * Fix GL function pointers invalidated on Wayland/EGL gladLoaderLoadGL() dlopen's libGL.so.1 to resolve GL function pointers via dlsym, then immediately dlclose's the handle. On X11/GLX this is fine because the GLX context keeps libGL.so mapped. On Wayland/EGL, nothing else holds libGL.so open, so dlclose unmaps it and all function pointers become dangling — causing SIGSEGV on the first GL call. Fix: on Wayland, use gladLoadGL(eglGetProcAddress) which resolves function pointers through the EGL loader without opening/closing libGL.so. * fix crash on start and various rendering issues * fix crash on close * small refactor * move GPU selection to desktop file * clean up a bit * clean up more * fix appimage error
445 lines
15 KiB
C++
445 lines
15 KiB
C++
#include "GUI_ObjectSettings.hpp"
|
|
#include "GUI_ObjectList.hpp"
|
|
#include "GUI_Factories.hpp"
|
|
#include "Tab.hpp"
|
|
#include "MainFrame.hpp"
|
|
|
|
#include "OptionsGroup.hpp"
|
|
#include "GUI_App.hpp"
|
|
#include "wxExtensions.hpp"
|
|
#include "Plater.hpp"
|
|
#include "libslic3r/PresetBundle.hpp"
|
|
#include "libslic3r/Model.hpp"
|
|
|
|
#include <boost/algorithm/string.hpp>
|
|
|
|
#include "I18N.hpp"
|
|
#include "ConfigManipulation.hpp"
|
|
|
|
#include <wx/wupdlock.h>
|
|
|
|
namespace Slic3r
|
|
{
|
|
namespace GUI
|
|
{
|
|
|
|
OG_Settings::OG_Settings(wxWindow* parent, const bool staticbox) :
|
|
m_parent(parent)
|
|
{
|
|
//BBS
|
|
wxString title = "";
|
|
//wxString title = staticbox ? " " : ""; // temporary workaround - #ys_FIXME
|
|
m_og = std::make_shared<ConfigOptionsGroup>(parent, title);
|
|
}
|
|
|
|
bool OG_Settings::IsShown()
|
|
{
|
|
return m_og->sizer->IsEmpty() ? false : m_og->sizer->IsShown(size_t(0));
|
|
}
|
|
|
|
void OG_Settings::Show(const bool show)
|
|
{
|
|
m_og->Show(show);
|
|
}
|
|
|
|
void OG_Settings::Hide()
|
|
{
|
|
Show(false);
|
|
}
|
|
|
|
void OG_Settings::UpdateAndShow(const bool show)
|
|
{
|
|
Show(show);
|
|
// m_parent->Layout();
|
|
}
|
|
|
|
wxSizer* OG_Settings::get_sizer()
|
|
{
|
|
return m_og->sizer;
|
|
}
|
|
|
|
|
|
|
|
ObjectSettings::ObjectSettings(wxWindow* parent) :
|
|
#if !NEW_OBJECT_SETTING
|
|
OG_Settings(parent, true)
|
|
#else
|
|
m_parent(parent)
|
|
#endif
|
|
{
|
|
#if !NEW_OBJECT_SETTING
|
|
m_og->activate();
|
|
m_og->set_name(_(L("Additional process preset")));
|
|
|
|
m_settings_list_sizer = new wxBoxSizer(wxVERTICAL);
|
|
m_og->sizer->Add(m_settings_list_sizer, 1, wxEXPAND | wxLEFT, 5);
|
|
|
|
m_bmp_delete = ScalableBitmap(parent, "cross");
|
|
m_bmp_delete_focus = ScalableBitmap(parent, "cross_focus");
|
|
#endif
|
|
}
|
|
|
|
#if !NEW_OBJECT_SETTING // BBS: new object settings
|
|
|
|
bool ObjectSettings::update_settings_list()
|
|
{
|
|
m_settings_list_sizer->Clear(true);
|
|
m_og_settings.resize(0);
|
|
|
|
if (wxGetApp().is_closing())
|
|
return false;
|
|
|
|
auto objects_ctrl = wxGetApp().obj_list();
|
|
auto objects_model = wxGetApp().obj_list()->GetModel();
|
|
auto config = wxGetApp().obj_list()->config();
|
|
|
|
const auto item = objects_ctrl->GetSelection();
|
|
|
|
if (!item || !objects_model->IsSettingsItem(item) || !config || objects_ctrl->multiple_selection())
|
|
return false;
|
|
|
|
const bool is_object_settings = objects_model->GetItemType(objects_model->GetParent(item)) == itObject;
|
|
SettingsFactory::Bundle cat_options = SettingsFactory::get_bundle(&config->get(), is_object_settings);
|
|
|
|
if (!cat_options.empty())
|
|
{
|
|
std::vector<std::string> categories;
|
|
categories.reserve(cat_options.size());
|
|
|
|
auto extra_column = [config, this](wxWindow* parent, const Line& line)
|
|
{
|
|
auto opt_key = (line.get_options())[0].opt_id; //we assume that we have one option per line
|
|
|
|
auto btn = new ScalableButton(parent, wxID_ANY, m_bmp_delete);
|
|
btn->SetBackgroundColour(parent->GetBackgroundColour());
|
|
btn->SetToolTip(_(L("Remove parameter")));
|
|
|
|
btn->SetBitmapFocus(m_bmp_delete_focus.bmp());
|
|
btn->SetBitmapHover(m_bmp_delete_focus.bmp());
|
|
|
|
btn->Bind(wxEVT_BUTTON, [opt_key, config, this](wxEvent &event) {
|
|
wxGetApp().plater()->take_snapshot(from_u8((boost::format("Delete Option %s") % opt_key).str()).ToStdString());
|
|
config->erase(opt_key);
|
|
wxGetApp().obj_list()->changed_object();
|
|
wxTheApp->CallAfter([this]() {
|
|
wxWindowUpdateLocker noUpdates(m_parent);
|
|
update_settings_list();
|
|
m_parent->Layout();
|
|
});
|
|
});
|
|
return btn;
|
|
};
|
|
|
|
for (auto& cat : cat_options)
|
|
{
|
|
categories.push_back(cat.first);
|
|
|
|
auto optgroup = std::make_shared<ConfigOptionsGroup>(m_og->ctrl_parent(), _(cat.first), config, false, extra_column);
|
|
optgroup->label_width = 15;
|
|
optgroup->sidetext_width = 5;
|
|
|
|
optgroup->m_on_change = [this, config](const t_config_option_key& opt_id, const boost::any& value) {
|
|
this->update_config_values(config);
|
|
wxGetApp().obj_list()->changed_object(); };
|
|
|
|
// call back for rescaling of the extracolumn control
|
|
optgroup->rescale_extra_column_item = [this](wxWindow* win) {
|
|
auto *ctrl = dynamic_cast<ScalableButton*>(win);
|
|
if (ctrl == nullptr)
|
|
return;
|
|
ctrl->SetBitmap_(m_bmp_delete);
|
|
ctrl->SetBitmapFocus(m_bmp_delete_focus.bmp());
|
|
ctrl->SetBitmapHover(m_bmp_delete_focus.bmp());
|
|
};
|
|
|
|
const bool is_extruders_cat = cat.first == "Extruders";
|
|
for (auto& opt : cat.second)
|
|
{
|
|
Option option = optgroup->get_option(opt);
|
|
option.opt.width = 12;
|
|
if (is_extruders_cat)
|
|
option.opt.max = wxGetApp().extruders_edited_cnt();
|
|
optgroup->append_single_option_line(option);
|
|
}
|
|
optgroup->activate();
|
|
for (auto& opt : cat.second)
|
|
optgroup->get_field(opt)->m_on_change = [optgroup](const std::string& opt_id, const boost::any& value) {
|
|
// first of all take a snapshot and then change value in configuration
|
|
wxGetApp().plater()->take_snapshot(from_u8((boost::format("Change Option %s")% opt_id).str()).ToStdString());
|
|
optgroup->on_change_OG(opt_id, value);
|
|
};
|
|
|
|
optgroup->reload_config();
|
|
|
|
m_settings_list_sizer->Add(optgroup->sizer, 0, wxEXPAND | wxALL, 0);
|
|
m_og_settings.push_back(optgroup);
|
|
}
|
|
|
|
if (!categories.empty()) {
|
|
objects_model->UpdateSettingsDigest(item, categories);
|
|
update_config_values(config);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
objects_ctrl->select_item(objects_model->Delete(item));
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
#else
|
|
bool ObjectSettings::update_settings_list()
|
|
{
|
|
if (!wxGetApp().is_editor())
|
|
return false;
|
|
if (!wxGetApp().mainframe->IsShown())
|
|
return false;
|
|
|
|
auto objects_ctrl = wxGetApp().obj_list();
|
|
auto objects_model = wxGetApp().obj_list()->GetModel();
|
|
|
|
wxDataViewItemArray items;
|
|
objects_ctrl->GetSelections(items);
|
|
|
|
std::map<ObjectBase *, ModelConfig*> plate_configs;
|
|
std::map<ObjectBase *, ModelConfig*> object_configs;
|
|
bool is_plate_settings = false;
|
|
bool is_object_settings = false;
|
|
bool is_volume_settings = false;
|
|
bool is_layer_range_settings = false;
|
|
bool is_layer_root = false;
|
|
ModelObject * parent_object = nullptr;
|
|
for (auto item : items) {
|
|
auto type = objects_model->GetItemType(item);
|
|
if (type != itPlate && type != itObject && type != itVolume && type != itLayerRoot && type != itLayer) {
|
|
continue;
|
|
}
|
|
int plate_id = objects_model->GetPlateIdByItem(item);
|
|
PartPlateList& ppl = wxGetApp().plater()->get_partplate_list();
|
|
if (plate_id < 0 || plate_id >= ppl.get_plate_count()) {
|
|
plate_id = ppl.get_curr_plate_index();
|
|
}
|
|
assert(plate_id >= 0 && plate_id < ppl.get_plate_count());
|
|
static ModelConfig cfg;
|
|
cfg.assign_config(*ppl.get_plate(plate_id)->config());
|
|
if (type == itPlate) {
|
|
is_plate_settings = true;
|
|
plate_configs.emplace(ppl.get_plate(plate_id), &cfg);
|
|
break;
|
|
}
|
|
|
|
const int obj_idx = objects_model->GetObjectIdByItem(item);
|
|
assert(obj_idx >= 0);
|
|
auto object = wxGetApp().model().objects[obj_idx];
|
|
if (type == itObject) {
|
|
is_object_settings = true;
|
|
plate_configs.emplace(ppl.get_plate(plate_id), &cfg);
|
|
object_configs.emplace(object, &object->config);
|
|
}
|
|
else if(type == itVolume){
|
|
is_volume_settings = true;
|
|
if (parent_object && parent_object != object)
|
|
return false;
|
|
plate_configs.emplace(ppl.get_plate(plate_id), &cfg);
|
|
parent_object = object;
|
|
const int vol_idx = objects_model->GetVolumeIdByItem(item);
|
|
assert(vol_idx >= 0);
|
|
auto volume = object->volumes[vol_idx];
|
|
object_configs.emplace(volume, &volume->config);
|
|
}
|
|
else if(type == itLayer){
|
|
is_layer_range_settings = true;
|
|
if (parent_object && parent_object != object)
|
|
return false;
|
|
plate_configs.emplace(ppl.get_plate(plate_id), &cfg);
|
|
parent_object = object;
|
|
|
|
t_layer_height_range height_range = objects_model->GetLayerRangeByItem(item);
|
|
object_configs.emplace( (ObjectBase*)(&object->layer_config_ranges.at(height_range)), &object->layer_config_ranges.at(height_range) );
|
|
}
|
|
else if (type == itLayerRoot) {
|
|
is_layer_root = true;
|
|
}
|
|
}
|
|
|
|
auto tab_plate = dynamic_cast<TabPrintPlate*>(wxGetApp().get_plate_tab());
|
|
auto tab_object = dynamic_cast<TabPrintModel*>(wxGetApp().get_model_tab());
|
|
auto tab_volume = dynamic_cast<TabPrintModel*>(wxGetApp().get_model_tab(true));
|
|
auto tab_layer = dynamic_cast<TabPrintModel*>(wxGetApp().get_layer_tab());
|
|
|
|
if (is_plate_settings) {
|
|
tab_plate->set_model_config(plate_configs);
|
|
tab_object->set_model_config({});
|
|
tab_volume->set_model_config({});
|
|
tab_layer->set_model_config({});
|
|
;// m_tab_active = tab_plate;
|
|
}
|
|
else if (is_object_settings) {
|
|
tab_plate->set_model_config(plate_configs);
|
|
tab_object->set_model_config(object_configs);
|
|
tab_volume->set_model_config({});
|
|
tab_layer->set_model_config({});
|
|
//m_tab_active = tab_object;
|
|
}
|
|
else if (is_volume_settings) {
|
|
tab_plate->set_model_config(plate_configs);
|
|
tab_object->set_model_config({ {parent_object, &parent_object->config} });
|
|
tab_volume->set_model_config(object_configs);
|
|
tab_layer->set_model_config({});
|
|
//m_tab_active = tab_volume;
|
|
}
|
|
else if (is_layer_range_settings) {
|
|
tab_plate->set_model_config(plate_configs);
|
|
tab_object->set_model_config({ {parent_object, &parent_object->config} });
|
|
tab_volume->set_model_config({});
|
|
tab_layer->set_model_config(object_configs);
|
|
//m_tab_active = tab_layer;
|
|
}
|
|
else {
|
|
tab_plate->set_model_config({});
|
|
tab_object->set_model_config({});
|
|
tab_volume->set_model_config({});
|
|
tab_layer->set_model_config({});
|
|
//m_tab_active = nullptr;
|
|
}
|
|
((ParamsPanel*) tab_object->GetParent())->set_active_tab(nullptr);
|
|
return true;
|
|
}
|
|
|
|
#endif
|
|
|
|
bool ObjectSettings::add_missed_options(ModelConfig* config_to, const DynamicPrintConfig& config_from)
|
|
{
|
|
const DynamicPrintConfig& print_config = wxGetApp().plater()->printer_technology() == ptFFF ?
|
|
wxGetApp().preset_bundle->prints.get_edited_preset().config :
|
|
wxGetApp().preset_bundle->sla_prints.get_edited_preset().config;
|
|
bool is_added = false;
|
|
|
|
for (auto opt_key : config_from.diff(print_config))
|
|
if (!config_to->has(opt_key)) {
|
|
config_to->set_key_value(opt_key, config_from.option(opt_key)->clone());
|
|
is_added = true;
|
|
}
|
|
|
|
return is_added;
|
|
}
|
|
|
|
void ObjectSettings::update_config_values(ModelConfig* config)
|
|
{
|
|
const auto objects_model = wxGetApp().obj_list()->GetModel();
|
|
const auto item = wxGetApp().obj_list()->GetSelection();
|
|
const auto printer_technology = wxGetApp().plater()->printer_technology();
|
|
const bool is_object_settings = objects_model->GetItemType(objects_model->GetParent(item)) == itObject;
|
|
|
|
if (!item || !objects_model->IsSettingsItem(item) || !config)
|
|
return;
|
|
|
|
// update config values according to configuration hierarchy
|
|
DynamicPrintConfig main_config = printer_technology == ptFFF ?
|
|
wxGetApp().preset_bundle->prints.get_edited_preset().config :
|
|
wxGetApp().preset_bundle->sla_prints.get_edited_preset().config;
|
|
|
|
auto load_config = [this, config, &main_config]()
|
|
{
|
|
/* Additional check for overrided options.
|
|
* There is a case, when some options should to be added,
|
|
* to avoid check loop in the next configuration update
|
|
*/
|
|
bool is_added = add_missed_options(config, main_config);
|
|
|
|
// load checked values from main_config to config
|
|
config->apply_only(main_config, config->keys(), true);
|
|
// Initialize UI components with the config values.
|
|
#if !NEW_OBJECT_SETTING
|
|
for (auto og : m_og_settings)
|
|
og->reload_config();
|
|
#else
|
|
#endif
|
|
// next config check
|
|
update_config_values(config);
|
|
|
|
if (is_added) {
|
|
// #ysFIXME - Delete after testing! Very likely this CallAfret is no needed
|
|
// wxTheApp->CallAfter([this]() {
|
|
wxWindowUpdateLocker noUpdates(m_parent);
|
|
update_settings_list();
|
|
m_parent->Layout();
|
|
// });
|
|
}
|
|
};
|
|
|
|
#if !NEW_OBJECT_SETTING
|
|
auto toggle_field = [this](const t_config_option_key & opt_key, bool toggle, int opt_index)
|
|
{
|
|
Field* field = nullptr;
|
|
for (auto og : m_og_settings) {
|
|
field = og->get_fieldc(opt_key, opt_index);
|
|
if (field != nullptr)
|
|
break;
|
|
}
|
|
if (field)
|
|
field->toggle(toggle);
|
|
};
|
|
#else
|
|
auto toggle_field = [this](const t_config_option_key & opt_key, bool toggle, int opt_index)
|
|
{
|
|
m_tab_active->toggle_option(opt_key, toggle, opt_index);
|
|
};
|
|
#endif
|
|
|
|
//BBS: change local config to DynamicPrintConfig
|
|
ConfigManipulation config_manipulation(load_config, toggle_field, nullptr, nullptr, &(config->get()));
|
|
|
|
config_manipulation.set_is_BBL_Printer(wxGetApp().preset_bundle->is_bbl_vendor());
|
|
|
|
if (!is_object_settings)
|
|
{
|
|
const int obj_idx = objects_model->GetObjectIdByItem(item);
|
|
assert(obj_idx >= 0);
|
|
// for object's part first of all update konfiguration from object
|
|
main_config.apply(wxGetApp().model().objects[obj_idx]->config.get(), true);
|
|
// and then from its own config
|
|
}
|
|
|
|
main_config.apply(config->get(), true);
|
|
printer_technology == ptFFF ? config_manipulation.update_print_fff_config(&main_config) :
|
|
config_manipulation.update_print_sla_config(&main_config) ;
|
|
|
|
printer_technology == ptFFF ? config_manipulation.toggle_print_fff_options(&main_config) :
|
|
config_manipulation.toggle_print_sla_options(&main_config) ;
|
|
}
|
|
|
|
void ObjectSettings::UpdateAndShow(const bool show)
|
|
{
|
|
#if !NEW_OBJECT_SETTING
|
|
OG_Settings::UpdateAndShow(show ? update_settings_list() : false);
|
|
#else
|
|
update_settings_list();
|
|
#endif
|
|
}
|
|
|
|
void ObjectSettings::msw_rescale()
|
|
{
|
|
#if !NEW_OBJECT_SETTING
|
|
m_bmp_delete.msw_rescale();
|
|
m_bmp_delete_focus.msw_rescale();
|
|
|
|
for (auto group : m_og_settings)
|
|
group->msw_rescale();
|
|
#endif
|
|
}
|
|
|
|
void ObjectSettings::sys_color_changed()
|
|
{
|
|
#if !NEW_OBJECT_SETTING
|
|
m_og->sys_color_changed();
|
|
|
|
for (auto group : m_og_settings)
|
|
group->sys_color_changed();
|
|
#endif
|
|
}
|
|
|
|
} //namespace GUI
|
|
} //namespace Slic3r
|