Part: Fix getIcon() of several view providers to return full path name of the icon file
This commit is contained in:
@@ -139,7 +139,7 @@ class ViewProviderConnect:
|
||||
vobj.Proxy = self
|
||||
|
||||
def getIcon(self):
|
||||
return getIconPath("Part_JoinConnect.svg")
|
||||
return ":/icons/booleans/Part_JoinConnect.svg"
|
||||
|
||||
def attach(self, vobj):
|
||||
self.ViewObject = vobj
|
||||
@@ -250,7 +250,7 @@ class ViewProviderEmbed:
|
||||
vobj.Proxy = self
|
||||
|
||||
def getIcon(self):
|
||||
return getIconPath("Part_JoinEmbed.svg")
|
||||
return ":/icons/booleans/Part_JoinEmbed.svg"
|
||||
|
||||
def attach(self, vobj):
|
||||
self.ViewObject = vobj
|
||||
@@ -344,7 +344,7 @@ class ViewProviderCutout:
|
||||
vobj.Proxy = self
|
||||
|
||||
def getIcon(self):
|
||||
return getIconPath("Part_JoinCutout.svg")
|
||||
return ":/icons/booleans/Part_JoinCutout.svg"
|
||||
|
||||
def attach(self, vobj):
|
||||
self.ViewObject = vobj
|
||||
|
||||
@@ -94,7 +94,7 @@ class ViewProviderBooleanFragments:
|
||||
vobj.Proxy = self
|
||||
|
||||
def getIcon(self):
|
||||
return getIconPath("Part_BooleanFragments.svg")
|
||||
return ":/icons/booleans/Part_BooleanFragments.svg"
|
||||
|
||||
def attach(self, vobj):
|
||||
self.ViewObject = vobj
|
||||
@@ -252,7 +252,7 @@ class ViewProviderSlice:
|
||||
vobj.Proxy = self
|
||||
|
||||
def getIcon(self):
|
||||
return getIconPath("Part_Slice.svg")
|
||||
return ":/icons/booleans/Part_Slice.svg"
|
||||
|
||||
def attach(self, vobj):
|
||||
self.ViewObject = vobj
|
||||
@@ -432,7 +432,7 @@ class ViewProviderXOR:
|
||||
vobj.Proxy = self
|
||||
|
||||
def getIcon(self):
|
||||
return getIconPath("Part_XOR.svg")
|
||||
return ":/icons/booleans/Part_XOR.svg"
|
||||
|
||||
def attach(self, vobj):
|
||||
self.ViewObject = vobj
|
||||
|
||||
@@ -145,7 +145,7 @@ class ViewProviderToleranceSet:
|
||||
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
|
||||
|
||||
@@ -218,7 +218,7 @@ class _ViewProviderCompoundFilter:
|
||||
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
|
||||
|
||||
@@ -108,16 +108,14 @@ class _ViewProviderPartJoinFeature:
|
||||
|
||||
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
|
||||
@@ -145,8 +143,3 @@ class _ViewProviderPartJoinFeature:
|
||||
except Exception as err:
|
||||
FreeCAD.Console.PrintError("Error in onDelete: " + str(err))
|
||||
return True
|
||||
|
||||
|
||||
def getIconPath(icon_dot_svg):
|
||||
return ":/icons/" + icon_dot_svg
|
||||
|
||||
|
||||
Reference in New Issue
Block a user