Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2019-07-10 12:59:25 +0300
committerEnrico Turri <enricoturri@seznam.cz>2019-07-10 12:59:25 +0300
commit40a1f31e847e8613c7b588e6a026b1dcdec317ad (patch)
treecee2ef5eb501fda107e0d712f26ef0a6bbeae533 /src/slic3r
parentbaece78390327068526182413fd5431f90f95975 (diff)
Disable remaining toolbar items when one of them is toggable and pressed
Diffstat (limited to 'src/slic3r')
-rw-r--r--src/slic3r/GUI/GLToolbar.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp
index 78e10c4f1..8c9751086 100644
--- a/src/slic3r/GUI/GLToolbar.cpp
+++ b/src/slic3r/GUI/GLToolbar.cpp
@@ -1396,9 +1396,15 @@ bool GLToolbar::update_items_enabled_state()
{
bool ret = false;
- for (GLToolbarItem* item : m_items)
+ for (unsigned int i = 0; i < (unsigned int)m_items.size(); ++i)
{
+ GLToolbarItem* item = m_items[i];
ret |= item->update_enabled_state();
+ if (item->is_enabled() && (m_pressed_toggable_id != -1) && (m_pressed_toggable_id != i))
+ {
+ ret = true;
+ item->set_state(GLToolbarItem::Disabled);
+ }
}
if (ret)