AddOn manager: Choose toolBar Icon for a Macro

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
johnwang
Veteran
Posts: 1345
Joined: Sun Jan 27, 2019 12:41 am

AddOn manager: Choose toolBar Icon for a Macro

Post by johnwang »

Hi,

Recently installed via Add-On manager a Macro named Unroll_Ruled_Surface from here:
https://wiki.freecadweb.org/Macro_Unroll_Ruled_Surface
I got a button with text of 'Unroll Ruled Surface'.
I found there is a ToolBar Icon file for it from https://wiki.freecadweb.org/File:Macro_ ... urface.png

The question is: Could Add-On manager choose a Icon file to use if there is one?
I think there are 4 cases:
1. The Macro has an official one. Add-On manager needs to ask the Macro icon file has a standard name: 'the name of the macro.png' or 'Macro.png'
2. Add-On manager has one and assign it to the macro. (Provided by other user to Add-On manager if the owner of the Macro is not contactable)
3. Let the user choose one of his own
4. Use text

@chennes, could you have a look?

Cheers,
John
unr.png
unr.png (7.68 KiB) Viewed 696 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
NewJoker
Veteran
Posts: 3014
Joined: Sun Oct 11, 2020 7:49 pm

Re: AddOn manager: Choose toolBar Icon for a Macro

Post by NewJoker »

johnwang wrote: Sun Jul 31, 2022 5:27 am @chennes, could you have a look?
If you want to notify someone using the new mentioning capability, you have to start typing the user's name and then choose it from the list so that it appears between the mentioning tags. It will be highlighted in red once you preview or submit the post. Like this: @chennes
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: AddOn manager: Choose toolBar Icon for a Macro

Post by chennes »

Thanks for the ping, @NewJoker :) . @johnwang I'm not sure why the Addon Manager didn't find the icon for that Macro, it looks fine to me, at least at first glance. It's possible that I only coded the wiki macro fetch in the function that handles the {{Codeextralink|}} wiki tag. At any rate, the way it should work is that whatever macro icon is on the wiki is used if there is no explicit icon set in the macro itself. I'd be happy to review a PR that did something better than that, but that's probably as far as I'll go for the time being.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply