Skip to content

Commit

Permalink
Draft: improvements for gui_groups.py
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Roy-043 committed Jan 29, 2025
1 parent 1e05c59 commit 52d2b19
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 @@ -1421,10 +1421,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
"---" 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 52d2b19

Please sign in to comment.