Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Make it more convenient to use VaadinIcons in @Menu #6886

Open
MarcinVaadin opened this issue Dec 4, 2024 · 1 comment
Open

[FEATURE] Make it more convenient to use VaadinIcons in @Menu #6886

MarcinVaadin opened this issue Dec 4, 2024 · 1 comment
Labels
enhancement New feature or request vaadin-icons

Comments

@MarcinVaadin
Copy link
Member

MarcinVaadin commented Dec 4, 2024

Describe your motivation

When working with @Menu and wanted to set icon, it was natural for me to use VaadinIcon, but there is no simple way to do that.

I would expect something like:

@Menu(title = "Hello", order = 1, icon = VaadinIcon.CIRCLE.toIconString())

Currently I must use string value:

@Menu(title = "Hello", order = 1, icon = "vaadin:circle")

Desired solution

Would be handy if VaadinIcon enum had .toIconString() which returns vaadin: -name- or similar.

@MarcinVaadin MarcinVaadin added the enhancement New feature or request label Dec 4, 2024
@MarcinVaadin MarcinVaadin changed the title [FEATURE] Support icon enums (VaadinIcon) in @Menu [FEATURE] Make it more convenient to use VaadinIcons in @Menu Dec 4, 2024
@MarcinVaadin MarcinVaadin closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2024
@Legioth
Copy link
Member

Legioth commented Dec 5, 2024

What's needed instead is that the icon set needs to be expose string constants with the URIs to use. It cannot be a method call but it needs to be an actual static final field. It could then be like @Menu(title = "Hello", order = 1, icon = VaadinIconUrl.CIRCLE).

I'm moving the issue to the repo where VaadinIcon is defined.

https://github.com/parttio/line-awesome/pull/6/files shows an example of how this was done for Line Awesome

@Legioth Legioth reopened this Dec 5, 2024
@Legioth Legioth transferred this issue from vaadin/flow Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vaadin-icons
Projects
None yet
Development

No branches or pull requests

3 participants