launcher icon indicating copy to clipboard operation
launcher copied to clipboard

Cleanup/pype 362 png icons

Open iLLiCiTiT opened this issue 6 years ago • 7 comments

Add ability to have both awesome icons and .png icons in launcher

iLLiCiTiT avatar Jul 11 '19 16:07 iLLiCiTiT

@BigRoy please test it

iLLiCiTiT avatar Jul 11 '19 16:07 iLLiCiTiT

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?

  1. You specify a icon = "my_special_icon.png"
  2. You provide an environment variable AVALON_ICON_ROOT=c:\my\icons\here
  3. Launcher looks for %AVALON_ICON_ROOT%\my_special_icon.png

mottosso avatar Jul 11 '19 16:07 mottosso

If I understand the goal, then how about this a customisable icon root?

  1. You specify a icon = "my_special_icon.png"
  2. You provide an environment variable AVALON_ICON_ROOT=c:\my\icons\here
  3. 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

davidlatwe avatar Jul 11 '19 16:07 davidlatwe

I wasn't sure where to put icons. It can be modified.

  1. set res_path in app.py - default is set to "~launcher/res/"
  2. 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)
  3. specify icon in toml icon = "my_special_key"

iLLiCiTiT avatar Jul 11 '19 16:07 iLLiCiTiT

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" = AwesomeFont
  • icon = "wrench.png" = AVALON_ICON_ROOT\wrench.png

If no root is set, it would simply not find the icon.

mottosso avatar Jul 11 '19 17:07 mottosso

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?

iLLiCiTiT avatar Jul 11 '19 17:07 iLLiCiTiT

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.

mottosso avatar Jul 11 '19 19:07 mottosso