diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-02-26 14:56:13 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-02-26 14:56:13 +0300 |
commit | a8610f990eb47eadbf67fc7ae2381ff32a18a213 (patch) | |
tree | 0be65f8ea69c6fc8ff2a1f2df8528f18c2ad2f8d /src/slic3r/GUI/GLToolbar.cpp | |
parent | 987a83bb0c3f172dd349f8443695fa24d8195eb0 (diff) |
Automatic generation of variants of icons for toolbars and gizmos
Diffstat (limited to 'src/slic3r/GUI/GLToolbar.cpp')
-rw-r--r-- | src/slic3r/GUI/GLToolbar.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp index 5f5350299..144662c3f 100644 --- a/src/slic3r/GUI/GLToolbar.cpp +++ b/src/slic3r/GUI/GLToolbar.cpp @@ -124,8 +124,15 @@ GLToolbar::Layout::Layout() { } +#if ENABLE_SVG_ICONS +GLToolbar::GLToolbar(GLToolbar::EType type, const std::string& name) +#else GLToolbar::GLToolbar(GLToolbar::EType type) +#endif // ENABLE_SVG_ICONS : m_type(type) +#if ENABLE_SVG_ICONS + , m_name(name) +#endif // ENABLE_SVG_ICONS , m_enabled(false) #if ENABLE_SVG_ICONS , m_icons_texture_dirty(true) @@ -1231,7 +1238,25 @@ bool GLToolbar::generate_icons_texture() const filenames.push_back(path + icon_filename); } - bool res = m_icons_texture.load_from_svg_files_as_sprites_array(filenames, GLToolbarItem::Num_States, (unsigned int)(m_layout.icons_size * m_layout.scale)); + std::vector<std::pair<int, bool>> states; + if (m_name == "Top") + { + states.push_back(std::make_pair(1, false)); + states.push_back(std::make_pair(0, false)); + states.push_back(std::make_pair(2, false)); + states.push_back(std::make_pair(0, false)); + states.push_back(std::make_pair(0, false)); + } + else if (m_name == "View") + { + states.push_back(std::make_pair(1, false)); + states.push_back(std::make_pair(1, true)); + states.push_back(std::make_pair(1, false)); + states.push_back(std::make_pair(0, false)); + states.push_back(std::make_pair(1, true)); + } + + bool res = m_icons_texture.load_from_svg_files_as_sprites_array(filenames, states, (unsigned int)(m_layout.icons_size * m_layout.scale)); if (res) m_icons_texture_dirty = false; |