ENABLE_MODE_AWARE_TOOLBAR_ITEMS set as default

This commit is contained in:
Enrico Turri 2019-02-28 12:21:36 +01:00
parent 9ff8cd01b3
commit e5a2c0a8c8
8 changed files with 0 additions and 46 deletions

View file

@ -42,14 +42,6 @@
#define ENABLE_VOLUMES_CENTERING_FIXES (1 && ENABLE_1_42_0_ALPHA4)
//====================
// 1.42.0.alpha5 techs
//====================
#define ENABLE_1_42_0_ALPHA5 1
// Toolbar items hidden/shown in dependence of the user mode
#define ENABLE_MODE_AWARE_TOOLBAR_ITEMS (1 && ENABLE_1_42_0_ALPHA5)
//====================
// 1.42.0.alpha7 techs
//====================

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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)
{

View file

@ -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;

View file

@ -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