-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add option to clear all notes in SlicerT #7850
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
Conversation
43007ac
to
d8c343f
Compare
Trying to center the buttons right now, that's proving a bit difficult. I'll have to check the bounding box size, since I don't know if some row of pixels belongs to that box or not. - m_syncToggle->move((width() - 100), m_y1 + 5);
- m_clearButton->move((width() - 100), m_y1 + 30);
+ m_syncToggle->move((width() - 100), m_y1 - 7);
+ m_clearButton->move((width() - 100), m_y1 + 18); |
I think this looks pretty good: I worked off the logic of m_syncToggle->move((width() - 100), m_y1 + 5 - 11);
m_clearButton->move((width() - 100), m_y1 + 5 + 22 - 11); which is just: m_syncToggle->move((width() - 100), m_y1 - 6);
m_clearButton->move((width() - 100), m_y1 + 16); Literally just magic numbers! 🤣 Pushing that for now, I might find some better numbers. |
Keep in mind:
|
It freezes upon clicking the MIDI button after clearing all notes. this is consistently reproducible. video.mp4 |
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.
video.mp4
This fixes it
@@ -111,6 +117,12 @@ Knob* SlicerTView::createStyledKnob() | |||
return newKnob; | |||
} | |||
|
|||
// Clear all notes | |||
void SlicerTView::clearSlices() { | |||
m_slicerTParent->m_slicePoints.clear(); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Do we normally use camelCase for image file names?
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.
nope, usually snake_case
Will adress both in the next commit 🫡 |
Fixed! The changes include:
|
I think you forgot to push 😆 |
Doing final checks and pushing in a minute, I promise! 🤣 |
Looks good to me. You should add a comment that directs to this PR, which explains the mysterious values. |
@AW1534 Not a pushed change, just thinking out loud: - brush.drawText(s_x4 - 8, y1_text, s_textBoxWidth, s_textBoxHeight, Qt::AlignCenter, tr("Midi"));
+ brush.drawText(s_x4 - 8, y1_text, s_textBoxWidth, s_textBoxHeight, Qt::AlignCenter, tr("MIDI")); // tr(...)? I'm pretty sure it's "MIDI" in every language lol |
Yeah there's no need to translate MIDI. |
Anything blocking this? It's good for merge in my eyes |
plugins/SlicerT/SlicerTView.cpp
Outdated
m_slicerTParent->m_slicePoints.push_back(0); | ||
m_slicerTParent->m_slicePoints.push_back(1); |
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.
You should generally prefer using emplace_back
instead of push_back
.
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.
Just read up on it, makes sense! Want me to replace the two calls?
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.
Just read up on it, makes sense! Want me to replace the two calls?
Yes. Refer to here for an explanation as to why this is the case.
Renaming the title to be more "actionable". |
We wanted them to use Qt layouts.. I think it was me and MG arguing for the use of layouts so stuff like this wouldn't be necessary, you would just add the widget and tada. However, the author preferred not do that, something along the lines of it was simpler not to use their system. |
I think this is done. @AW1534 tested it already. @sakertooth please take a final look and, if all is well, merge. |
Adds a button that deletes all cuts made in a SlicerT instance.
2025-04-16.18-07-30.mp4