diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index b2b77d490e..da87a795af 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -735,6 +735,10 @@ void GLGizmoEmboss::initialize() ImVec2(cfg.minimal_window_size.x, cfg.minimal_window_size.y + advance_height); + cfg.minimal_window_size_with_collections = + ImVec2(cfg.minimal_window_size_with_advance.x, + cfg.minimal_window_size_with_advance.y + input_height); + int max_style_image_width = cfg.max_style_name_width /2 - 2 * style.FramePadding.x; int max_style_image_height = 1.5 * input_height; @@ -2811,9 +2815,9 @@ void GLGizmoEmboss::set_minimal_window_size(bool is_advance_edit_style) const ImVec2 &GLGizmoEmboss::get_minimal_window_size() const { - return m_is_advanced_edit_style ? - m_gui_cfg->minimal_window_size_with_advance : - m_gui_cfg->minimal_window_size; + return (!m_is_advanced_edit_style) ? m_gui_cfg->minimal_window_size : + ((!m_style_manager.has_collections())? m_gui_cfg->minimal_window_size_with_advance : + m_gui_cfg->minimal_window_size_with_collections); } #ifdef ALLOW_ADD_FONT_BY_OS_SELECTOR diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp index c34ca19b82..b81716eecb 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.hpp @@ -178,6 +178,7 @@ private: // Zero means it is calculated in init function ImVec2 minimal_window_size = ImVec2(0, 0); ImVec2 minimal_window_size_with_advance = ImVec2(0, 0); + ImVec2 minimal_window_size_with_collections = ImVec2(0, 0); float input_width = 0.f; float delete_pos_x = 0.f; float max_style_name_width = 0.f; diff --git a/src/slic3r/Utils/EmbossStyleManager.hpp b/src/slic3r/Utils/EmbossStyleManager.hpp index d1cb95d1fb..0012bcd3cf 100644 --- a/src/slic3r/Utils/EmbossStyleManager.hpp +++ b/src/slic3r/Utils/EmbossStyleManager.hpp @@ -112,6 +112,8 @@ public: const std::optional &get_wx_font() const { return m_style_cache.wx_font; } const std::optional &get_stored_wx_font() const { return m_style_cache.stored_wx_font; } Emboss::FontFileWithCache &get_font_file_with_cache() { return m_style_cache.font_file; } + bool has_collections() const { return m_style_cache.font_file.font_file != nullptr && + m_style_cache.font_file.font_file->infos.size() > 1; } // True when activ style has same name as some of stored style bool exist_stored_style() const { return m_style_cache.style_index != std::numeric_limits::max(); }