Skip to content

Commit

Permalink
Part: Fix getIcon() of several view providers to return full path nam…
Browse files Browse the repository at this point in the history
…e of the icon file
  • Loading branch information
wwmayer committed Dec 20, 2024
1 parent 44065bf commit c97587e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/Mod/Part/BOPTools/JoinFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __init__(self,vobj):
vobj.Proxy = self

def getIcon(self):
return getIconPath("Part_JoinConnect.svg")
return ":/icons/booleans/Part_JoinConnect.svg"

def attach(self, vobj):
self.ViewObject = vobj
Expand Down Expand Up @@ -250,7 +250,7 @@ def __init__(self,vobj):
vobj.Proxy = self

def getIcon(self):
return getIconPath("Part_JoinEmbed.svg")
return ":/icons/booleans/Part_JoinEmbed.svg"

def attach(self, vobj):
self.ViewObject = vobj
Expand Down Expand Up @@ -344,7 +344,7 @@ def __init__(self,vobj):
vobj.Proxy = self

def getIcon(self):
return getIconPath("Part_JoinCutout.svg")
return ":/icons/booleans/Part_JoinCutout.svg"

def attach(self, vobj):
self.ViewObject = vobj
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Part/BOPTools/SplitFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self,vobj):
vobj.Proxy = self

def getIcon(self):
return getIconPath("Part_BooleanFragments.svg")
return ":/icons/booleans/Part_BooleanFragments.svg"

def attach(self, vobj):
self.ViewObject = vobj
Expand Down Expand Up @@ -252,7 +252,7 @@ def __init__(self,vobj):
vobj.Proxy = self

def getIcon(self):
return getIconPath("Part_Slice.svg")
return ":/icons/booleans/Part_Slice.svg"

def attach(self, vobj):
self.ViewObject = vobj
Expand Down Expand Up @@ -432,7 +432,7 @@ def __init__(self,vobj):
vobj.Proxy = self

def getIcon(self):
return getIconPath("Part_XOR.svg")
return ":/icons/booleans/Part_XOR.svg"

def attach(self, vobj):
self.ViewObject = vobj
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Part/BOPTools/ToleranceFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def __init__(self,vobj):
vobj.Proxy = self

def getIcon(self):
return getIconPath("preferences-part_design.svg")
return ":/icons/preferences-part_design.svg"

def attach(self, vobj):
self.ViewObject = vobj
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Part/CompoundTools/CompoundFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def __init__(self, vobj):
vobj.setEditorMode("DontUnhideOnDelete", 2) # set hidden

def getIcon(self):
return "Part_CompoundFilter"
return ":/icons/booleans/Part_CompoundFilter.svg"

def attach(self, vobj):
self.ViewObject = vobj
Expand Down
19 changes: 6 additions & 13 deletions src/Mod/Part/JoinFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,14 @@ def __init__(self, vobj):

def getIcon(self):
if self.Object is None:
return getIconPath("Part_JoinConnect.svg")
return ":/icons/booleans/Part_JoinConnect.svg"
else:
return getIconPath(
{
"bypass": "Part_JoinBypass.svg",
"Connect": "Part_JoinConnect.svg",
"Embed": "Part_JoinEmbed.svg",
"Cutout": "Part_JoinCutout.svg",
return {
"bypass": ":/icons/booleans/Part_JoinBypass.svg",
"Connect": ":/icons/booleans/Part_JoinConnect.svg",
"Embed": ":/icons/booleans/Part_JoinEmbed.svg",
"Cutout": ":/icons/booleans/Part_JoinCutout.svg",
}[self.Object.Mode]
)

def attach(self, vobj):
self.ViewObject = vobj
Expand Down Expand Up @@ -145,8 +143,3 @@ def onDelete(self, feature, subelements):
except Exception as err:
FreeCAD.Console.PrintError("Error in onDelete: " + str(err))
return True


def getIconPath(icon_dot_svg):
return ":/icons/" + icon_dot_svg

0 comments on commit c97587e

Please sign in to comment.