Closed luzpaz closed 1 year ago
It's weird how the tabs display differently in the IDE in comparison to github
Is there a way to tell github to show tabs as 4 whitespaces ?
edit: :point_down:
@edwardvmills can you set the tab whitespace to 4 whitespaces in https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-personal-account-settings/managing-your-tab-size-rendering-preference please ?
hi luzpaz, i'm actually working on some of these as well. in addition, i'm also going to break out the tooltip and paths as variables to allow clearer multiline, like so
def GetResources(self):
# prepare a multiline tooltip
tooltip = ("\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
)
toolbarIconPath = FreeCAD.getUserAppDataDir()+"Mod" + "/Examples_WB/Resources/Icons/Werner_fp_makeOctahedron.svg"
return {'MenuText': 'Werner_fp_Octahedron',
'ToolTip': tooltip,
'Pixmap' : toolbarIconPath}
i'd like to accept your commit, but i'm afraid it might clash with what i'm already doing.
as far as the tab and spaces...is this a github.com display thing, or does it modify the actual files in the repo?
ok, it seems like just a display thing. i set it to 4 as requested.
here's a better example of the style i'm going for, now that AndyK has supplied the contents:
(github not rendering correctly, all the comment string lines are left justified correctly)
class Werner_fp_makeBox():
def Activated(self):
try:
a=FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Box")
except:
print ('create or open a document first')
return
Box(a)
ViewProviderBox(a.ViewObject)
FreeCAD.ActiveDocument.recompute()
def GetResources(self):
tooltip = ("Werner_fp_makeBox \n"
"a document object is created,\n"
"then passed to the Box() class\n"
"and the result passed to the ViewProviderBox() class\n"
"\n"
"Box() makes the shape from Part.makeBox() \n"
"with custom parameters for Length, Width, and Height \n"
"(as Length type) under data tab \n"
"also, data parameter changes echo to report view\n"
"\n"
"ViewProviderBox() sets a custom icon in XPM format\n"
"here also, view parameter changes echo to report view\n"
"\n"
"note that the toolbal icon does not carry over to the \n"
"model tree icon, where the view provider icon takes priority")
toolbarIconPath = FreeCAD.getUserAppDataDir()+"Mod" + "/Examples_WB/Resources/Icons/Werner_fp_makeBox.svg"
return {'MenuText': 'Werner_fp_makeBox',
'ToolTip': tooltip,
'Pixmap' : toolbarIconPath}
Gui.addCommand('Werner_fp_makeBox', Werner_fp_makeBox())
As you may have noticed, i am on a side quest, and not actually doing Silk right now. planning on wrapping this up soon.
i saw a few different ways to do multiline, and i think this one is a nice combination of simple, but still provides feedback on final rendering.
I got 8 done and pushed. still a lot to do....hopefully by the end of this week.
Added formatting for tooltips as demonstrated in https://github.com/edwardvmills/Silk/blob/master/AddNewCommand.py#L35-L37