-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: static color coding for key column #13390
Conversation
I don't think so. That issue requests to color the key depending on how compatible it is to the currently playing track. |
constexpr mixxx::RgbColor kMixxxKeyColor1(0xFC4949); | ||
constexpr mixxx::RgbColor kMixxxKeyColor2(0xFE642D); | ||
constexpr mixxx::RgbColor kMixxxKeyColor3(0xF98C27); | ||
constexpr mixxx::RgbColor kMixxxKeyColor4(0xFED600); | ||
constexpr mixxx::RgbColor kMixxxKeyColor5(0x99FE00); | ||
constexpr mixxx::RgbColor kMixxxKeyColor6(0x42FE3E); | ||
constexpr mixxx::RgbColor kMixxxKeyColor7(0x0AD58F); | ||
constexpr mixxx::RgbColor kMixxxKeyColor8(0x0AE7E7); | ||
constexpr mixxx::RgbColor kMixxxKeyColor9(0x04C9FE); | ||
constexpr mixxx::RgbColor kMixxxKeyColor10(0x3D8AFD); | ||
constexpr mixxx::RgbColor kMixxxKeyColor11(0xAC64FE); | ||
constexpr mixxx::RgbColor kMixxxKeyColor12(0xFD3FEA); | ||
|
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.
as a follow up, it would be nice if the palette was customizable via the Color
Preferences. similar to track colors.
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.
Super nice to have, follow up²: set the colors in the notation table in Key preferences
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.
Yeah, Though I guess we'll have to decide on whether its better to put in the "Colors" or the "Key Detection" settings. The former would be more consistent IMO.
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.
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'd somehow try to put it in the same column. but I'm not a UI designer. Wdyt @ronso0?
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.
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.
maybe swap the order of the text and the check box so its all still right aligned? idk, IIANA Designer.
Probably not. You should store the underlying |
Thank you so much @Swiftb0y for the feedback! Preferences for key color palettes is definitely in the plans. I will apply the requested changes and try the item role method. |
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.
Thank you, this looks nice!
Can you update the screenshot in the initial description of this PR? This way it is more significant if one is later following links from the Changelog. |
Is the draft state still correct or is it ready for final review and tests? |
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 a minor comment. Rest LGTM, thank you.
@@ -144,6 +144,21 @@ constexpr mixxx::RgbColor kVirtualDJTrackColorBlue(0x0000FF); | |||
constexpr mixxx::RgbColor kVirtualDJTrackColorFuchsia(0xFF00FF); | |||
constexpr mixxx::RgbColor kVirtualDJTrackColorWhite(0xFFFFFF); | |||
|
|||
// Default Mixxx Key Color Palette |
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.
Please give also a hint as source code comment, how these colors have been generated
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 it is a comon practice to follow the Hue circle to easily distinguish neighbors.
However there might be issues with all kind of eye issues.
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.
Interesting are the hue curves of different color blind people. So I guess in a follow up PR, we may offer the full hue curve and reduced versions for color blind people that is only using half of the hue range.
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.
We could provide preset palettes optimized for the different types of colorblindness. I think gradients for those already exist online. This would be fairly straightforward to implement once the requested custom keypalettes are in place.
Yes, I am not done yet. I still have to read the Key Colors setting and only render the rectangle if it is enabled. Also I'd like to squash a couple of commits before review, at least the one which was failing to build. |
I want to read the setting using I see that the Should I go about this in some other way entirely? |
I don't think accessing the config in the KeyUtils is a good idea. Can you share a little more insight on what you're trying to accomplish? Then we can brainstorm together. |
I have added a preference setting to enable/disable Key Colors. It is called Now, I want to display the key colors only when this setting is on. Initially, I was trying to do this preference check inside KeyDelegate. But then I noticed that the Should the check instead be done inside KeyDelegate? |
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.
LGTM. Thank you. Who wants to press the button? Did you want to rebase first?
Thank you so much, this is very helpful. I'll discuss with Daniel for the next steps, and I'll keep these points in mind for future PRs. I am growing a lot thanks to this project. :) I do want to rebase! |
Thank you for the review. Yes, there is room for improvements. On the other hand we have tight plan for the remaining project. From this point of view I would rather see a beautiful Heat column instead of beautiful code. We have already the green check marks so I will merge once @danferns gives a go. If you feeling lucky to address some of @Swiftb0y points, go ahead and propose it in a separate PR. |
also check bounds for Open Key number inside it. Co-authored-by: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> Co-authored-by: Daniel Schürmann <daschuer@mixxx.org>
This will allow for narrow column setups.
Co-authored-by: ronso0 <ronso0@mixxx.org>
Add a `KeyColorsEnabled` setting under the `[Config]` group. And render a checkbox for it in the Color preferences.
Co-authored-by: ronso0 <ronso0@mixxx.org>
Co-authored-by: ronso0 <ronso0@mixxx.org>
also add checkbox to <tabstops> Co-authored-by: ronso0 <ronso0@mixxx.org>
468c9be
to
f75ec58
Compare
I'm done with the rebase! I squashed only a build error, and two commits involving indentation / comments. If anything else is needed then let me know, but otherwise I am ready for this PR to be merged! |
I agree in this case. |
Thank you very much! This looks really nice and works good. |
After synching my dev branch, I just seen that eye candy appeared. It looks very good! Thanks for that feature! |
There is only one palette atm. Repaint with/without colors only happens when the table is repainted after the preferences are closed. |
Thank you for reporting this. Just fixed it, a PR will come soon! |
Hi! I just got the core of this feature working and I'm seeking feedback.
A small rectangle is drawn next to the Key label in the Library. The color of the rectangle is based on the Key of the track.
I'm concerned about the method used for finding the track's key. Right now, I'm using
KeyUtils::guessKeyFromText
on the Key string, but I don't think that'll work if the user sets custom Key Notation.I want to use the value in
ColumnCache::COLUMN_LIBRARYTABLE_KEY_ID
. But I haven't been able to figure out how to access this column from theQModelIndex& index
that is passed intoKeyDelegate::paintItem
. I'm not sure if the column is even available.Is there a place where I can see how the index is structured?
Once complete, this will resolve #7810.