mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 08:35:54 +08:00
Fixed blurring of the Toolbars
This commit is contained in:
parent
986b0e1cdb
commit
3bd0728bc6
@ -5974,36 +5974,41 @@ void GLCanvas3D::_render_sequential_clearance()
|
||||
m_sequential_print_clearance.render();
|
||||
}
|
||||
|
||||
void GLCanvas3D::_check_and_update_toolbar_icon_scale()
|
||||
{
|
||||
// Don't update a toolbar scale, when we are on a Preview
|
||||
if (wxGetApp().plater()->is_preview_shown())
|
||||
return;
|
||||
|
||||
const float scale = wxGetApp().toolbar_icon_scale();
|
||||
bool GLCanvas3D::check_toolbar_icon_size(float init_scale, float& new_scale_to_save, int counter/* = 3*/)
|
||||
{
|
||||
const Size cnv_size = get_canvas_size();
|
||||
|
||||
#if ENABLE_RETINA_GL
|
||||
float max_scale = m_retina_helper->get_scale_factor();
|
||||
#else
|
||||
float max_scale = 0.1f * wxGetApp().em_unit();
|
||||
#endif // ENABLE_RETINA_GL
|
||||
|
||||
float scale = init_scale * max_scale;
|
||||
|
||||
int size = int(GLToolbar::Default_Icons_Size * scale);
|
||||
int gizmo_size = int(GLGizmosManager::Default_Icons_Size * scale);
|
||||
|
||||
// Set current size for all top toolbars. It will be used for next calculations
|
||||
// Set current scale for all top toolbars. It will be used for next calculations
|
||||
|
||||
GLToolbar& collapse_toolbar = wxGetApp().plater()->get_collapse_toolbar();
|
||||
#if ENABLE_RETINA_GL
|
||||
const float sc = m_retina_helper->get_scale_factor() * scale;
|
||||
m_main_toolbar.set_scale(sc);
|
||||
m_undoredo_toolbar.set_scale(sc);
|
||||
collapse_toolbar.set_scale(sc);
|
||||
size *= int(m_retina_helper->get_scale_factor());
|
||||
gizmo_size *= int(m_retina_helper->get_scale_factor());
|
||||
#else
|
||||
m_main_toolbar.set_icons_size(size);
|
||||
m_undoredo_toolbar.set_icons_size(size);
|
||||
collapse_toolbar.set_icons_size(size);
|
||||
#endif // ENABLE_RETINA_GL
|
||||
GLToolbar& view_toolbar = wxGetApp().plater()->get_view_toolbar();
|
||||
|
||||
if (!is_approx(scale, m_main_toolbar.get_scale(), 0.015f)) {
|
||||
m_main_toolbar.set_scale(scale);
|
||||
m_undoredo_toolbar.set_scale(scale);
|
||||
collapse_toolbar.set_scale(scale);
|
||||
view_toolbar.set_scale(scale);
|
||||
m_gizmos.set_overlay_scale(scale);
|
||||
|
||||
view_toolbar.set_icons_size(gizmo_size);
|
||||
}
|
||||
|
||||
const float top_tb_width = m_main_toolbar.get_width() + m_undoredo_toolbar.get_width() + collapse_toolbar.get_width();
|
||||
int items_cnt = m_main_toolbar.get_visible_items_cnt() + m_undoredo_toolbar.get_visible_items_cnt() + collapse_toolbar.get_visible_items_cnt();
|
||||
float items_cnt = float(m_main_toolbar.get_visible_items_cnt() + m_undoredo_toolbar.get_visible_items_cnt() + collapse_toolbar.get_visible_items_cnt());
|
||||
const float noitems_width = top_tb_width - float(size) * items_cnt; // width of separators and borders in top toolbars
|
||||
items_cnt += 1.6; // +1.6 means a place for some minimal margin between toolbars
|
||||
|
||||
// calculate scale needed for items in all top toolbars
|
||||
// the std::max() is there because on some Linux dialects/virtual machines this code is called when the canvas has not been properly initialized yet,
|
||||
@ -6023,11 +6028,30 @@ void GLCanvas3D::_check_and_update_toolbar_icon_scale()
|
||||
|
||||
// set minimum scale as a auto scale for the toolbars
|
||||
float new_scale = std::min(new_h_scale, new_v_scale);
|
||||
#if ENABLE_RETINA_GL
|
||||
new_scale /= m_retina_helper->get_scale_factor();
|
||||
#endif
|
||||
if (fabs(new_scale - scale) > 0.015) // scale is changed by 1.5% and more
|
||||
wxGetApp().set_auto_toolbar_icon_scale(new_scale);
|
||||
|
||||
new_scale_to_save = std::min(new_scale / max_scale, 1.f);
|
||||
|
||||
if (is_approx(init_scale, new_scale_to_save, 0.015f) || counter == 0)
|
||||
return true;
|
||||
|
||||
// scale is changed by 1.5% and more
|
||||
init_scale = new_scale_to_save;
|
||||
counter--;
|
||||
return check_toolbar_icon_size(init_scale, new_scale_to_save, counter);
|
||||
}
|
||||
|
||||
|
||||
void GLCanvas3D::_check_and_update_toolbar_icon_scale()
|
||||
{
|
||||
// Don't update a toolbar scale, when we are on a Preview
|
||||
if (wxGetApp().plater()->is_preview_shown())
|
||||
return;
|
||||
|
||||
const float init_scale = wxGetApp().toolbar_icon_scale();
|
||||
float new_scale_to_save;
|
||||
if (check_toolbar_icon_size(init_scale, new_scale_to_save) &&
|
||||
!is_approx(init_scale, new_scale_to_save, 0.015f))
|
||||
wxGetApp().set_auto_toolbar_icon_scale(new_scale_to_save);
|
||||
}
|
||||
|
||||
void GLCanvas3D::_render_overlays()
|
||||
@ -6095,17 +6119,6 @@ void GLCanvas3D::_render_volumes_for_picking(const Camera& camera) const
|
||||
|
||||
void GLCanvas3D::_render_gizmos_overlay()
|
||||
{
|
||||
#if ENABLE_RETINA_GL
|
||||
// m_gizmos.set_overlay_scale(m_retina_helper->get_scale_factor());
|
||||
const float scale = m_retina_helper->get_scale_factor()*wxGetApp().toolbar_icon_scale();
|
||||
m_gizmos.set_overlay_scale(scale); //! #ys_FIXME_experiment
|
||||
#else
|
||||
// m_gizmos.set_overlay_scale(m_canvas->GetContentScaleFactor());
|
||||
// m_gizmos.set_overlay_scale(wxGetApp().em_unit()*0.1f);
|
||||
const float size = int(GLGizmosManager::Default_Icons_Size * wxGetApp().toolbar_icon_scale());
|
||||
m_gizmos.set_overlay_icon_size(size); //! #ys_FIXME_experiment
|
||||
#endif /* __WXMSW__ */
|
||||
|
||||
m_gizmos.render_overlay();
|
||||
|
||||
if (m_gizmo_highlighter.m_render_arrow)
|
||||
@ -6164,19 +6177,6 @@ void GLCanvas3D::_render_view_toolbar() const
|
||||
{
|
||||
GLToolbar& view_toolbar = wxGetApp().plater()->get_view_toolbar();
|
||||
|
||||
#if ENABLE_RETINA_GL
|
||||
const float scale = m_retina_helper->get_scale_factor() * wxGetApp().toolbar_icon_scale();
|
||||
#if __APPLE__
|
||||
view_toolbar.set_scale(scale);
|
||||
#else // if GTK3
|
||||
const float size = int(GLGizmosManager::Default_Icons_Size * scale);
|
||||
view_toolbar.set_icons_size(size);
|
||||
#endif // __APPLE__
|
||||
#else
|
||||
const float size = int(GLGizmosManager::Default_Icons_Size * wxGetApp().toolbar_icon_scale());
|
||||
view_toolbar.set_icons_size(size);
|
||||
#endif // ENABLE_RETINA_GL
|
||||
|
||||
const Size cnv_size = get_canvas_size();
|
||||
// places the toolbar on the bottom-left corner of the 3d scene
|
||||
const float top = -0.5f * (float)cnv_size.get_height() + view_toolbar.get_height();
|
||||
|
@ -1053,6 +1053,7 @@ private:
|
||||
void _render_gcode_cog() { m_gcode_viewer.render_cog(); }
|
||||
void _render_selection();
|
||||
void _render_sequential_clearance();
|
||||
bool check_toolbar_icon_size(float init_scale, float& new_scale_to_save, int counter = 3);
|
||||
#if ENABLE_RENDER_SELECTION_CENTER
|
||||
void _render_selection_center() { m_selection.render_center(m_gizmos.is_dragging()); }
|
||||
#endif // ENABLE_RENDER_SELECTION_CENTER
|
||||
|
@ -145,7 +145,7 @@ BackgroundTexture::Metadata::Metadata()
|
||||
{
|
||||
}
|
||||
|
||||
const float GLToolbar::Default_Icons_Size = 35.f;// 40.0f;
|
||||
const float GLToolbar::Default_Icons_Size = 36.f;// 40.0f;
|
||||
|
||||
GLToolbar::Layout::Layout()
|
||||
: type(Horizontal)
|
||||
@ -256,6 +256,12 @@ void GLToolbar::set_scale(float scale)
|
||||
{
|
||||
if (m_layout.scale != scale) {
|
||||
m_layout.scale = scale;
|
||||
|
||||
m_layout.icons_size = int(Default_Icons_Size * scale);
|
||||
m_layout.border = int(5.f * scale);
|
||||
m_layout.separator_size = int(5.f * scale);
|
||||
m_layout.gap_size = int(6.f * scale);
|
||||
|
||||
m_layout.dirty = true;
|
||||
m_icons_texture_dirty = true;
|
||||
}
|
||||
@ -559,12 +565,12 @@ float GLToolbar::get_width_horizontal() const
|
||||
|
||||
float GLToolbar::get_width_vertical() const
|
||||
{
|
||||
return (2.0f * (m_layout.border + m_layout.gap_size) + m_layout.icons_size) * m_layout.scale;
|
||||
return (2.0f * (m_layout.border + m_layout.gap_size)) + m_layout.icons_size;
|
||||
}
|
||||
|
||||
float GLToolbar::get_height_horizontal() const
|
||||
{
|
||||
return (2.0f * (m_layout.border + m_layout.gap_size) + m_layout.icons_size) * m_layout.scale;
|
||||
return (2.0f * (m_layout.border + m_layout.gap_size)) + m_layout.icons_size;
|
||||
}
|
||||
|
||||
float GLToolbar::get_height_vertical() const
|
||||
@ -586,7 +592,7 @@ float GLToolbar::get_main_size() const
|
||||
size += (float)m_layout.icons_size + 2.f * m_layout.gap_size;
|
||||
}
|
||||
|
||||
return size * m_layout.scale;
|
||||
return size;
|
||||
}
|
||||
|
||||
int GLToolbar::get_visible_items_cnt() const
|
||||
@ -672,10 +678,10 @@ void GLToolbar::update_hover_state_horizontal(const Vec2d& mouse_pos, GLCanvas3D
|
||||
const Size cnv_size = parent.get_canvas_size();
|
||||
const Vec2d scaled_mouse_pos((mouse_pos.x() - 0.5 * (double)cnv_size.get_width()), (0.5 * (double)cnv_size.get_height() - mouse_pos.y()));
|
||||
|
||||
const float icons_size = m_layout.icons_size * m_layout.scale;
|
||||
const float separator_size = m_layout.separator_size * m_layout.scale;
|
||||
const float gap_size = m_layout.gap_size * m_layout.scale;
|
||||
const float border = m_layout.border * m_layout.scale;
|
||||
const float icons_size = m_layout.icons_size;
|
||||
const float separator_size = m_layout.separator_size;
|
||||
const float gap_size = m_layout.gap_size;
|
||||
const float border = m_layout.border;
|
||||
|
||||
const float separator_stride = separator_size + gap_size;
|
||||
const float icon_stride = icons_size + 2 * gap_size;
|
||||
@ -771,10 +777,10 @@ void GLToolbar::update_hover_state_vertical(const Vec2d& mouse_pos, GLCanvas3D&
|
||||
const Size cnv_size = parent.get_canvas_size();
|
||||
const Vec2d scaled_mouse_pos((mouse_pos.x() - 0.5 * (double)cnv_size.get_width()), (0.5 * (double)cnv_size.get_height() - mouse_pos.y()));
|
||||
|
||||
const float icons_size = m_layout.icons_size * m_layout.scale;
|
||||
const float separator_size = m_layout.separator_size * m_layout.scale;
|
||||
const float gap_size = m_layout.gap_size * m_layout.scale;
|
||||
const float border = m_layout.border * m_layout.scale;
|
||||
const float icons_size = m_layout.icons_size;
|
||||
const float separator_size = m_layout.separator_size;
|
||||
const float gap_size = m_layout.gap_size;
|
||||
const float border = m_layout.border;
|
||||
|
||||
const float separator_stride = separator_size + gap_size;
|
||||
const float icon_stride = icons_size + gap_size;
|
||||
@ -895,10 +901,10 @@ int GLToolbar::contains_mouse_horizontal(const Vec2d& mouse_pos, const GLCanvas3
|
||||
const Size cnv_size = parent.get_canvas_size();
|
||||
const Vec2d scaled_mouse_pos((mouse_pos.x() - 0.5 * (double)cnv_size.get_width()), (0.5 * (double)cnv_size.get_height() - mouse_pos.y()));
|
||||
|
||||
const float icons_size = m_layout.icons_size * m_layout.scale;
|
||||
const float separator_size = m_layout.separator_size * m_layout.scale;
|
||||
const float gap_size = m_layout.gap_size * m_layout.scale;
|
||||
const float border = m_layout.border * m_layout.scale;
|
||||
const float icons_size = m_layout.icons_size;
|
||||
const float separator_size = m_layout.separator_size;
|
||||
const float gap_size = m_layout.gap_size;
|
||||
const float border = m_layout.border;
|
||||
|
||||
float left = m_layout.left + border + gap_size;
|
||||
const float top = m_layout.top - border - gap_size;
|
||||
@ -969,10 +975,10 @@ int GLToolbar::contains_mouse_vertical(const Vec2d& mouse_pos, const GLCanvas3D&
|
||||
const Size cnv_size = parent.get_canvas_size();
|
||||
const Vec2d scaled_mouse_pos((mouse_pos.x() - 0.5 * (double)cnv_size.get_width()), (0.5 * (double)cnv_size.get_height() - mouse_pos.y()));
|
||||
|
||||
const float icons_size = m_layout.icons_size * m_layout.scale;
|
||||
const float separator_size = m_layout.separator_size * m_layout.scale;
|
||||
const float gap_size = m_layout.gap_size * m_layout.scale;
|
||||
const float border = m_layout.border * m_layout.scale;
|
||||
const float icons_size = m_layout.icons_size;
|
||||
const float separator_size = m_layout.separator_size;
|
||||
const float gap_size = m_layout.gap_size;
|
||||
const float border = m_layout.border;
|
||||
|
||||
const float left = m_layout.left + border;
|
||||
float top = m_layout.top - border;
|
||||
@ -1131,12 +1137,12 @@ void GLToolbar::render_arrow(const GLCanvas3D& parent, GLToolbarItem* highlighte
|
||||
const float inv_cnv_w = 1.0f / cnv_w;
|
||||
const float inv_cnv_h = 1.0f / cnv_h;
|
||||
|
||||
const float icons_size_x = 2.0f * m_layout.icons_size * m_layout.scale * inv_cnv_w;
|
||||
const float icons_size_y = 2.0f * m_layout.icons_size * m_layout.scale * inv_cnv_h;
|
||||
const float separator_size = 2.0f * m_layout.separator_size * m_layout.scale * inv_cnv_w;
|
||||
const float gap_size = 2.0f * m_layout.gap_size * m_layout.scale * inv_cnv_w;
|
||||
const float border_x = 2.0f * m_layout.border * m_layout.scale * inv_cnv_w;
|
||||
const float border_y = 2.0f * m_layout.border * m_layout.scale * inv_cnv_h;
|
||||
const float icons_size_x = 2.0f * m_layout.icons_size * inv_cnv_w;
|
||||
const float icons_size_y = 2.0f * m_layout.icons_size * inv_cnv_h;
|
||||
const float separator_size = 2.0f * m_layout.separator_size * inv_cnv_w;
|
||||
const float gap_size = 2.0f * m_layout.gap_size * inv_cnv_w;
|
||||
const float border_x = 2.0f * m_layout.border * inv_cnv_w;
|
||||
const float border_y = 2.0f * m_layout.border * inv_cnv_h;
|
||||
|
||||
const float separator_stride = separator_size + gap_size;
|
||||
const float icon_stride = icons_size_x + gap_size;
|
||||
@ -1169,8 +1175,8 @@ void GLToolbar::render_arrow(const GLCanvas3D& parent, GLToolbarItem* highlighte
|
||||
const float arr_tex_width = (float)m_arrow_texture.get_width();
|
||||
const float arr_tex_height = (float)m_arrow_texture.get_height();
|
||||
if (tex_id != 0 && arr_tex_width > 0.0f && arr_tex_height > 0.0f) {
|
||||
const float arrow_size_x = 2.0f * m_layout.scale * arr_tex_width * inv_cnv_w;
|
||||
const float arrow_size_y = 2.0f * m_layout.scale * arr_tex_height * inv_cnv_h;
|
||||
const float arrow_size_x = 2.0f * arr_tex_width * inv_cnv_w;
|
||||
const float arrow_size_y = 2.0f * arr_tex_height * inv_cnv_h;
|
||||
|
||||
const float left_uv = 0.0f;
|
||||
const float right_uv = 1.0f;
|
||||
@ -1203,13 +1209,13 @@ void GLToolbar::render_horizontal(const GLCanvas3D& parent)
|
||||
const float inv_cnv_w = 1.0f / cnv_w;
|
||||
const float inv_cnv_h = 1.0f / cnv_h;
|
||||
|
||||
const float icons_size_x = 2.0f * m_layout.icons_size * m_layout.scale * inv_cnv_w;
|
||||
const float icons_size_y = 2.0f * m_layout.icons_size * m_layout.scale * inv_cnv_h;
|
||||
const float separator_size = 2.0f * m_layout.separator_size * m_layout.scale * inv_cnv_w;
|
||||
const float gap_size_x = 2.0f * m_layout.gap_size * m_layout.scale * inv_cnv_w;
|
||||
const float gap_size_y = 2.0f * m_layout.gap_size * m_layout.scale * inv_cnv_h;
|
||||
const float border_w = 2.0f * m_layout.border * m_layout.scale * inv_cnv_w;
|
||||
const float border_h = 2.0f * m_layout.border * m_layout.scale * inv_cnv_h;
|
||||
const float icons_size_x = 2.0f * m_layout.icons_size * inv_cnv_w;
|
||||
const float icons_size_y = 2.0f * m_layout.icons_size * inv_cnv_h;
|
||||
const float separator_size = 2.0f * m_layout.separator_size * inv_cnv_w;
|
||||
const float gap_size_x = 2.0f * m_layout.gap_size * inv_cnv_w;
|
||||
const float gap_size_y = 2.0f * m_layout.gap_size * inv_cnv_h;
|
||||
const float border_w = 2.0f * m_layout.border * inv_cnv_w;
|
||||
const float border_h = 2.0f * m_layout.border * inv_cnv_h;
|
||||
const float width = 2.0f * get_width() * inv_cnv_w;
|
||||
const float height = 2.0f * get_height() * inv_cnv_h;
|
||||
|
||||
@ -1246,7 +1252,7 @@ void GLToolbar::render_horizontal(const GLCanvas3D& parent)
|
||||
top - icons_size_y - margin_h,
|
||||
border_w, border_h);
|
||||
|
||||
item->render(parent, tex_id, left, left + icons_size_x, top - icons_size_y, top, (unsigned int)tex_width, (unsigned int)tex_height, (unsigned int)(m_layout.icons_size * m_layout.scale));
|
||||
item->render(parent, tex_id, left, left + icons_size_x, top - icons_size_y, top, (unsigned int)tex_width, (unsigned int)tex_height, (unsigned int)(m_layout.icons_size));
|
||||
left += icon_stride;
|
||||
}
|
||||
}
|
||||
@ -1271,13 +1277,13 @@ void GLToolbar::render_vertical(const GLCanvas3D& parent)
|
||||
const float inv_cnv_w = 1.0f / cnv_w;
|
||||
const float inv_cnv_h = 1.0f / cnv_h;
|
||||
|
||||
const float icons_size_x = 2.0f * m_layout.icons_size * m_layout.scale * inv_cnv_w;
|
||||
const float icons_size_y = 2.0f * m_layout.icons_size * m_layout.scale * inv_cnv_h;
|
||||
const float separator_size = 2.0f * m_layout.separator_size * m_layout.scale * inv_cnv_h;
|
||||
const float gap_size_x = 2.0f * m_layout.gap_size * m_layout.scale * inv_cnv_w;
|
||||
const float gap_size_y = 2.0f * m_layout.gap_size * m_layout.scale * inv_cnv_h;
|
||||
const float border_w = 2.0f * m_layout.border * m_layout.scale * inv_cnv_w;
|
||||
const float border_h = 2.0f * m_layout.border * m_layout.scale * inv_cnv_h;
|
||||
const float icons_size_x = 2.0f * m_layout.icons_size * inv_cnv_w;
|
||||
const float icons_size_y = 2.0f * m_layout.icons_size * inv_cnv_h;
|
||||
const float separator_size = 2.0f * m_layout.separator_size * inv_cnv_h;
|
||||
const float gap_size_x = 2.0f * m_layout.gap_size * inv_cnv_w;
|
||||
const float gap_size_y = 2.0f * m_layout.gap_size * inv_cnv_h;
|
||||
const float border_w = 2.0f * m_layout.border * inv_cnv_w;
|
||||
const float border_h = 2.0f * m_layout.border * inv_cnv_h;
|
||||
const float width = 2.0f * get_width() * inv_cnv_w;
|
||||
const float height = 2.0f * get_height() * inv_cnv_h;
|
||||
|
||||
@ -1302,7 +1308,7 @@ void GLToolbar::render_vertical(const GLCanvas3D& parent)
|
||||
if (item->is_separator())
|
||||
top -= separator_stride;
|
||||
else {
|
||||
item->render(parent, tex_id, left, left + icons_size_x, top - icons_size_y, top, (unsigned int)tex_width, (unsigned int)tex_height, (unsigned int)(m_layout.icons_size * m_layout.scale));
|
||||
item->render(parent, tex_id, left, left + icons_size_x, top - icons_size_y, top, (unsigned int)tex_width, (unsigned int)tex_height, (unsigned int)(m_layout.icons_size));
|
||||
top -= icon_stride;
|
||||
}
|
||||
}
|
||||
@ -1340,7 +1346,7 @@ bool GLToolbar::generate_icons_texture()
|
||||
states.push_back({ 1, false }); // HighlightedHidden
|
||||
}
|
||||
|
||||
unsigned int sprite_size_px = (unsigned int)(m_layout.icons_size * m_layout.scale);
|
||||
unsigned int sprite_size_px = (unsigned int)(m_layout.icons_size);
|
||||
// // force even size
|
||||
// if (sprite_size_px % 2 != 0)
|
||||
// sprite_size_px += 1;
|
||||
|
@ -294,6 +294,8 @@ public:
|
||||
void set_icons_size(float size);
|
||||
void set_scale(float scale);
|
||||
|
||||
float get_scale() const { return m_layout.scale; }
|
||||
|
||||
bool is_enabled() const { return m_enabled; }
|
||||
void set_enabled(bool enable) { m_enabled = enable; }
|
||||
|
||||
|
@ -1874,20 +1874,12 @@ float GUI_App::toolbar_icon_scale(const bool is_limited/* = false*/) const
|
||||
if (is_limited && int_val < 50)
|
||||
int_val = 50;
|
||||
|
||||
return 0.01f * int_val * icon_sc;
|
||||
return 0.01f * int_val;
|
||||
}
|
||||
|
||||
void GUI_App::set_auto_toolbar_icon_scale(float scale) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
const float icon_sc = 1.0f; // for Retina display will be used its own scale
|
||||
#else
|
||||
const float icon_sc = m_em_unit * 0.1f;
|
||||
#endif // __APPLE__
|
||||
|
||||
long int_val = std::min(int(std::lround(scale / icon_sc * 100)), 100);
|
||||
std::string val = std::to_string(int_val);
|
||||
|
||||
std::string val = std::to_string(int(std::lround(scale * 100)));
|
||||
app_config->set("auto_toolbar_size", val);
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
const float GLGizmosManager::Default_Icons_Size = 48;// 64;
|
||||
const float GLGizmosManager::Default_Icons_Size = 52;// 64;
|
||||
|
||||
GLGizmosManager::GLGizmosManager(GLCanvas3D& parent)
|
||||
: m_parent(parent)
|
||||
|
@ -99,11 +99,11 @@ private:
|
||||
|
||||
float stride_y() const { return icons_size + gap_y;}
|
||||
|
||||
float scaled_icons_size() const { return scale * icons_size; }
|
||||
float scaled_border() const { return scale * border; }
|
||||
float scaled_gap_x() const { return scale * gap_x; }
|
||||
float scaled_gap_y() const { return scale * gap_y; }
|
||||
float scaled_stride_y() const { return scale * stride_y(); }
|
||||
float scaled_icons_size() const { return int(scale * icons_size); }
|
||||
float scaled_border() const { return int(scale * border); }
|
||||
float scaled_gap_x() const { return int(scale * gap_x); }
|
||||
float scaled_gap_y() const { return int(scale * gap_y); }
|
||||
float scaled_stride_y() const { return scaled_icons_size() + scaled_gap_y(); }
|
||||
};
|
||||
|
||||
GLCanvas3D& m_parent;
|
||||
|
@ -643,10 +643,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||
view3D = new View3D(q, bed, &model, config, &background_process);
|
||||
preview = new Preview(q, bed, &model, config, &background_process, &gcode_result, [this]() { schedule_background_process(); });
|
||||
|
||||
#ifdef __APPLE__
|
||||
// set default view_toolbar icons size equal to GLGizmosManager::Default_Icons_Size
|
||||
view_toolbar.set_icons_size(GLGizmosManager::Default_Icons_Size);
|
||||
#endif // __APPLE__
|
||||
|
||||
panels.push_back(view3D);
|
||||
panels.push_back(preview);
|
||||
|
Loading…
x
Reference in New Issue
Block a user