-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Restructure Palettes buttons and add "Expand/Collapse All" buttons #6593
Restructure Palettes buttons and add "Expand/Collapse All" buttons #6593
Conversation
Great! Would you mind posting a screenshot? |
@Marr11317 Done that, in the original post! |
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.
[[ Not a MuseScore contributor or reviewer by any means, but I was asked to look at this PR externally, with some kind of C++ and QML hats on ]]
- Looks good overall
- The screencast is a good touch in the PR
- Copyright statements are a mess; even with the CLA in place, it seems weird to claim a 2019 date on some new QML, and some code copyrighted by the BV and some by an individual who's not you.
@@ -60,7 +60,7 @@ PalettePropertiesDialog::~PalettePropertiesDialog() | |||
} | |||
|
|||
//--------------------------------------------------------- | |||
// PalettePropertiesDialog::setData | |||
// PalettePropertiesDialog::fillControlsWithData |
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 an unrelated change, although it is correct. Might want to split that to a separate commit / 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.
True, but I thought that it's neither convenient to have a PR for such a small, unimportant change. Do you think it's OK to leave it like this?
|
||
preferencesListenerID = preferences.addOnSetListener([this](const QString& key, const QVariant& value) { | ||
if (key == PREF_APP_USESINGLEPALETTE) | ||
emit singlePaletteChanged(); |
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.
For QML purposes, it's sometimes better to pass the changed value in the signal, e.g. singlePaletteChanged(value.toBool())
, but existing signals in the MuseScore codebase are inconsistent in that regard.
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 read different opinions about this. Some people say that you should pass the value in the signal, others say that you definitely shouldn't. Anyway, I'm not sure how to tell Qml that it should take the value from the signal. Or does it automatically, when the signal has a parameter?
} | ||
|
||
onAboutToShow: { | ||
// TODO: change these properties automatically whenever a palette is expanded/collapsed |
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.
These properties could be added to the model itself, though that's an opinion on what belongs in the model and what doesn't. You'd either get a model signal, or bind to a property in paletteTree that is bound to the model property.
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 put them here, because they are only updated when the Popup opens. So when something else would read these properties, chances are that they are not up-to-date. Ideally, there would be a signal to update the properties automatically when a Palette is collapsed or expanded. In that case, it would be okay to move them to the model. It could be a next step to implement this.
61f5267
to
9a056ff
Compare
@adriaandegroot Thanks for your review! I answered and resolved the points you mentioned. |
9a056ff
to
2f3687f
Compare
Just leave the existing Copyright statements as they are (this is indeed a cleanup job that should eventually get done, but surely not as part of this PR), but fix those for your new files. |
2f3687f
to
de61423
Compare
- Moved the "Add Palettes" button to the right of the search field; - Replaced the button text with a '+' icon; - Made the search field a bit wider; - Added an extra '...' button at the right; - Created a popup for the new button; - Filled the popup with "Expand/Collapse All" buttons; - Moved the "Single Palette" option to the new popup; - Removed the context menu formerly holding "Single Palette"; - Tested thoroughly.
de61423
to
73b3ce0
Compare
... to make it look better in a separate window.
I'll merge it in 3.x, but it shouldn't be ported to master because we have the whole new implementation |
This is what I did:
A MuseScore user and friend of mine requested this feature, so I started looking if I could implement it. I also had some correspondence about this with Tantacrul in the MuseScore Developer Chat, and he agreed with the changes.
By the way: this is the very first time that I'm using Qml (and sort of my first real contribution for MuseScore), so I'll be welcoming any feedback!
Maybe this PR is something for MuseScore 3.6, because it's not really a breaking change, but it involves some string translations.