diff --git a/src/utils/scene-item-selection.cpp b/src/utils/scene-item-selection.cpp index 35b1f2ea..98a5ecd1 100644 --- a/src/utils/scene-item-selection.cpp +++ b/src/utils/scene-item-selection.cpp @@ -369,10 +369,17 @@ void SceneItemSelectionWidget::SetShowAll(bool value) _hasAllEntry = value; } -void SceneItemSelectionWidget::SetShowAllSelectionType(AllSelectionType t) +void SceneItemSelectionWidget::SetShowAllSelectionType(AllSelectionType t, + bool resetSelection) { _allType = t; - _sceneItems->setCurrentIndex(0); + if (resetSelection) { + _sceneItems->setCurrentIndex(0); + } else { + auto count = _idx->count() - 1; + const QSignalBlocker b(_idx); + SetupIdxSelection(count > 0 ? count : 1); + } } void SceneItemSelectionWidget::SceneChanged(const SceneSelection &s) diff --git a/src/utils/scene-item-selection.hpp b/src/utils/scene-item-selection.hpp index f77f7492..1817dd55 100644 --- a/src/utils/scene-item-selection.hpp +++ b/src/utils/scene-item-selection.hpp @@ -51,7 +51,7 @@ public: void SetSceneItem(const SceneItemSelection &); void SetScene(const SceneSelection &); void SetShowAll(bool); - void SetShowAllSelectionType(AllSelectionType t); + void SetShowAllSelectionType(AllSelectionType t, bool resetSelection = true); signals: void SceneItemChanged(const SceneItemSelection &);