Skip to content

Commit

Permalink
Path: Add icons to feature tabs
Browse files Browse the repository at this point in the history
Add Base Geometry, Heights, Depths, and Operation icons on the tabs in the Tasks Window editor.
  • Loading branch information
Russ4262 committed Jun 18, 2020
1 parent 56f6736 commit 33a1804
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Mod/Path/PathScripts/PathOpGui.py
Expand Up @@ -415,6 +415,8 @@ def __init__(self, obj, features):
super(TaskPanelBaseGeometryPage, self).__init__(obj, features)

self.panelTitle = 'Base Geometry'
self.OpIcon = ":/icons/Path-BaseGeometry.svg"
self.setIcon(self.OpIcon)

def getForm(self):
panel = FreeCADGui.PySideUic.loadUi(":/panels/PageBaseGeometryEdit.ui")
Expand Down Expand Up @@ -723,6 +725,8 @@ def __init__(self, obj, features):
self.clearanceHeight = None
self.safeHeight = None
self.panelTitle = 'Heights'
self.OpIcon = ":/icons/Path-Heights.svg"
self.setIcon(self.OpIcon)

def getForm(self):
return FreeCADGui.PySideUic.loadUi(":/panels/PageHeightsEdit.ui")
Expand Down Expand Up @@ -765,6 +769,8 @@ def __init__(self, obj, features):
self.finishDepth = None
self.stepDown = None
self.panelTitle = 'Depths'
self.OpIcon = ":/icons/Path-Depths.svg"
self.setIcon(self.OpIcon)

def getForm(self):
return FreeCADGui.PySideUic.loadUi(":/panels/PageDepthsEdit.ui")
Expand Down Expand Up @@ -961,10 +967,16 @@ def __init__(self, obj, deleteOnReject, opPage, selectionFactory):
if taskPanelLayout == 0:
for page in self.featurePages:
toolbox.addItem(page.form, page.getTitle(obj))
itemIdx = toolbox.count() - 1
if page.icon:
toolbox.setItemIcon(itemIdx, QtGui.QIcon(page.icon))
toolbox.setCurrentIndex(len(self.featurePages)-1)
else:
for page in reversed(self.featurePages):
toolbox.addItem(page.form, page.getTitle(obj))
itemIdx = toolbox.count() - 1
if page.icon:
toolbox.setItemIcon(itemIdx, QtGui.QIcon(page.icon))
toolbox.setWindowTitle(opTitle)
if opPage.getIcon(obj):
toolbox.setWindowIcon(QtGui.QIcon(opPage.getIcon(obj)))
Expand Down

0 comments on commit 33a1804

Please sign in to comment.