From 32ee95021070cd6c387424e5dc592add2d278103 Mon Sep 17 00:00:00 2001 From: Krrish777 <777krrish@gmail.com> Date: Sun, 4 Jan 2026 00:13:17 +0530 Subject: [PATCH] Improve UX for Rename Property Group with tooltip --- src/Gui/propertyeditor/PropertyEditor.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index 039a1f3481..7261d81337 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -955,6 +955,7 @@ void PropertyEditor::removeProperties(const std::unordered_set& void PropertyEditor::contextMenuEvent(QContextMenuEvent*) { QMenu menu; + menu.setToolTipsVisible(true); auto contextIndex = currentIndex(); std::unordered_set props = acquireSelectedProperties(); @@ -976,10 +977,21 @@ void PropertyEditor::contextMenuEvent(QContextMenuEvent*) // rename property group if (!props.empty() && std::all_of(props.begin(), props.end(), [](auto prop) { - return prop->testStatus(App::Property::PropDynamic) - && !boost::starts_with(prop->getName(), prop->getGroup()); + return prop->testStatus(App::Property::PropDynamic); })) { - menu.addAction(tr("Rename Property Group"))->setData(QVariant(MA_EditPropGroup)); + QAction* renameGroupAction = menu.addAction(tr("Rename Property Group")); + renameGroupAction->setData(QVariant(MA_EditPropGroup)); + + // Check if any property name starts with its group name + bool hasGroupPrefix = std::any_of(props.begin(), props.end(), [](auto prop) { + return boost::starts_with(prop->getName(), prop->getGroup()); + }); + + if (hasGroupPrefix) { + renameGroupAction->setEnabled(false); + renameGroupAction + ->setToolTip(tr("Cannot rename group: one or more properties have names that start with the group name")); + } } // rename property