sherpal/LaminarSAPUI5Bindings

how to use icons that are not listed in `IconName`

Closed this issue · 4 comments

axb21 commented

Thanks for this binding. It is quite nice!

While playing around with using icons in SideNavigationItem, I noticed that a number of icons that are available in ui5, such as calendar and locate-me, are not present in IconName. I tried a couple hacks but was unable to find a way to use those icons in my code. Am I missing something? It seems that I'm suck using only what is listed in the IconName config key, is that right?

axb21 commented

Ack, I'm sorry to waste your time--I figured out a reasonable way to do it. In case anyone else was wondering though:

val icon = customProp("icon",StringAsIsCodec)
...
SideNavigationItem(
	_.text := "Useful Links",
	_ => icon := "chain-link",
)

The _ => icon part is necessary because the items want a Mod, which is usually a function.

@axb21 Indeed, I was going to suggest that hack!

Note that all icons are coming (see here). If you are more than "playing around", I can cherry pick the commit and re-publish. But I expect this to be merged and re-published by the end of the week.

I was actually faster than intended :) You should have all icons by using the new release.

axb21 commented

Excellent, thank you! Works perfectly.