From 350eb6d3d4131e65686eed5d5b772bd3c99e23d0 Mon Sep 17 00:00:00 2001 From: tetektoza Date: Fri, 5 Sep 2025 01:41:51 +0200 Subject: [PATCH] Gui: Add variable names for grouping thresholds in SelectionView --- src/Gui/Selection/SelectionView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Gui/Selection/SelectionView.cpp b/src/Gui/Selection/SelectionView.cpp index 1517a5d4a2..eedf9fa925 100644 --- a/src/Gui/Selection/SelectionView.cpp +++ b/src/Gui/Selection/SelectionView.cpp @@ -1023,17 +1023,19 @@ void SelectionMenu::addWholeObjectSelection(const PickData &sel, App::DocumentOb bool SelectionMenu::shouldGroupMenu(const SubMenuInfo &info) { - if (info.items.size() > 20) { + constexpr std::size_t MAX_MENU_ITEMS_BEFORE_GROUPING = 20; + if (info.items.size() > MAX_MENU_ITEMS_BEFORE_GROUPING) { return true; } std::size_t objCount = 0; std::size_t count = 0; + constexpr std::size_t MAX_SELECTION_COUNT_BEFORE_GROUPING = 5; for (auto &objectLabelEntry : info.items) { objCount += objectLabelEntry.second.size(); for (auto &objectPathEntry : objectLabelEntry.second) count += objectPathEntry.second.indices.size(); - if (count > 5 && objCount > 1) { + if (count > MAX_SELECTION_COUNT_BEFORE_GROUPING && objCount > 1) { return true; } }