[FEATURE] rotation / transforms for `ui.glyph`, button `glyph` option accepts a `glyph` object.
Submission checklist
- [x] I have searched existing issues and confirmed this has not been requested before.
- [x] I have checked existing pull requests for similar changes.
- [x] I have read SCOPE.md. This cannot already be done with existing configuration, IPC, a script-backed widget, or a plugin.
Feature type
Developer / API improvement
Feature summary
Let ui.glyph and ui.image accept a rotate or transform option
Let ui.button accept a ui.glyph or ui.image object as an alternative to glyph name
Motivation / use case
Tabler doesn't provide enough PIP icons for all corners, but the one they do provide is enough, when rotated, to cover all corners.
Proposed solution
local pipControl = {
ui.button({
tooltip = "top right",
glyph = "picture-in-picture",
}),
ui.button({
tooltip = "bottom right",
glyph = ui.glyph({
name = "picture-in-picture",
rotate = 90,
})
}),
ui.button({
tooltip = "bottom left",
glyph = ui.image({
path = "/path/to/bottom-left.svg",
})
}),
ui.button({
tooltip = "top left",
glyph = ui.glyph({
name = "picture-in-picture",
rotate = 270,
})
}),
}
Alternatives considered
Bug Tabler to copy and rotate
References / related projects
No response
Additional context
No response
Added with #5227.
Please reopen. #5227 does not enable rotating a glyph within a button, or passing a ui.image as a glyph
oh sorry, the title and description of the issue says rotation and transforms for ui.glyph, so I missed the "within a button" part. I'm reopening it.
Although please keep in mind that ui.button is intended for "basic" use cases and for more advanced you can use ui.row or ui.column and make it act like button, with click actions, hover, etc..., while also allowing to use ui.image, all the transitions, and more.
It's not a "no", just keep that in mind.
Gotcha. button comes with all kinds of goodies like a11y, keyboard support, etc. building with your own rectangles is harder, and requires users to keep their designs up to date. built-ins are always preferable
This is the kind of UI I'm trying to build:
Currently, if I want to use buttons, I have to settle for "25/75" as a label, even though a suitable icon could simply be rotated.
(also if you have an critique of the layout or design here, I'm all ears 😄 )