Support marquee scrolling text displays when text is too large for widget

Bug #681009 reported by RJ Skerry-Ryan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Confirmed
Wishlist
Unassigned

Bug Description

It would be nice if we could support an option for the text widgets that when the text they contain overflows their size, the widget would scroll the text marquee-style.

RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: New → Confirmed
importance: Undecided → Wishlist
tags: added: easy weekend
Revision history for this message
Matt Miller (mthwmil) wrote :

I've attached a patch that implements this using a QTimer to shift the visible text over one character every 250 milliseconds.

This will also add a "..." to the end when the string it too long for a label

Revision history for this message
Matt Miller (mthwmil) wrote :

I just caught a mistake I made in the patch (it didn't tell the WLabel object that a track was unloaded, so moving the mouse over a previously loaded deck would display the track title again...)

Also, the fix works by catching the enter event and leave event in the WLabel class (so holding the mouse over the label causes it to scroll). This also changes the implementation of the WtrackText and WTrackProperty classes to inform the Wlabel class (that might need review, I'm not sure if it's "ok" to do that).

Revision history for this message
Owen Williams (ywwg) wrote :

This looks like a nice patch. In general Mixxx tries to avoid using timers for anything, because they can potentially cause thread priority issues. If there's any way you can think of implementing this without using a timer, that would be preferred. You might scroll based on visual_playposition or something.

(Once Mixxx gets a real internal timing system, this will get a lot easier)

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I'll just copy/paste what I posted to mixxx-devel:

visual_playpos is not really that great of a control to hook for doing marquee scrolling because they only update when the player is moving. So if all the players are stopped then the marquee animation will also be stopped.

I haven't responded to the bug yet but I think that a QTimer approach might be fine to stick with for now.

We have a global ~40fps timer that is used to update the waveforms. It is created in src/waveformviewerfactory.cpp. Code-plumbing wise, it will be a little tricky/ugly to get this timer and hook it to widgets other than waveforms. Furthermore, to support marquee scrolling of any widget, we would need to connect this high-ish speed timer to every widget. I'm not sure that's a good thing CPU-wise because it means that every widget will run some handler code (even if it's a no-op) at 40fps. So for now, I'd rather not play with trying to hook this up.

Changed in mixxx:
milestone: none → 1.11.0
RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: 1.11.0 → 1.11.1
Revision history for this message
Mina Nagy (mnzaki) wrote :

Are the thread priority issues mentioned in comment #4 still relevant? I'd like to make an attempt at this, any further info?

Changed in mixxx:
assignee: nobody → Mina Nagy (mnzaki)
Mina Nagy (mnzaki)
Changed in mixxx:
assignee: Mina Nagy (mnzaki) → nobody
Revision history for this message
Leo Combes (combesl) wrote :

Is there any way to know the width in pixels of the text title of the song, once it is loaded?
This is necessary to determine if the text overflows the textbox size.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Hi Leo,

Qt has the QFontMetrics Class.
It is already used in Mixxx https://github.com/mixxxdj/mixxx/blob/master/src/widget/woverview.cpp#L447
I hope that helps.

Please assign the bug to yourself, if you are planning to work on it.
Thank you.

Kind regards.

Daniel

RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: 1.11.1 → none
tags: added: hackathon
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5679

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.