Skip to content

Improve floating text boxes (TextFloat and TextFloatSimple)#8448

Open
jlintgod1 wants to merge 6 commits into
LMMS:masterfrom
jlintgod1:text-float-qol
Open

Improve floating text boxes (TextFloat and TextFloatSimple)#8448
jlintgod1 wants to merge 6 commits into
LMMS:masterfrom
jlintgod1:text-float-qol

Conversation

@jlintgod1

Copy link
Copy Markdown
Contributor

This PR adds some quality-of-life improvements to floating text boxes (TextFloat and TextFloatSimple), including:

  • Clamping positions to the screen bounds, allowing them to stay on screen and readable
  • Setting floating text position close to mouse cursor when dragging/resizing clips (implements About track position #3577?)
  • Layout adjustments to make TextFloat a bit smaller and make it more stable with changing text (particularly noticeable when adjusting the length of a clip)
  • Code style cleanup

Comparison Videos

Before (current Nightly):

2026-06-29.15-49-46_small.mp4

After:

2026-06-29.16-23-45_small.mp4

@yohannd1 yohannd1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny change:

Comment thread src/gui/clips/ClipView.cpp Outdated
@yohannd1

Copy link
Copy Markdown
Contributor

Thanks for making this! Code review wise, everything looks alright.
I did find a bug while testing though: sometimes the move action seems to make the text float overflow in the X position, but I'm not sure what the specific condition is as it seems to depend on the difference between the size of the song editor subwindow and the size of the main window itself.

2026-06-29.21-55-09.mp4

Oops must've missed that

Co-authored-by: Yohanan <23298480+yohannd1@users.noreply.github.com>
@jlintgod1

jlintgod1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

sometimes the move action seems to make the text float overflow in the X position

I noticed that too while working on the PR (and isn't caused by it), but I wasn't sure about how to fix it until I actually looked into it.

It's caused by ClipViews getting moved to a negative x position (relative to their parent) if they are outside the visible range of the song editor (or specifically TrackContentWidget). Since the text float's position is relative to the clip view, it gets pushed to the left.

const int ts = clip->startPosition();
const int te = clip->endPosition()-3;
if( ( ts >= begin && ts <= end ) ||
( te >= begin && te <= end ) ||
( ts <= begin && te >= end ) )
{
clipView->move(static_cast<int>((ts - begin) * ppb / TimePos::ticksPerBar()), clipView->y());
if (!clipView->isVisible())
{
clipView->show();
}
}
else
{
clipView->move(-clipView->width() - 10, clipView->y());
}

The simplest solution might be to have clip views not moved from where they're calculated to be (based on the clip's position), but I still need to figure out if there are performance impacts.

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