[GH-ISSUE #1011] Truncate (or rotate) player metadata in volume and music popups #1717

Closed
opened 2026-05-22 22:54:09 +01:00 by JakeStanger · 7 comments
Owner

Originally created by @postsolar on GitHub (May 26, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/1011

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

It often gets ridiculously long. This one is more than half my monitor width.

Image

I'd like it to have a consistent width.

Describe the solution you'd like

A clear and concise description of what you want to happen.
The more info here about what you are trying to achieve, the better - there's likely more than one way to go about implementing a solution.

Ideally:

  • Truncate at selected direction, for selected length, with a selected string
  • Optionally, also rotate

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

Originally created by @postsolar on GitHub (May 26, 2025). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/1011 **Is your feature request related to a problem? Please describe.** > A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] It often gets ridiculously long. This one is more than half my monitor width. ![Image](https://github.com/user-attachments/assets/42d0005c-a95f-4be3-a649-342e981a4a82) I'd like it to have a consistent width. **Describe the solution you'd like** > A clear and concise description of what you want to happen. > The more info here about what you are trying to achieve, the better - there's likely more than one way to go about implementing a solution. Ideally: - Truncate at selected direction, for selected length, with a selected string - Optionally, also rotate **Describe alternatives you've considered** > A clear and concise description of any alternative solutions or features you've considered. **Additional context** > Add any other context or screenshots about the feature request here.
Author
Owner

@JakeStanger commented on GitHub (May 26, 2025):

Yeah makes sense. Reckon this can be done by copying the existing truncate and layout options for the header. Not sure what I'd call the options off the top of my head...

<!-- gh-comment-id:2910684526 --> @JakeStanger commented on GitHub (May 26, 2025): Yeah makes sense. Reckon this can be done by copying the existing `truncate` and `layout` options for the header. Not sure what I'd call the options off the top of my head...
Author
Owner

@postsolar commented on GitHub (May 26, 2025):

To be clear by rotation I mean continuously showing a shifted slice of a string, e.g.

Frame 1: some long s…
Frame 2: …ome long s…
Frame 3: …me long st…
Frame 4: …e long str…
Frame 5: … long stri…

And so on.

<!-- gh-comment-id:2910685338 --> @postsolar commented on GitHub (May 26, 2025): To be clear by rotation I mean continuously showing a shifted slice of a string, e.g. ``` Frame 1: some long s… Frame 2: …ome long s… Frame 3: …me long st… Frame 4: …e long str… Frame 5: … long stri… ``` And so on.
Author
Owner

@JakeStanger commented on GitHub (May 26, 2025):

Ah okay. There's no mechanism for that currently but should be easy enough to build in theory, with an interval loop and some string manipulation.

The gotcha there is that GTK doesn't support that (as far as I know, happy to be proved wrong), so it would need to go through its own truncate system, which I guess would have to be based on a maximum character limit.

<!-- gh-comment-id:2910688643 --> @JakeStanger commented on GitHub (May 26, 2025): Ah okay. There's no mechanism for that currently but should be easy enough to build in theory, with an interval loop and some string manipulation. The gotcha there is that GTK doesn't support that (as far as I know, happy to be proved wrong), so it would need to go through its own truncate system, which I guess would *have* to be based on a maximum character limit.
Author
Owner

@postsolar commented on GitHub (May 26, 2025):

It did sound easy until I started thinking about how exactly to move between frames. I mean it shouldn't just redraw the string every, say, 0.3 seconds, it should be smooth. Is there something like pixel-perfect placement of text that would also be safe from user's CSS intervention? 😄

It seems that GTK2 has exactly this, but for now I'm struggling to find a GTK3 equivalent.

Another idea I have is a horizontal scrollbox that would be sent scroll events in a loop.

<!-- gh-comment-id:2910708323 --> @postsolar commented on GitHub (May 26, 2025): It did sound easy until I started thinking about how exactly to move between frames. I mean it shouldn't just redraw the string every, say, 0.3 seconds, it should be smooth. Is there something like pixel-perfect placement of text that would also be safe from user's CSS intervention? 😄 It seems that GTK2 [has exactly this](https://metacpan.org/pod/Gtk2::Ex::TickerView), but for now I'm struggling to find a GTK3 equivalent. Another idea I have is a horizontal scrollbox that would be sent scroll events in a loop.
Author
Owner

@JakeStanger commented on GitHub (May 26, 2025):

We could render to a Cairo surface and translate the image but that might get nasty.

<!-- gh-comment-id:2910750827 --> @JakeStanger commented on GitHub (May 26, 2025): We *could* render to a Cairo surface and translate the image but that might get nasty.
Author
Owner

@postsolar commented on GitHub (May 27, 2025):

Still investigating this, but from what I gathered so far:

  • It might be possible with just a GtkViewport and gtk_widget_add_tick_callback(): discussion on Gnome discourse
  • It might be just left out to user CSS when Ironbar switches to Gtk4. I'm having issues with Gtk3 so far (lack of transform prop), but Gtk4 seems to be more promising. In this case some sort of a sane default like truncation or line wrapping would still be good for better UX though, not everyone would want or would figure out CSS animations.
<!-- gh-comment-id:2910799127 --> @postsolar commented on GitHub (May 27, 2025): Still investigating this, but from what I gathered so far: - It might be possible with just a `GtkViewport` and `gtk_widget_add_tick_callback()`: [discussion](https://discourse.gnome.org/t/how-to-make-a-marquee-gtklabel/11088) on Gnome discourse - It might be just left out to user CSS when Ironbar switches to Gtk4. I'm having issues with Gtk3 so far (lack of `transform` prop), but Gtk4 seems to be more promising. In this case some sort of a sane default like truncation or line wrapping would still be good for better UX though, not everyone would want or would figure out CSS animations.
Author
Owner

@postsolar commented on GitHub (May 27, 2025):

So I tested it with Gtk4 but it has a number of issues:

  • No way to prevent the animation if the text doesn't need to be scrolled (if it's short enough)
  • Some performance issue, 1 of my cores spikes to 100% usage, animation itself and also GTK debugger become jittery
  • Gtk4 CSS doesn't allow specifying percentage for transform: translateX(-100%)

Probably not the way to go.

<!-- gh-comment-id:2910909403 --> @postsolar commented on GitHub (May 27, 2025): So I tested it with Gtk4 but it has a number of issues: - No way to prevent the animation if the text doesn't need to be scrolled (if it's short enough) - Some performance issue, 1 of my cores spikes to 100% usage, animation itself and also GTK debugger become jittery - Gtk4 CSS doesn't allow specifying percentage for `transform: translateX(-100%)` Probably not the way to go.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#1717
No description provided.