Skip to content

Make Resizing Tracks more Natural #7878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

regulus79
Copy link
Contributor

@regulus79 regulus79 commented May 7, 2025

In this PR, I reworked the resizing functionality for TrackViews to make it more intuitive for users, and I added the ability to horizontally resize a track.

Previously, in order to change the height of a track, the user would have to mouse over it, hold shift, and drag down. This is quite unintuitive, and I only learned how to do it after being told how. New users most likely do not know this feature exists.

Instead, it would be much more natural if the user could mouse over the edge of a track, and the cursor would change to a vertical arrow, indicating that the user can resize it, and then just drag down to change the height.

Additionally, if we allow the user to change the height of a track, it makes sense to let them change the width as well.

So why don't we do that? :D

2025-05-06.20-59-50.mp4

Also, since compact track buttons are not as relevant after this PR, I have removed much of the code for them. If a user has compact track buttons enabled, the track width will start out at the minimum to replicate how it looked previously. But the user can resize the tracks at any time to be as wide as they please.

Similarly to how track height is saved in the project, the track width is also saved.

Changes

  • Added gui functionality to TrackView to let users resize via the mouse. Basically checking the position of the mouse relative to the edge, changing the action state, changing the cursor, and handling the drag events.
  • Removed the hardcoded m_trackHeadWidth from the Song Editor and Pattern Editor, and moved it into TrackContainerView, along with getter and setter functions. Also upgraded all relevant functions to use the dynamic width.
  • Reworked/partially removed compact track label functionality. Instead of storing hardcoded widths for the size of each part of the track, everything is calculated on the fly, with only the default and minimum widths stored as constants in TrackView.h
  • Upgraded PatternTracks and AutomationTracks to use Layouts instead of hardcoded pixel values.
  • When the user resizes a track to be less than the old compact track width, the mixer channel number will disappear to allow the user to make it even more compact.

@sakertooth
Copy link
Contributor

sakertooth commented May 7, 2025

I'm more interested in why your CPU is through the roof honestly..Off topic so we can discuss it elsewhere if needed.

@Gabrielxd195
Copy link

If possible, I suggest you add the option to remove the mixer display from tracks, or have them automatically removed when the tracks are compacted. It doesn't make sense to compact the tracks and have these displays remain visible as they take up a lot of space on the tracks.

@regulus79
Copy link
Contributor Author

Sure! I've changed it so that the mixer channel lcd hides itself when you resize it to be smaller than the default compact track size.

2025-05-07.17-02-51.mp4

@regulus79
Copy link
Contributor Author

One thing I noticed, we're using a hardcoded image as the background for the track label button, which tiles as you expand the tracks.

Screenshot From 2025-05-07 18-35-16

I tried seeing how it looked just by removing the image, and it seems to look about as good? It is a bit more flat, maybe I could change the css to use a gradient. Or maybe that's fine?

image

@AW1534
Copy link
Member

AW1534 commented May 9, 2025

Works great, I just think the threshold to hide the track number should be a little wider than it is right now
image

@regulus79
Copy link
Contributor Author

Wider as in, you don't have to squish the tracks as much before it disappears?

@AW1534
Copy link
Member

AW1534 commented May 9, 2025

Yes

@regulus79
Copy link
Contributor Author

The way I have it currently, if users previously had compact track buttons enabled, the tracks will default out to that size, with the mixer number shown, since that's how it works in master. It's only if you resize it to be smaller than that where the lcd will disappear.

If we change the threshold to be larger, it would mean that users with compact tracks will now have to resize the tracks to see the mixer number. Are we okay with that?

@firiox
Copy link

firiox commented May 10, 2025

Men Excellent work and excellent review this is so much more great UX.

@AW1534
Copy link
Member

AW1534 commented May 10, 2025

If we change the threshold to be larger, it would mean that users with compact tracks will now have to resize the tracks to see the mixer number. Are we okay with that?

Hm, that complicates it a bit. One option is to just always show the LCD no matter what, when compact is enabled, and only change this behaviour for compact mode.

Another option is to just lock the width when compact mode is enabled.

The best option, in my opinion, is to add back the context menu to change and create mixer tracks from track settings.

This might be getting out of scope for this PR though, so it may be best to just leave it as it is for now.

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.

5 participants