noctalia-shell icon indicating copy to clipboard operation
noctalia-shell copied to clipboard

[FEATURE] rotation / transforms for `ui.glyph`, button `glyph` option accepts a `glyph` object.

Open bennypowers opened this issue 1 month ago • 5 comments

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

bennypowers avatar Nov 05 '26 06:11 bennypowers

Added with #5227.

Yocraft-2000 avatar Nov 10 '26 11:11 Yocraft-2000

Please reopen. #5227 does not enable rotating a glyph within a button, or passing a ui.image as a glyph

bennypowers avatar Nov 10 '26 15:11 bennypowers

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.

Yocraft-2000 avatar Nov 10 '26 15:11 Yocraft-2000

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

bennypowers avatar Nov 10 '26 15:11 bennypowers

This is the kind of UI I'm trying to build:

image

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 😄 )

bennypowers avatar Nov 11 '26 19:11 bennypowers