-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Change zoom in SongEditor to a Slider Zoom #6664
Conversation
New styles and icons for Horizontal Slider, both default and classic themes. Derived from Vertical Slider Styles and Icons.
Adapt TimeLineWidget to new zoom values coming from SongEditor, changing fixed values for a formula. It works well with fixed values as well.
Change ComboZoom to a Slider in SongEditor. Adapt behaviour of zoom with keyboard+wheel. Add Ctrl+0 to reset zoom to init value (100%)
Correct codefactor warnings (shorthand-property-no-redundant-values) when creating PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly a preliminary code style review. I have not thoroughly looked over the logic yet or tested the code.
Constants are made constexpr, and placed in an anonymous namespace to prevent external linkage. Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Change std::vector to std:array Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Typo error Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Coding style Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Avoid using Qt Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Coding conventions and simplifies code Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Coding conventions and simplifies code Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
@messmerd thanks for the review! Sorry for the mistakes of coding conventions. I went through the code several times, but you know... |
Small correction of data types and changing unsigned to int as recomended
Change globalPosition() to globalPos() to make it compatible with Qt 5.6
create globalPosition as a function in in DeprecationHelper and use it in SongEditor
For clips that do not start or end on the exact bar, adjust the width to avoid misalignments.
Small change to adapt code to coding convention
A few issues I noticed while testing:
|
We should find where this context menu is adding it and removing it. This isn't something that should be automated. |
A few more issues (mostly minor):
|
In TimeLineWidget reorder includes and avoid using qt functions. In SongEditor introduce controls to avoid textfloat from not hiding; avoid zooming when mouse is over the "instruments" area; no menu on slider.
Thanks, it works better now.
I'm on Linux, so maybe it's related to that. It's not a very serious issue for me though
Yeah, that sounds best to me It looks like if I use Ctrl+Drag on the slider, I can still cause the crash to occur. Maybe this could be fixed by adding a When zooming in, it can move the horizontal scrollbar at the bottom of the song editor to the right and make some clips go out of sight. This is a little annoying imo, especially when the the scrollbar is all the way to the left and the clip on the first measure of the song goes out of sight. I'm not sure if there's any good solution to this though. Is there a reason the smallest zoom value is 13% instead of something like 10%, 15%, etc? |
Minor corrections
Perfect! I'll start another PR
Sorry. I've been able to reproduce. Is that happening on the other sliders, like master volume or master pitch? Unfortunatelly there is no disableMouseDragEvent on AutomatableSlider.
Yes, that can be somehow confusing to the user. I can't see a neat solution but moving the cursor position (the zoom is based on current cursor position) which I think is a worse sideeffect. If you think in a production scenario with lots of clips, I believe it's not that confusing at all, also because you won't be doing zooming-zoomout from min to max constantly.
That came from previous minimun zooming, which was 12,5%. If set to 10%, pixelsPerBar become 0. I set it to 15%, that works ok (1 pixelPerBar) and it's clearer. Thanks. |
Not the crash. You can't reproduce the Ctrl+Click-and-drag of the zoom slider on your end? Dragging it to an automation track causes the crash, but we shouldn't be able to Ctrl+Drag the zoom slider in the first place since it isn't automatable.
I meant that maybe we should add a method like that to
To be clear, I'm not totally against the current behavior. I just think it may be worth fiddling with it to see if there is any alternative behavior we like better. What would happen if it zoomed as if the mouse was always located all the way to the left? Or if it zoomed as if the mouse was located wherever the playhead is? |
Add new IntModel to control Log Slider + some minor error correction and adjustments
Commit added to last one by mistake
Some files reverted because not used functions anymore
@allejok96 Have you seen the two comments I made on your PR? |
I see, go ahead. But write that in a comment so it's more clear what the problem is. |
I'll take a break from this PR now in case you wonder, but you've done a good job @superpaik ! |
To make clip always visible
Ok. I pushed new commit to do that.
Thank you so much for your collaboration. You made the PR much more clear and simpler code-wise |
This PR is ready for final review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor suggestions
I did a little bit of testing just now since you've made a number of changes in the month since I last tested it. A few notes:
|
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
Co-authored-by: Dalton Messmer <33463986+messmerd@users.noreply.github.com>
"hack fixes" behaviour when crtl+alt+wheel. QT returns x variations for angleDelta (mimics horizontal mouse wheel)
Yes. I changed it according to @allejok96 comments to match behavior with other actions. PR description updated.
I'll create an issue.
Apparently it is a bug (or hidden behavior) of QT. When Alt is pressed, it mimics horizontal wheel movement. https://bugreports.qt.io/browse/QTBUG-91556 |
The Alt button workaround works for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is ready to be completed now. Nice work!
Adapt snap_sizes and formula optimizations
Add an specific variable to hold PROPORTIONAL_SNAP_SIZES (bigger and smaller than SNAP_SIZES values) so proportional snapping is similar to previous behaviour (master)
Is there anything missing on my part in this PR? I don't think I have anything left to do. |
bit late, ik, but would it be possible to set the zoom level directly via popup on double-click on the slider, like almost all other controls in LMMS? I don't know if I'm going to remember Ctrl+0 for reset tbh. |
I'm planning on adding some zoom actions (for zoom-to-selection, zoom-to-loop, zoom-to-fit, etc.) I'll have a look at your suggestion, it makes sense. |
Now Zooming can be done with: