mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX set as default
This commit is contained in:
parent
dad09c737c
commit
b6ab6378d7
6 changed files with 0 additions and 53 deletions
|
@ -44,9 +44,6 @@
|
||||||
// Enable adaptive layer height profile
|
// Enable adaptive layer height profile
|
||||||
#define ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE (1 && ENABLE_2_2_0_ALPHA1)
|
#define ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE (1 && ENABLE_2_2_0_ALPHA1)
|
||||||
|
|
||||||
// Enable fix for view toolbar background not showing up on Mac with dark mode
|
|
||||||
#define ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX (1 && ENABLE_2_2_0_ALPHA1)
|
|
||||||
|
|
||||||
// Enable selection for missing files in reload from disk command
|
// Enable selection for missing files in reload from disk command
|
||||||
#define ENABLE_RELOAD_FROM_DISK_MISSING_SELECTION (1 && ENABLE_2_2_0_ALPHA1)
|
#define ENABLE_RELOAD_FROM_DISK_MISSING_SELECTION (1 && ENABLE_2_2_0_ALPHA1)
|
||||||
|
|
||||||
|
|
|
@ -1349,9 +1349,6 @@ void GLCanvas3D::LegendTexture::render(const GLCanvas3D& canvas) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_INIT, SimpleEvent);
|
|
||||||
#endif // !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_OBJECT_SELECT, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_OBJECT_SELECT, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_RIGHT_CLICK, RBtnEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_RIGHT_CLICK, RBtnEvent);
|
||||||
|
@ -1521,10 +1518,6 @@ bool GLCanvas3D::init()
|
||||||
if (m_selection.is_enabled() && !m_selection.init())
|
if (m_selection.is_enabled() && !m_selection.init())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
post_event(SimpleEvent(EVT_GLCANVAS_INIT));
|
|
||||||
#endif // !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
m_initialized = true;
|
m_initialized = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -4233,10 +4226,8 @@ bool GLCanvas3D::_init_toolbars()
|
||||||
if (!_init_undoredo_toolbar())
|
if (!_init_undoredo_toolbar())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
if (!_init_view_toolbar())
|
if (!_init_view_toolbar())
|
||||||
return false;
|
return false;
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -4495,12 +4486,10 @@ bool GLCanvas3D::_init_undoredo_toolbar()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
bool GLCanvas3D::_init_view_toolbar()
|
bool GLCanvas3D::_init_view_toolbar()
|
||||||
{
|
{
|
||||||
return wxGetApp().plater()->init_view_toolbar();
|
return wxGetApp().plater()->init_view_toolbar();
|
||||||
}
|
}
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
bool GLCanvas3D::_set_current()
|
bool GLCanvas3D::_set_current()
|
||||||
{
|
{
|
||||||
|
|
|
@ -83,9 +83,6 @@ template <size_t N> using Vec3dsEvent = ArrayEvent<Vec3d, N>;
|
||||||
|
|
||||||
using HeightProfileSmoothEvent = Event<HeightProfileSmoothingParams>;
|
using HeightProfileSmoothEvent = Event<HeightProfileSmoothingParams>;
|
||||||
|
|
||||||
#if !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_INIT, SimpleEvent);
|
|
||||||
#endif // !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_RIGHT_CLICK, RBtnEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_RIGHT_CLICK, RBtnEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_REMOVE_OBJECT, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_REMOVE_OBJECT, SimpleEvent);
|
||||||
|
@ -683,9 +680,7 @@ private:
|
||||||
bool _init_toolbars();
|
bool _init_toolbars();
|
||||||
bool _init_main_toolbar();
|
bool _init_main_toolbar();
|
||||||
bool _init_undoredo_toolbar();
|
bool _init_undoredo_toolbar();
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
bool _init_view_toolbar();
|
bool _init_view_toolbar();
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
bool _set_current();
|
bool _set_current();
|
||||||
void _resize(unsigned int w, unsigned int h);
|
void _resize(unsigned int w, unsigned int h);
|
||||||
|
|
|
@ -295,9 +295,7 @@ public:
|
||||||
|
|
||||||
bool is_any_item_pressed() const;
|
bool is_any_item_pressed() const;
|
||||||
|
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
unsigned int get_items_count() const { return (unsigned int)m_items.size(); }
|
unsigned int get_items_count() const { return (unsigned int)m_items.size(); }
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
int get_item_id(const std::string& name) const;
|
int get_item_id(const std::string& name) const;
|
||||||
|
|
||||||
void force_left_action(int item_id, GLCanvas3D& parent) { do_action(GLToolbarItem::Left, item_id, parent, false); }
|
void force_left_action(int item_id, GLCanvas3D& parent) { do_action(GLToolbarItem::Left, item_id, parent, false); }
|
||||||
|
|
|
@ -1857,9 +1857,7 @@ struct Plater::priv
|
||||||
|
|
||||||
void set_current_canvas_as_dirty();
|
void set_current_canvas_as_dirty();
|
||||||
|
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
bool init_view_toolbar();
|
bool init_view_toolbar();
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
void reset_all_gizmos();
|
void reset_all_gizmos();
|
||||||
void update_ui_from_settings();
|
void update_ui_from_settings();
|
||||||
|
@ -2006,9 +2004,6 @@ private:
|
||||||
bool complit_init_object_menu();
|
bool complit_init_object_menu();
|
||||||
bool complit_init_sla_object_menu();
|
bool complit_init_sla_object_menu();
|
||||||
bool complit_init_part_menu();
|
bool complit_init_part_menu();
|
||||||
#if !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
void init_view_toolbar();
|
|
||||||
#endif // !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
bool can_split() const;
|
bool can_split() const;
|
||||||
bool layers_height_allowed() const;
|
bool layers_height_allowed() const;
|
||||||
|
@ -2160,9 +2155,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||||
view3D_canvas->Bind(EVT_GLTOOLBAR_SPLIT_OBJECTS, &priv::on_action_split_objects, this);
|
view3D_canvas->Bind(EVT_GLTOOLBAR_SPLIT_OBJECTS, &priv::on_action_split_objects, this);
|
||||||
view3D_canvas->Bind(EVT_GLTOOLBAR_SPLIT_VOLUMES, &priv::on_action_split_volumes, this);
|
view3D_canvas->Bind(EVT_GLTOOLBAR_SPLIT_VOLUMES, &priv::on_action_split_volumes, this);
|
||||||
view3D_canvas->Bind(EVT_GLTOOLBAR_LAYERSEDITING, &priv::on_action_layersediting, this);
|
view3D_canvas->Bind(EVT_GLTOOLBAR_LAYERSEDITING, &priv::on_action_layersediting, this);
|
||||||
#if !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
view3D_canvas->Bind(EVT_GLCANVAS_INIT, [this](SimpleEvent&) { init_view_toolbar(); });
|
|
||||||
#endif // !ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
view3D_canvas->Bind(EVT_GLCANVAS_UPDATE_BED_SHAPE, [this](SimpleEvent&)
|
view3D_canvas->Bind(EVT_GLCANVAS_UPDATE_BED_SHAPE, [this](SimpleEvent&)
|
||||||
{
|
{
|
||||||
set_bed_shape(config->option<ConfigOptionPoints>("bed_shape")->values,
|
set_bed_shape(config->option<ConfigOptionPoints>("bed_shape")->values,
|
||||||
|
@ -3994,17 +3986,11 @@ void Plater::priv::set_current_canvas_as_dirty()
|
||||||
preview->set_as_dirty();
|
preview->set_as_dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
bool Plater::priv::init_view_toolbar()
|
bool Plater::priv::init_view_toolbar()
|
||||||
#else
|
|
||||||
void Plater::priv::init_view_toolbar()
|
|
||||||
#endif //!ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
{
|
{
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
if (view_toolbar.get_items_count() > 0)
|
if (view_toolbar.get_items_count() > 0)
|
||||||
// already initialized
|
// already initialized
|
||||||
return true;
|
return true;
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
BackgroundTexture::Metadata background_data;
|
BackgroundTexture::Metadata background_data;
|
||||||
background_data.filename = "toolbar_background.png";
|
background_data.filename = "toolbar_background.png";
|
||||||
|
@ -4014,11 +4000,7 @@ void Plater::priv::init_view_toolbar()
|
||||||
background_data.bottom = 16;
|
background_data.bottom = 16;
|
||||||
|
|
||||||
if (!view_toolbar.init(background_data))
|
if (!view_toolbar.init(background_data))
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
return false;
|
return false;
|
||||||
#else
|
|
||||||
return;
|
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
view_toolbar.set_horizontal_orientation(GLToolbar::Layout::HO_Left);
|
view_toolbar.set_horizontal_orientation(GLToolbar::Layout::HO_Left);
|
||||||
view_toolbar.set_vertical_orientation(GLToolbar::Layout::VO_Bottom);
|
view_toolbar.set_vertical_orientation(GLToolbar::Layout::VO_Bottom);
|
||||||
|
@ -4033,11 +4015,7 @@ void Plater::priv::init_view_toolbar()
|
||||||
item.sprite_id = 0;
|
item.sprite_id = 0;
|
||||||
item.left.action_callback = [this]() { if (this->q != nullptr) wxPostEvent(this->q, SimpleEvent(EVT_GLVIEWTOOLBAR_3D)); };
|
item.left.action_callback = [this]() { if (this->q != nullptr) wxPostEvent(this->q, SimpleEvent(EVT_GLVIEWTOOLBAR_3D)); };
|
||||||
if (!view_toolbar.add_item(item))
|
if (!view_toolbar.add_item(item))
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
return false;
|
return false;
|
||||||
#else
|
|
||||||
return;
|
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
item.name = "Preview";
|
item.name = "Preview";
|
||||||
item.icon_filename = "preview.svg";
|
item.icon_filename = "preview.svg";
|
||||||
|
@ -4045,18 +4023,12 @@ void Plater::priv::init_view_toolbar()
|
||||||
item.sprite_id = 1;
|
item.sprite_id = 1;
|
||||||
item.left.action_callback = [this]() { if (this->q != nullptr) wxPostEvent(this->q, SimpleEvent(EVT_GLVIEWTOOLBAR_PREVIEW)); };
|
item.left.action_callback = [this]() { if (this->q != nullptr) wxPostEvent(this->q, SimpleEvent(EVT_GLVIEWTOOLBAR_PREVIEW)); };
|
||||||
if (!view_toolbar.add_item(item))
|
if (!view_toolbar.add_item(item))
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
return false;
|
return false;
|
||||||
#else
|
|
||||||
return;
|
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
view_toolbar.select_item("3D");
|
view_toolbar.select_item("3D");
|
||||||
view_toolbar.set_enabled(true);
|
view_toolbar.set_enabled(true);
|
||||||
|
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
return true;
|
return true;
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Plater::priv::can_set_instance_to_object() const
|
bool Plater::priv::can_set_instance_to_object() const
|
||||||
|
@ -5515,12 +5487,10 @@ void Plater::msw_rescale()
|
||||||
GetParent()->Layout();
|
GetParent()->Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
bool Plater::init_view_toolbar()
|
bool Plater::init_view_toolbar()
|
||||||
{
|
{
|
||||||
return p->init_view_toolbar();
|
return p->init_view_toolbar();
|
||||||
}
|
}
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
const Camera& Plater::get_camera() const
|
const Camera& Plater::get_camera() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -266,9 +266,7 @@ public:
|
||||||
|
|
||||||
void msw_rescale();
|
void msw_rescale();
|
||||||
|
|
||||||
#if ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
bool init_view_toolbar();
|
bool init_view_toolbar();
|
||||||
#endif // ENABLE_VIEW_TOOLBAR_BACKGROUND_FIX
|
|
||||||
|
|
||||||
const Camera& get_camera() const;
|
const Camera& get_camera() const;
|
||||||
const Mouse3DController& get_mouse3d_controller() const;
|
const Mouse3DController& get_mouse3d_controller() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue