Skip to content

Conversation

@postsolar
Copy link
Contributor

@postsolar postsolar commented Jun 24, 2025

Part of #1011

  • add minimal working scrolling
  • implement easing
  • implement pause on hover
  • implement configuration

@postsolar postsolar marked this pull request as draft June 24, 2025 12:06
@postsolar
Copy link
Contributor Author

Draft but tips/guidance is quite welcome if there is any

- [x] add minimal working scrolling
- [ ] implement easing
- [ ] implement pause on hover
- [ ] implement configuration
@postsolar postsolar force-pushed the feat/volume-popup-marquee branch from 48d6a77 to 3709ba1 Compare June 26, 2025 01:58
postsolar added 12 commits July 1, 2025 09:46
Now they all scroll correctly
also extract logic into a top-level function
Dynamically decide if scrolling is necessary based on allocated width change.

There's still an edge case where if `min-width` is set via GTK Inspector, labels would stop scrolling but positions would be off before a mouse hover or a popup visibility toggle event. This is minor and doesn't impact the UI much.
Hardcoded 5 seconds pause after animation cycle
Match `TruncateMode` better
Imports and comments
@postsolar postsolar force-pushed the feat/volume-popup-marquee branch from 270e834 to 9841de0 Compare July 21, 2025 15:52
@postsolar
Copy link
Contributor Author

postsolar commented Jul 21, 2025

Functionality-wise it's basically ready and works really well for me, I'll just try to polish the code a bit more before the review.

Edit:
Or not really ready. Hiding the scrollbar via traditional methods* makes the animation slow down on mouse events for some reason. Still stuck on this.

* "traditional methods" being:

PolicyType::External
    let scrolled = ScrolledWindow::builder()
        .vscrollbar_policy(gtk::PolicyType::Never)
        .hscrollbar_policy(gtk::PolicyType::External)
        .build();
.hide()
    if let Some(hbar) = scrolled.hscrollbar() {
        hbar.hide(); // or hbar.set_visible(false)
    }

This in particular also generally breaks scrolling when GTK phocus theme is used.

@JakeStanger
Copy link
Owner

Just a thought if you're still struggling with this. A radically different approach, but it would probably be relatively trivial to use Cairo and Pango for this. You could draw text onto a "label" canvas and just translate the text coords.

@postsolar
Copy link
Contributor Author

Thank you for the suggestion. I'll try this approach next, though definitely not anytime soon as I'll be busy for a while, so if anyone wants to pick this up that'd be welcome.

Alternatively, we could just wait for the GTK4 port to be completed, and maybe GTK4 would have a more sensible behavior wrt to that one last issue of hiding the scrollbar in a theming-independent way and without causing slowdown on mouse movement.

@postsolar postsolar closed this Nov 23, 2025
@postsolar postsolar deleted the feat/volume-popup-marquee branch November 23, 2025 00:52
@postsolar
Copy link
Contributor Author

Superseded by #1250.

GTK4 actually fixes that scrollbars bug, so pretty much no changes aside from updating to GTK4 and expanding what's configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants