-
-
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
DlgTrackInfo: add track color selector #11436
Conversation
29dc7fe
to
ed115fb
Compare
fad5eea
to
6682c82
Compare
Done. |
6682c82
to
3a19449
Compare
Ready! |
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 used two buttons (Fusion + native style) in order to make the (no color) button blend in, and because --at that time-- I didn't figure how to reset the background color ( However, I figured the color reset (simply |
3a19449
to
e283a3b
Compare
Maybe that's due to this snippet in res/skins/default.qss ??
edit late night comment, it's entirely unrelated. |
Works well and looks good. The fusion style looks a little out of place but thats part of the color picker widget, right? |
The Fusion style is required to paint the color button via qss. Else (native theme) painting the button background requires qss hacks like "border: none" which obviously means we'd need to style the entire button ourselves. The code is mostly from DlgReplaceCueColor. |
No idea why |
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.
Functionality works, but I'd prefer if you could slightly restructure the code.
src/library/dlgtrackinfo.cpp
Outdated
void DlgTrackInfo::slotColorPicked(const mixxx::RgbColor::optional_t& newColor) { | ||
m_pColorPicker->setSelectedColor(newColor); | ||
btnColorPicker->menu()->close(); | ||
|
||
m_trackRecord.setColor(newColor); | ||
|
||
if (newColor) { | ||
btnColorPicker->setText(""); |
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.
Can you separate the logic for changing the color picker style and setting from the logic that sets the track color? Otherwise initializing the color picker with data would automatically also result in setting the track color again. At least I think its better to separate the UI logic action from the database action.
void DlgTrackInfo::slotColorPicked(const mixxx::RgbColor::optional_t& newColor) { | |
m_pColorPicker->setSelectedColor(newColor); | |
btnColorPicker->menu()->close(); | |
m_trackRecord.setColor(newColor); | |
if (newColor) { | |
btnColorPicker->setText(""); | |
void DlgTrackInfo::trackColorDialogSetColor(const mixxx::RgbColor::optional_t& newColor) { | |
m_pColorPicker->setSelectedColor(newColor); | |
btnColorPicker->menu()->close(); | |
if (newColor) { | |
btnColorPicker->setText(""); |
0cf2f6c
to
0a16e8f
Compare
0a16e8f
to
2b32bd2
Compare
Co-authored-by: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com>
2b32bd2
to
0b0f251
Compare
Sure, makes sense. We could also move button->close menu into the lambda but I think it's okay now. |
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. LGTM.
Thanks for your review! |
A duplicated name slipped though
|
Oh. I just pushed a fix. |
Sorry, thanks for the the prompt fix. |
supersedes #11390
Uses
WColorPickerAction
This requires two buttons, each with the color picker that's used in the track menu and hotcue popup:
ToDo
skin/default.qss
🤷 ) edit: IIRC this requires to allow custom styles for the entire dialog / color picker which could cause trouble (inheritance of WLibraryTableView styles, conflicts with system style) so maybe we need to fix this in c++, WColorPicker/~Action