Skip to content
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

Make Hotcue RGB colors configurable #2530

Merged
merged 31 commits into from
Mar 20, 2020

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented Mar 3, 2020

Follow up to #2520. This adds multiple predefined color palettes and a preferences page to select one.

@Holzhaus Holzhaus added the ui label Mar 3, 2020
@Holzhaus Holzhaus added this to the 2.3.0 milestone Mar 3, 2020
@Holzhaus Holzhaus self-assigned this Mar 3, 2020
@Holzhaus Holzhaus force-pushed the hotcue-rgb-color-picker branch 2 times, most recently from 2001075 to a0d1724 Compare March 4, 2020 11:23
@Holzhaus Holzhaus force-pushed the hotcue-rgb-color-picker branch 3 times, most recently from b41234d to 2dc411e Compare March 6, 2020 15:03
@Holzhaus
Copy link
Member Author

Holzhaus commented Mar 6, 2020

The Palette Editor was less work than I thought. Here's a little preview:
Hotcue Palette Editor Preview

@Holzhaus
Copy link
Member Author

Holzhaus commented Mar 6, 2020

This is lacking a nice icon for the the preference page, otherwise this is ready to review.

@Holzhaus Holzhaus changed the title [WIP] Make Hotcue RGB colors configurable Make Hotcue RGB colors configurable Mar 6, 2020
@Holzhaus
Copy link
Member Author

Holzhaus commented Mar 6, 2020

@ronso0 Do you want to make an icon? Maybe a paintbrush or something like that?

@daschuer
Copy link
Member

daschuer commented Mar 6, 2020

How about something similar to this: https://emojipedia.org/google/android-4.3/artist-palette/

@daschuer
Copy link
Member

daschuer commented Mar 6, 2020

Thank you for the nice little preview.
Did you consider to add an edit mode to hide edit features?

The GUI suits for users who wants to tweak the palette. However this is a rare use case.

We should stream line the GUI for the common task to switch to Serato colors.

@daschuer
Copy link
Member

daschuer commented Mar 6, 2020

The hotcue default color selection can be improved. Did you consider to use the combo box from my proposal?

Do we need a way to go back to default orange once another color has been selected?

@ronso0
Copy link
Member

ronso0 commented Mar 6, 2020

@ronso0 Do you want to make an icon? Maybe a paintbrush or something like that?

Hehee, I was already looking for one.. :)
Reagrding the icon size in the Pref list I think a simple paint brush will do, or even just a brush tip.
A palette at that size is not clear and somehow looks like the GNome icon.

color_palette_icon
color_palette_icon_s
color_palette_icon_xs

@Holzhaus
Copy link
Member Author

Holzhaus commented Mar 6, 2020

Did you consider to add an edit mode to hide edit features?

The GUI suits for users who wants to tweak the palette. However this is a rare use case.

We could remove the palette editor from the preferences page and instead add an "edit palettes" button that opens the palette editor ins a separate window. Is that what you had in mind?

@Holzhaus
Copy link
Member Author

Holzhaus commented Mar 6, 2020

The hotcue default color selection can be improved. Did you consider to use the combo box from my proposal?

If you want to use a single color, you can just edit the palette and but a "1" next to the color you want (and remove all other number from the "Assign to Hotcue" column). That will color all new cues in that color.

Do we need a way to go back to default orange once another color has been selected?

You could just re-add orange to the palette and then do as I described above.

I think this allows great flexibility when configuring palettes. IMHO we should even drop the dedicated auto hotcue colors option and make that the default. If you want to make all new cues a single color, you can just configure the palette to your liking and only auto-assign a single color.

@Holzhaus Holzhaus force-pushed the hotcue-rgb-color-picker branch 2 times, most recently from 4280a0d to f3ca6f6 Compare March 6, 2020 22:17
@ronso0
Copy link
Member

ronso0 commented Mar 9, 2020

I made an svg from the brush tip.
Does this look okay to everyone?
ic_preferences_colors svg_24
ic_preferences_colors svg_32
ic_preferences_colors.svg.png.zip

@ywwg
Copy link
Member

ywwg commented Mar 9, 2020

Does this look okay to everyone?

that seems fine -- the source image you used for this was an open source SVG, right?

@ronso0
Copy link
Member

ronso0 commented Mar 9, 2020

I created the svg by looking a some raster graphics.
Now it's opensource :)

@ywwg
Copy link
Member

ywwg commented Mar 9, 2020

I created the svg by looking a some raster graphics.

IANAL but sgtm

@ronso0
Copy link
Member

ronso0 commented Mar 9, 2020

I created the svg by looking a some raster graphics.

...and tweaking the design for the size we need in the Pref window.
This build errors, so I'll test the icon in master.
I'll be back with the final version then.

@Holzhaus Holzhaus changed the title Make Hotcue RGB colors configurable [WIP] Make Hotcue RGB colors configurable Mar 10, 2020
@Holzhaus
Copy link
Member Author

I'll mark this as WIP until #2520 has been merged.

Copy link
Member

@ywwg ywwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first round of comments. Thanks again for doing all this

src/preferences/colorpaletteeditor.cpp Outdated Show resolved Hide resolved
src/preferences/colorpaletteeditor.cpp Outdated Show resolved Hide resolved
src/preferences/colorpaletteeditormodel.h Show resolved Hide resolved
@Holzhaus
Copy link
Member Author

Anything else or can we merge this?

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor nitpicks

src/preferences/colorpaletteeditormodel.h Outdated Show resolved Hide resolved
src/preferences/colorpalettesettings.cpp Outdated Show resolved Hide resolved
src/preferences/dialog/dlgprefcolors.h Outdated Show resolved Hide resolved
src/preferences/colorpaletteeditor.h Outdated Show resolved Hide resolved
Copy link
Member

@ywwg ywwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Holzhaus
Copy link
Member Author

@uklotzde Done.

@uklotzde
Copy link
Contributor

Debug assertion on shutdown (some line numbers may vary, merged into my personal development branch):

Debug [Main]: 910 ms deleting DlgPreferences
DEBUG ASSERT: "!m_ptr || m_ptr->parent()" in function parented_ptr<ColorPaletteEditorModel>::~parented_ptr() [T = ColorPaletteEditorModel] at /tmp/mixxx/src/util/parented_ptr.h:31

Thread 1 "mixxx" received signal SIGABRT, Aborted.
#7  0x00000000004d0e4e in mixxx_debug_assert(char const*, char const*, int, char const*)
    (assertion=0x107e320 "!m_ptr || m_ptr->parent()", file=0x107e33a "/tmp/mixxx/src/util/parented_ptr.h", line=31, function=0x10c8cc4 "parented_ptr<ColorPaletteEditorModel>::~parented_ptr() [T = ColorPaletteEditorModel]") at /tmp/mixxx/src/util/assert.h:11
#8  0x0000000000797e20 in parented_ptr<ColorPaletteEditorModel>::~parented_ptr() (this=0x5673e18) at /tmp/mixxx/src/util/parented_ptr.h:31
#9  0x000000000077d5e3 in ColorPaletteEditor::~ColorPaletteEditor() (this=0x5673dc0) at /tmp/mixxx/src/preferences/colorpaletteeditor.h:14
#10 0x000000000077d64c in ColorPaletteEditor::~ColorPaletteEditor() (this=0x5673dc0) at /tmp/mixxx/src/preferences/colorpaletteeditor.h:14
#11 0x00007ffff42f584c in QObjectPrivate::deleteChildren() () at /lib64/libQt5Core.so.5
#12 0x00007ffff6e306b9 in QWidget::~QWidget() () at /lib64/libQt5Widgets.so.5
#13 0x00007ffff6f2ba9d in QGroupBox::~QGroupBox() () at /lib64/libQt5Widgets.so.5
#14 0x00007ffff42f584c in QObjectPrivate::deleteChildren() () at /lib64/libQt5Core.so.5
#15 0x00007ffff6e306b9 in QWidget::~QWidget() () at /lib64/libQt5Widgets.so.5
#16 0x0000000000559018 in DlgPreferencePage::~DlgPreferencePage() (this=0x5675030) at /tmp/mixxx/src/preferences/dlgpreferencepage.cpp:8
#17 0x0000000000b592d1 in DlgPrefColors::~DlgPrefColors() (this=0x5675030) at /tmp/mixxx/src/preferences/dialog/dlgprefcolors.cpp:33
#18 0x0000000000b5931c in DlgPrefColors::~DlgPrefColors() (this=0x5675030) at /tmp/mixxx/src/preferences/dialog/dlgprefcolors.cpp:32
#19 0x00007ffff42f584c in QObjectPrivate::deleteChildren() () at /lib64/libQt5Core.so.5
#20 0x00007ffff6e306b9 in QWidget::~QWidget() () at /lib64/libQt5Widgets.so.5
#21 0x00007ffff6e308ad in QWidget::~QWidget() () at /lib64/libQt5Widgets.so.5
#22 0x00007ffff42f584c in QObjectPrivate::deleteChildren() () at /lib64/libQt5Core.so.5
#23 0x00007ffff6e306b9 in QWidget::~QWidget() () at /lib64/libQt5Widgets.so.5
#24 0x00007ffff6f9289d in QScrollArea::~QScrollArea() () at /lib64/libQt5Widgets.so.5
#25 0x00007ffff42f584c in QObjectPrivate::deleteChildren() () at /lib64/libQt5Core.so.5
#26 0x00007ffff6e306b9 in QWidget::~QWidget() () at /lib64/libQt5Widgets.so.5
#27 0x00007ffff6fa898d in QStackedWidget::~QStackedWidget() () at /lib64/libQt5Widgets.so.5
#28 0x00007ffff42f584c in QObjectPrivate::deleteChildren() () at /lib64/libQt5Core.so.5
#29 0x00007ffff6e306b9 in QWidget::~QWidget() () at /lib64/libQt5Widgets.so.5
#30 0x00000000005094cd in DlgPreferences::~DlgPreferences() (this=0x432e130) at /tmp/mixxx/src/preferences/dialog/dlgpreferences.cpp:183
#31 0x000000000050954c in DlgPreferences::~DlgPreferences() (this=0x432e130) at /tmp/mixxx/src/preferences/dialog/dlgpreferences.cpp:171
#32 0x00000000004db381 in MixxxMainWindow::finalize() (this=0x7fffffffcfd0) at /tmp/mixxx/src/mixxx.cpp:745

@uklotzde
Copy link
Contributor

I also see a warning during startup:

Debug [Main]: DbConnectionPooled - Found thread-local database connection "MIXXX-1" QSqlDatabase(driver="QSQLITE", database="file:///home/uk/.mixxx/mixxxdb.sqlite", host="", port=-1, user="mixxx", open=true)
Warning [Main]: Color Palette "Mixxx Hotcue Colors" is a built-in palette, not writing to config!
Warning [Main]: Color Palette "Mixxx Hotcue Colors" is a built-in palette, not writing to config!
Debug [Main]: Key plugin ID: "qm-keydetector:2"

This should not happen. Either the log level is wrong or we should handle this case gracefully.

Since the parented_ptr approach caused crashes on shutdown, I switched
to a regular pointer and set the QTableView as the parent object of
model. According to the Qt docs, this should transfer ownership to the
table view when setModel() is called.
@Holzhaus Holzhaus requested a review from uklotzde March 20, 2020 10:25
Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the last commit and keep using parented_ptr. Only the parent m_pTableView was missing:

m_pModel(make_parented<ColorPaletteEditorModel>(m_pTableView))

@Holzhaus Holzhaus requested a review from uklotzde March 20, 2020 12:15
@uklotzde
Copy link
Contributor

Good job, Jan!

LGTM

@uklotzde uklotzde merged commit a189892 into mixxxdj:master Mar 20, 2020
@JaviVilarroig
Copy link
Contributor

@Holzhaus It seems I was too slow. Still slow with git. I have just managed to compile this PR. Still interested in any testing from my side?

@ywwg
Copy link
Member

ywwg commented Mar 21, 2020

it's ok to test still, and if you catch any problems we'll address them for sure!

@Holzhaus
Copy link
Member Author

Yup, but it make sense to test this on master. That way you catch problems that were introduced by the merge itself as well.

@JaviVilarroig
Copy link
Contributor

OK. Now that I know how to do it I will move to master :)
Anything special to test? O do I just "play" a little bit with the colors?

@Holzhaus
Copy link
Member Author

No just play around and check if you can define custom cue palettes. I just found a little bug in master tho, so better test #2586.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants