Skip to content

Commit

Permalink
Change MenuText of fasteners according to grouping mode
Browse files Browse the repository at this point in the history
When the icons are not grouped in drop-down list the tooltip that
appears is bloated/redundant, this changes expect to have cleaner
tooltips.

Fix #355
  • Loading branch information
hasecilu committed Apr 15, 2024
1 parent 421f861 commit 656c294
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions FastenersCmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,15 @@ def GetResources(self):
import GrammaticalTools

icon = os.path.join(iconPath, FSGetIconAlias(self.Type) + '.svg')

if FSParam.GetInt("ScrewToolbarGroupMode", 1) == 2:
menu_text = translate("FastenerCmd", "Add ") + GrammaticalTools.ToDativeCase(self.Help)
else:
menu_text = translate("FastenerCmd", "Add ") + self.Type

return {'Pixmap': icon,
# the name of a svg file available in the resources
'MenuText': translate("FastenerCmd", "Add ") + GrammaticalTools.ToDativeCase(self.Help),
'MenuText': menu_text,
'ToolTip': self.Help}

def Activated(self):
Expand All @@ -882,7 +888,7 @@ def Activated(self):
a.ViewObject.LineWidth = FSParam.GetFloat("DefaultLineWidth", 1.0)
if FSParam.GetBool("DefaultVertexSizeActive", False):
a.ViewObject.PointSize = FSParam.GetFloat("DefaultVertexSize", 1.0)

FSViewProviderTree(a.ViewObject)
FreeCAD.ActiveDocument.recompute()
return
Expand Down

0 comments on commit 656c294

Please sign in to comment.