Skip to content

Commit

Permalink
DlgTrackInfo, track color: separate UI logic / track record color
Browse files Browse the repository at this point in the history
Co-authored-by: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com>
  • Loading branch information
ronso0 and Swiftb0y authored Apr 23, 2023
1 parent c6ef76f commit 0cf2f6c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/library/dlgtrackinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ void DlgTrackInfo::init() {
connect(m_pColorPicker.get(),
&WColorPickerAction::colorPicked,
this,
&DlgTrackInfo::slotColorPicked);
[this](const mixxx::RgbColor::optional_t& newColor) {
trackColorDialogSetColor(newColor);
m_trackRecord.setColor(newColor);
});
}

void DlgTrackInfo::slotApply() {
Expand Down Expand Up @@ -332,7 +335,7 @@ void DlgTrackInfo::updateFromTrack(const Track& track) {
track.getLocation());

// paint the color selector and check the respective color picker button
slotColorPicked(track.getColor());
trackColorDialogSetColor(track.getColor());

txtLocation->setText(QDir::toNativeSeparators(track.getLocation()));

Expand Down Expand Up @@ -524,12 +527,10 @@ void DlgTrackInfo::slotColorButtonClicked() {
btnColorPicker->showMenu();
}

void DlgTrackInfo::slotColorPicked(const mixxx::RgbColor::optional_t& newColor) {
void DlgTrackInfo::trackColorDialogSetColor(const mixxx::RgbColor::optional_t& newColor) {
m_pColorPicker->setSelectedColor(newColor);
btnColorPicker->menu()->close();

m_trackRecord.setColor(newColor);


if (newColor) {
btnColorPicker->setText("");
const QColor ccolor = mixxx::RgbColor::toQColor(newColor);
Expand Down

0 comments on commit 0cf2f6c

Please sign in to comment.