Skip to content

Commit

Permalink
Draft: improvements for gui_groups.py (FreeCAD#19312)
Browse files Browse the repository at this point in the history
* Draft: improvements for gui_groups.py

* All actions are handled as transactions to make them undoable.
* In the Draft_AutoGroup menu groups are separated from layers.
* The Draft_NewLayer.svg icon is used for the New layer option.
* Selecting that option prompts for a layer name and also activates that layer.
* Icons and separators have been added to the Draft_AddToGroup menu.
* The task panel of that command has been replaced with a QInputDialog.getText dialog for consistency.

* Forgot "..." somewhere

* Wrong year in the copyright notice.

* Minor tooltip tweaks
  • Loading branch information
Roy-043 authored Feb 4, 2025
1 parent 6b76430 commit 5528ec5
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 158 deletions.
9 changes: 7 additions & 2 deletions src/Mod/Draft/DraftGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,10 +1408,15 @@ def setStyleButton(self):
self.fontsize = fontsize

def popupMenu(self,llist,ilist=None,pos=None):
"""pops up a menu filled with the given list"""
"""pops up a menu filled with the given list

Check warning on line 1412 in src/Mod/Draft/DraftGui.py

View workflow job for this annotation

GitHub Actions / Lint / Lint

<-- trailing whitespace
"---" in llist inserts a separator
"""
self.groupmenu = QtWidgets.QMenu()
for i,l in enumerate(llist):
if ilist:
if "---" in l:
self.groupmenu.addSeparator()
elif ilist:
self.groupmenu.addAction(ilist[i],l)
else:
self.groupmenu.addAction(l)
Expand Down
Loading

0 comments on commit 5528ec5

Please sign in to comment.