mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-20 17:48:06 +08:00
Disable remaining toolbar items when one of them is toggable and pressed
This commit is contained in:
parent
baece78390
commit
40a1f31e84
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user