diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-02-28 14:21:36 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-02-28 14:21:36 +0300 |
commit | e5a2c0a8c8d8f24f3f96e28ce2725701e81563a8 (patch) | |
tree | 2c6f750ebe253f3e42387e980f8486a01a4be9e7 /src/slic3r | |
parent | 9ff8cd01b399fb45f23ed7084b8415de8664f852 (diff) |
ENABLE_MODE_AWARE_TOOLBAR_ITEMS set as default
Diffstat (limited to 'src/slic3r')
-rw-r--r-- | src/slic3r/GUI/GLCanvas3D.cpp | 4 | ||||
-rw-r--r-- | src/slic3r/GUI/GLCanvas3D.hpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/GLToolbar.cpp | 20 | ||||
-rw-r--r-- | src/slic3r/GUI/GLToolbar.hpp | 6 | ||||
-rw-r--r-- | src/slic3r/GUI/GUI_Preview.cpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/GUI_Preview.hpp | 2 | ||||
-rw-r--r-- | src/slic3r/GUI/Plater.cpp | 2 |
7 files changed, 0 insertions, 38 deletions
diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index d26a06a61..ae3e4dc70 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -4135,7 +4135,6 @@ void GLCanvas3D::update_volumes_colors_by_extruder() m_volumes.update_colors_by_extruder(m_config); } -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS void GLCanvas3D::update_toolbar_items_visibility() { ConfigOptionMode mode = wxGetApp().get_mode(); @@ -4144,7 +4143,6 @@ void GLCanvas3D::update_toolbar_items_visibility() m_toolbar.set_item_visible("splitvolumes", mode != comSimple); m_dirty = true; } -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS // Returns a Rect object denoting size and position of the Reset button used by a gizmo. // Returns in either screen or viewport coords. @@ -6056,9 +6054,7 @@ bool GLCanvas3D::_init_toolbar() enable_toolbar_item("add", true); -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS update_toolbar_items_visibility(); -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS return true; } diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 096789d4a..1659236c2 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -953,9 +953,7 @@ public: void update_volumes_colors_by_extruder(); -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS void update_toolbar_items_visibility(); -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS #if !ENABLE_IMGUI Rect get_gizmo_reset_rect(const GLCanvas3D& canvas, bool viewport) const; diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp index 144662c3f..1b8ccc165 100644 --- a/src/slic3r/GUI/GLToolbar.cpp +++ b/src/slic3r/GUI/GLToolbar.cpp @@ -38,9 +38,7 @@ GLToolbarItem::Data::Data() , tooltip("") , sprite_id(-1) , is_toggable(false) -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS , visible(true) -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS { } @@ -362,7 +360,6 @@ bool GLToolbar::is_item_disabled(const std::string& name) const return false; } -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS bool GLToolbar::is_item_visible(const std::string& name) const { for (GLToolbarItem* item : m_items) @@ -400,7 +397,6 @@ void GLToolbar::set_item_visible(const std::string& name, bool visible) } } -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS std::string GLToolbar::update_hover_state(const Vec2d& mouse_pos, GLCanvas3D& parent) { @@ -547,10 +543,8 @@ float GLToolbar::get_main_size() const float size = 2.0f * m_layout.border; for (unsigned int i = 0; i < (unsigned int)m_items.size(); ++i) { -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (!m_items[i]->is_visible()) continue; -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (m_items[i]->is_separator()) size += m_layout.separator_size; @@ -566,10 +560,8 @@ float GLToolbar::get_main_size() const float size = 2.0f * m_layout.border * m_layout.icons_scale; for (unsigned int i = 0; i < (unsigned int)m_items.size(); ++i) { -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (!m_items[i]->is_visible()) continue; -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (m_items[i]->is_separator()) size += m_layout.separator_size * m_layout.icons_scale; @@ -618,10 +610,8 @@ std::string GLToolbar::update_hover_state_horizontal(const Vec2d& mouse_pos, GLC for (GLToolbarItem* item : m_items) { -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (!item->is_visible()) continue; -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (item->is_separator()) left += separator_stride; @@ -724,10 +714,8 @@ std::string GLToolbar::update_hover_state_vertical(const Vec2d& mouse_pos, GLCan for (GLToolbarItem* item : m_items) { -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (!item->is_visible()) continue; -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (item->is_separator()) top -= separator_stride; @@ -832,10 +820,8 @@ int GLToolbar::contains_mouse_horizontal(const Vec2d& mouse_pos, const GLCanvas3 { ++id; -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (!item->is_visible()) continue; -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (item->is_separator()) left += separator_stride; @@ -890,10 +876,8 @@ int GLToolbar::contains_mouse_vertical(const Vec2d& mouse_pos, const GLCanvas3D& { ++id; -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (!item->is_visible()) continue; -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (item->is_separator()) top -= separator_stride; @@ -1050,10 +1034,8 @@ void GLToolbar::render_horizontal(const GLCanvas3D& parent) const // renders icons for (const GLToolbarItem* item : m_items) { -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (!item->is_visible()) continue; -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (item->is_separator()) left += separator_stride; @@ -1207,10 +1189,8 @@ void GLToolbar::render_vertical(const GLCanvas3D& parent) const // renders icons for (const GLToolbarItem* item : m_items) { -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (!item->is_visible()) continue; -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (item->is_separator()) top -= separator_stride; diff --git a/src/slic3r/GUI/GLToolbar.hpp b/src/slic3r/GUI/GLToolbar.hpp index e14f7b3bb..4ca72fc4a 100644 --- a/src/slic3r/GUI/GLToolbar.hpp +++ b/src/slic3r/GUI/GLToolbar.hpp @@ -58,9 +58,7 @@ public: unsigned int sprite_id; bool is_toggable; wxEventType action_event; -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS bool visible; -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS Data(); }; @@ -90,10 +88,8 @@ public: bool is_pressed() const { return (m_state == Pressed) || (m_state == HoverPressed); } bool is_toggable() const { return m_data.is_toggable; } -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS bool is_visible() const { return m_data.visible; } void set_visible(bool visible) { m_data.visible = visible; } -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS bool is_separator() const { return m_type == Separator; } void render(unsigned int tex_id, float left, float right, float bottom, float top, unsigned int tex_width, unsigned int tex_height, unsigned int icon_size) const; @@ -263,10 +259,8 @@ public: bool is_item_pressed(const std::string& name) const; bool is_item_disabled(const std::string& name) const; -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS bool is_item_visible(const std::string& name) const; void set_item_visible(const std::string& name, bool visible); -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS std::string update_hover_state(const Vec2d& mouse_pos, GLCanvas3D& parent); diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index 549dbd7e6..dff03b51a 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -137,13 +137,11 @@ void View3D::mirror_selection(Axis axis) m_canvas->mirror_selection(axis); } -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS void View3D::update_toolbar_items_visibility() { if (m_canvas != nullptr) m_canvas->update_toolbar_items_visibility(); } -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS void View3D::enable_toolbar_item(const std::string& name, bool enable) { diff --git a/src/slic3r/GUI/GUI_Preview.hpp b/src/slic3r/GUI/GUI_Preview.hpp index 6cd67013c..e4c3fb60d 100644 --- a/src/slic3r/GUI/GUI_Preview.hpp +++ b/src/slic3r/GUI/GUI_Preview.hpp @@ -60,9 +60,7 @@ public: void delete_selected(); void mirror_selection(Axis axis); -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS void update_toolbar_items_visibility(); -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS void enable_toolbar_item(const std::string& name, bool enable); int check_volumes_outside_state() const; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 24d366ced..bc2917fd0 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2763,10 +2763,8 @@ void Plater::priv::set_bed_shape(const Pointfs& shape) void Plater::priv::update_object_menu() { sidebar->obj_list()->append_menu_items_add_volume(&object_menu); -#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS if (view3D != nullptr) view3D->update_toolbar_items_visibility(); -#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS } // Plater / Public |