launcher
launcher copied to clipboard
Cleanup/pype 362 png icons
Add ability to have both awesome icons and .png icons in launcher
@BigRoy please test it
Thanks for this! I'm not sure we should embed Maya/Houdini/etc logos into the source, those are better found elsewhere. Wouldn't this limit what icons are made available to those found in the launcher source?
If I understand the goal, then how about this a customisable icon root?
- You specify a
icon = "my_special_icon.png" - You provide an environment variable
AVALON_ICON_ROOT=c:\my\icons\here - Launcher looks for
%AVALON_ICON_ROOT%\my_special_icon.png
If I understand the goal, then how about this a customisable icon root?
- You specify a
icon = "my_special_icon.png"- You provide an environment variable
AVALON_ICON_ROOT=c:\my\icons\here- Launcher looks for
%AVALON_ICON_ROOT%\my_special_icon.png
This would be better if we can assign the icon in each App's .toml :D
I wasn't sure where to put icons. It can be modified.
- set
res_pathin app.py - default is set to "~launcher/res/" - add special keys and rest of path to icon in "~/launcher/res/qml/icon.js" it is important that these keys are not included in awesome list! (both icons will be displayed)
- specify icon in toml
icon = "my_special_key"
This would be better if we can assign the icon in each App's .toml :D
Is the "awesome icons" currently being set there? If so, then the same principle should apply.
I wasn't sure where to put icons. It can be modified.
Did you see my suggestion above? The icon = "" from the toml could be interpreted based on whether or not it has a suffix, like .png.
icon = "wrench"= AwesomeFonticon = "wrench.png"=AVALON_ICON_ROOT\wrench.png
If no root is set, it would simply not find the icon.
But you can have multiple actions at the same time few with awesome icons and few with pngs. This way will prevent you from using both at the same time.
At this moment it is done with help of icon.js because I didn't found another way how to be able to use both at the same time. Of course it is possible to set keys in icon.js as '*.png' so it is clear... But that is up to user I think?
I think you could use both at the same time, because icons without a suffix can be presumed to be an AwesomeFont, whereas those with a .png suffix will be presumed to be an icon on disk.
For example:
action1.py
class Action1(...):
icon = "my_icon_on_disk.png"
action2.py
class Action2(...):
icon = "play" # An AwesomeFont icon
Action1 has got a suffix, so would be discovered from AVALON_ICON_ROOT. What do you think?
I'm not too keen on involving javascript, as it would mean someone wanting to customise the launcher would now need both the environment, Python, and JavaScript (which I fear many will try and avoid if they can).
I can put together an example of how you can "detect" whether an icon is an AwesomeFont or a file if it isn't clear, and if it helps.