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

lp1100882: Add support for track colors #2470

Merged
merged 33 commits into from
Feb 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4e26302
widget/wcolorpicker: Move tracking of selected color into class
Holzhaus Jan 28, 2020
c7daee8
lp1100882: Add support for track colors
Holzhaus Jan 28, 2020
d9d332f
widget/wcolorpickeraction: Set parent widget
Holzhaus Feb 7, 2020
74dd76b
database/mixxdb: Bump required schema version
Holzhaus Feb 7, 2020
2c7baf8
widget/wcolorpicker: Add "no color" support
Holzhaus Feb 7, 2020
7de0b46
widget/wcolorpickeraction: Enable "no color" support
Holzhaus Feb 7, 2020
2049f26
Use std::optional<RgbColor> for track colors
uklotzde Jan 31, 2020
ed3eca7
library: Get rid of special color constants and use NULL instead
Holzhaus Feb 11, 2020
fd2b5a5
library/basesqltablemodel: Remove useless color QVariant conversions
Holzhaus Feb 11, 2020
aac2132
widget/wcolorpicker: Swap WColorPicker parameters and use parented_ptr
Holzhaus Feb 11, 2020
0001ccc
widget: Make WColorPicker and WColorPickerAction constructors explicit
Holzhaus Feb 11, 2020
56c1615
widget/wcolorpickeraction: Do not hand out raw pointer to color picker
Holzhaus Feb 11, 2020
21a7e30
widget/wtracktableview: Use const to avoid copy-on-write in for-each …
Holzhaus Feb 12, 2020
1f4a6e5
library/colordelegate: Mark ColorDelegate::paintItem as override
Holzhaus Feb 12, 2020
49bd30e
widget: Use enum class for color picker options
Holzhaus Feb 12, 2020
486bd3c
widget/wtracktableview: Fix spacing and linebreaks
Holzhaus Feb 12, 2020
d1d8eef
widget: Rename enum class to WColorPicker::ColorOption
Holzhaus Feb 12, 2020
ec262d7
library/colordelegate: Remove leftover debug message
Holzhaus Feb 12, 2020
fcb1b8e
widget/wcolorpickeraction: Set color picker in initializer list
Holzhaus Feb 12, 2020
c0aec06
widget/wcolorpicker: Split connect arguments on separate lines
Holzhaus Feb 12, 2020
4c84c66
widget/wtracktableview: Update menu labels for BPM/Color
Holzhaus Feb 12, 2020
55b0423
widget/wtracktableview: Fix pre-selection of currently active track c…
Holzhaus Feb 12, 2020
5f158c0
widget/wtracktableview: Use RgbColor::optional instead of optional_t
Holzhaus Feb 12, 2020
24ce477
widget/wtracktableview: Assign std::nullopt instead of using reset()
Holzhaus Feb 13, 2020
c9cc2ff
Merge branch 'master' of github.com:mixxxdj/mixxx into track-colors
Holzhaus Feb 13, 2020
81d0616
widget/wtracktableview: Use *trackColor instead of trackColor.value()
Holzhaus Feb 14, 2020
bf79c04
Merge branch 'master' of https://github.com/mixxxdj/mixxx into track-…
Holzhaus Feb 14, 2020
c1cbff2
widget/wtracktableview: Simplify code by using mixxx::RgbColor::optional
Holzhaus Feb 14, 2020
0730318
widget/wtracktableview: Fix preselection if tracks have different colors
Holzhaus Feb 14, 2020
e95ecec
Merge branch 'master' of github.com:mixxxdj/mixxx into track-colors
Holzhaus Feb 14, 2020
e4c3c68
library/colordelegate: Make code more readable
Holzhaus Feb 14, 2020
21afe4d
Replace has_value() with explicit bool operator
Holzhaus Feb 15, 2020
6019dbe
Merge branch 'master' into track-colors
uklotzde Feb 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/library/browse/browsetablemodel.cpp
src/library/browse/browsethread.cpp
src/library/browse/foldertreemodel.cpp
src/library/colordelegate.cpp
src/library/columncache.cpp
src/library/coverart.cpp
src/library/coverartcache.cpp
Expand Down Expand Up @@ -634,6 +635,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/widget/wbattery.cpp
src/widget/wbeatspinbox.cpp
src/widget/wcolorpicker.cpp
src/widget/wcolorpickeraction.cpp
src/widget/wcombobox.cpp
src/widget/wcoverart.cpp
src/widget/wcoverartlabel.cpp
Expand Down
2 changes: 2 additions & 0 deletions build/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ def sources(self, build):
"src/widget/wcoverartlabel.cpp",
"src/widget/wcoverartmenu.cpp",
"src/widget/wcolorpicker.cpp",
"src/widget/wcolorpickeraction.cpp",
"src/widget/wcuemenupopup.cpp",
"src/widget/wsingletoncontainer.cpp",
"src/widget/wmainmenubar.cpp",
Expand Down Expand Up @@ -1112,6 +1113,7 @@ def sources(self, build):
"src/library/stareditor.cpp",
"src/library/bpmdelegate.cpp",
"src/library/previewbuttondelegate.cpp",
"src/library/colordelegate.cpp",
"src/library/coverartdelegate.cpp",
"src/library/locationdelegate.cpp",
"src/library/tableitemdelegate.cpp",
Expand Down
8 changes: 8 additions & 0 deletions res/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -481,4 +481,12 @@ METADATA
);
</sql>
</revision>
<revision version="31" min_compatible="3">
<description>
Add track color support.
</description>
<sql>
ALTER TABLE library ADD COLUMN color INTEGER;
</sql>
</revision>
</schema>
4 changes: 4 additions & 0 deletions res/skins/default.qss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ WCueMenuPopup #CueDeleteButton {
qproperty-icon: url(:/images/ic_delete.svg);
}

WColorPicker QPushButton[noColor="true"] {
background-color: black;
}

WColorPicker QPushButton[checked="false"] {
qproperty-icon: none;
}
Expand Down
2 changes: 1 addition & 1 deletion src/database/mixxxdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const QString MixxxDb::kDefaultSchemaFile(":/schema.xml");

//static
const int MixxxDb::kRequiredSchemaVersion = 30;
const int MixxxDb::kRequiredSchemaVersion = 31;

namespace {

Expand Down
8 changes: 8 additions & 0 deletions src/library/basesqltablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "library/basesqltablemodel.h"

#include "library/bpmdelegate.h"
#include "library/colordelegate.h"
#include "library/coverartdelegate.h"
#include "library/locationdelegate.h"
#include "library/previewbuttondelegate.h"
Expand Down Expand Up @@ -118,6 +119,8 @@ void BaseSqlTableModel::initHeaderData() {
tr("Preview"), 50);
setHeaderProperties(ColumnCache::COLUMN_LIBRARYTABLE_COVERART,
tr("Cover Art"), 90);
setHeaderProperties(ColumnCache::COLUMN_LIBRARYTABLE_COLOR,
tr("Color"), 10);
setHeaderProperties(ColumnCache::COLUMN_LIBRARYTABLE_REPLAYGAIN,
tr("ReplayGain"), 50);
setHeaderProperties(ColumnCache::COLUMN_LIBRARYTABLE_SAMPLERATE,
Expand Down Expand Up @@ -150,6 +153,7 @@ void BaseSqlTableModel::initSortColumnMapping() {
m_columnIndexBySortColumnId[TrackModel::SortColumnId::SORTCOLUMN_RATING] = fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_RATING);
m_columnIndexBySortColumnId[TrackModel::SortColumnId::SORTCOLUMN_KEY] = fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_KEY);
m_columnIndexBySortColumnId[TrackModel::SortColumnId::SORTCOLUMN_PREVIEW] = fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_PREVIEW);
m_columnIndexBySortColumnId[TrackModel::SortColumnId::SORTCOLUMN_COLOR] = fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COLOR);
m_columnIndexBySortColumnId[TrackModel::SortColumnId::SORTCOLUMN_COVERART] = fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART);
m_columnIndexBySortColumnId[TrackModel::SortColumnId::SORTCOLUMN_SAMPLERATE] = fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_SAMPLERATE);

Expand Down Expand Up @@ -795,6 +799,8 @@ QVariant BaseSqlTableModel::data(const QModelIndex& index, int role) const {
if (value.canConvert(QMetaType::Int)) {
value = QVariant::fromValue(StarRating(value.toInt()));
}
} else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COLOR)) {
value = QString();
}
break;
case Qt::CheckStateRole:
Expand Down Expand Up @@ -1135,6 +1141,8 @@ QAbstractItemDelegate* BaseSqlTableModel::delegateForColumn(const int i, QObject
return new PreviewButtonDelegate(pTableView, i);
} else if (i == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_NATIVELOCATION)) {
return new LocationDelegate(pTableView);
} else if (i == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COLOR)) {
return new ColorDelegate(pTableView);
} else if (i == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART)) {
CoverArtDelegate* pCoverDelegate = new CoverArtDelegate(pTableView);
connect(pCoverDelegate,
Expand Down
2 changes: 2 additions & 0 deletions src/library/basetrackcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,8 @@ void BaseTrackCache::getTrackValueForColumn(TrackPointer pTrack,
trackValue.setValue(static_cast<int>(pTrack->getKey()));
} else if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM_LOCK) == column) {
trackValue.setValue(pTrack->isBpmLocked());
} else if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COLOR) == column) {
trackValue.setValue(toQVariant(pTrack->getColor()));
} else if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART_LOCATION) == column) {
trackValue.setValue(pTrack->getCoverInfo().coverLocation);
} else if (fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_COVERART_HASH) == column ||
Expand Down
34 changes: 34 additions & 0 deletions src/library/colordelegate.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include "library/colordelegate.h"

#include <QColor>
#include <QPainter>
#include <QStyle>
#include <QTableView>

#include "library/trackmodel.h"
#include "util/color/rgbcolor.h"

ColorDelegate::ColorDelegate(QTableView* pTableView)
: TableItemDelegate(pTableView) {
}

void ColorDelegate::paintItem(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const {
const auto color = mixxx::RgbColor::optional(index.data());

if (!color) {
// Filter out track color that is hidden
if (option.state & QStyle::State_Selected) {
painter->fillRect(option.rect, option.palette.highlight());
}
return;
}

painter->fillRect(option.rect, toQColor(color));

// Paint transparent highlight if row is selected
if (option.state & QStyle::State_Selected) {
QColor highlightColor = option.palette.highlight().color();
highlightColor.setAlpha(0x60);
painter->fillRect(option.rect, highlightColor);
}
}
18 changes: 18 additions & 0 deletions src/library/colordelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

#include <QModelIndex>
#include <QPainter>
#include <QStyleOptionViewItem>

#include "library/tableitemdelegate.h"

class ColorDelegate : public TableItemDelegate {
Q_OBJECT
public:
explicit ColorDelegate(QTableView* pTableView);

void paintItem(
QPainter* painter,
const QStyleOptionViewItem& option,
const QModelIndex& index) const override;
};
1 change: 1 addition & 0 deletions src/library/columncache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ void ColumnCache::setColumns(const QStringList& columns) {
m_columnIndexByEnum[COLUMN_LIBRARYTABLE_KEY_ID] = fieldIndex(LIBRARYTABLE_KEY_ID);
m_columnIndexByEnum[COLUMN_LIBRARYTABLE_BPM_LOCK] = fieldIndex(LIBRARYTABLE_BPM_LOCK);
m_columnIndexByEnum[COLUMN_LIBRARYTABLE_PREVIEW] = fieldIndex(LIBRARYTABLE_PREVIEW);
m_columnIndexByEnum[COLUMN_LIBRARYTABLE_COLOR] = fieldIndex(LIBRARYTABLE_COLOR);
m_columnIndexByEnum[COLUMN_LIBRARYTABLE_COVERART] = fieldIndex(LIBRARYTABLE_COVERART);
m_columnIndexByEnum[COLUMN_LIBRARYTABLE_COVERART_SOURCE] = fieldIndex(LIBRARYTABLE_COVERART_SOURCE);
m_columnIndexByEnum[COLUMN_LIBRARYTABLE_COVERART_TYPE] = fieldIndex(LIBRARYTABLE_COVERART_TYPE);
Expand Down
1 change: 1 addition & 0 deletions src/library/columncache.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class ColumnCache : public QObject {
COLUMN_LIBRARYTABLE_KEY_ID,
COLUMN_LIBRARYTABLE_BPM_LOCK,
COLUMN_LIBRARYTABLE_PREVIEW,
COLUMN_LIBRARYTABLE_COLOR,
COLUMN_LIBRARYTABLE_COVERART,
COLUMN_LIBRARYTABLE_COVERART_SOURCE,
COLUMN_LIBRARYTABLE_COVERART_TYPE,
Expand Down
13 changes: 11 additions & 2 deletions src/library/dao/trackdao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void TrackDAO::addTracksPrepare() {
m_pQueryLibraryInsert->prepare("INSERT INTO library "
"("
"artist,title,album,album_artist,year,genre,tracknumber,tracktotal,composer,"
"grouping,filetype,location,comment,url,duration,rating,key,key_id,"
"grouping,filetype,location,color,comment,url,duration,rating,key,key_id,"
"bitrate,samplerate,cuepoint,bpm,replaygain,replaygain_peak,wavesummaryhex,"
"timesplayed,channels,mixxx_deleted,header_parsed,"
"beats_version,beats_sub_version,beats,bpm_lock,"
Expand All @@ -453,7 +453,7 @@ void TrackDAO::addTracksPrepare() {
"datetime_added"
") VALUES ("
":artist,:title,:album,:album_artist,:year,:genre,:tracknumber,:tracktotal,:composer,"
":grouping,:filetype,:location,:comment,:url,:duration,:rating,:key,:key_id,"
":grouping,:filetype,:location,:color,:comment,:url,:duration,:rating,:key,:key_id,"
":bitrate,:samplerate,:cuepoint,:bpm,:replaygain,:replaygain_peak,:wavesummaryhex,"
":timesplayed,:channels,:mixxx_deleted,:header_parsed,"
":beats_version,:beats_sub_version,:beats,:bpm_lock,"
Expand Down Expand Up @@ -520,6 +520,7 @@ namespace {
pTrackLibraryQuery->bindValue(":tracknumber", track.getTrackNumber());
pTrackLibraryQuery->bindValue(":tracktotal", track.getTrackTotal());
pTrackLibraryQuery->bindValue(":filetype", track.getType());
pTrackLibraryQuery->bindValue(":color", toQVariant(track.getColor()));
pTrackLibraryQuery->bindValue(":comment", track.getComment());
pTrackLibraryQuery->bindValue(":url", track.getURL());
pTrackLibraryQuery->bindValue(":duration", track.getDuration());
Expand Down Expand Up @@ -1039,6 +1040,12 @@ bool setTrackTotal(const QSqlRecord& record, const int column,
return false;
}

bool setTrackColor(const QSqlRecord& record, const int column,
TrackPointer pTrack) {
pTrack->setColor(mixxx::RgbColor::optional(record.value(column)));
return false;
}

bool setTrackComment(const QSqlRecord& record, const int column,
TrackPointer pTrack) {
pTrack->setComment(record.value(column).toString());
Expand Down Expand Up @@ -1236,6 +1243,7 @@ TrackPointer TrackDAO::getTrackById(TrackId trackId) const {
{ "tracktotal", setTrackTotal },
{ "filetype", setTrackFiletype },
{ "rating", setTrackRating },
{ "color", setTrackColor },
{ "comment", setTrackComment },
{ "url", setTrackUrl },
{ "duration", setTrackDuration },
Expand Down Expand Up @@ -1465,6 +1473,7 @@ bool TrackDAO::updateTrack(Track* pTrack) {
"filetype=:filetype,"
"tracknumber=:tracknumber,"
"tracktotal=:tracktotal,"
"color=:color,"
"comment=:comment,"
"url=:url,"
"duration=:duration,"
Expand Down
1 change: 1 addition & 0 deletions src/library/dao/trackschema.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const QString LIBRARYTABLE_KEY = "key";
const QString LIBRARYTABLE_KEY_ID = "key_id";
const QString LIBRARYTABLE_BPM_LOCK = "bpm_lock";
const QString LIBRARYTABLE_PREVIEW = "preview";
const QString LIBRARYTABLE_COLOR = "color";
const QString LIBRARYTABLE_COVERART = "coverart";
const QString LIBRARYTABLE_COVERART_SOURCE = "coverart_source";
const QString LIBRARYTABLE_COVERART_TYPE = "coverart_type";
Expand Down
1 change: 1 addition & 0 deletions src/library/mixxxlibraryfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ MixxxLibraryFeature::MixxxLibraryFeature(Library* pLibrary,
<< "track_locations.fs_deleted"
<< "library." + LIBRARYTABLE_COMMENT
<< "library." + LIBRARYTABLE_MIXXXDELETED
<< "library." + LIBRARYTABLE_COLOR
<< "library." + LIBRARYTABLE_COVERART_SOURCE
<< "library." + LIBRARYTABLE_COVERART_TYPE
<< "library." + LIBRARYTABLE_COVERART_LOCATION
Expand Down
1 change: 1 addition & 0 deletions src/library/trackmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class TrackModel {
SORTCOLUMN_FILE_MODIFIED_TIME,
SORTCOLUMN_FILE_CREATION_TIME,
SORTCOLUMN_SAMPLERATE,
SORTCOLUMN_COLOR,

// NUM_SORTCOLUMNS should always be the last item.
NUM_SORTCOLUMNIDS
Expand Down
12 changes: 12 additions & 0 deletions src/track/track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,18 @@ void Track::updatePlayCounter(bool bPlayed) {
}
}

mixxx::RgbColor::optional_t Track::getColor() const {
QMutexLocker lock(&m_qMutex);
return m_record.getColor();
}

void Track::setColor(mixxx::RgbColor::optional_t color) {
QMutexLocker lock(&m_qMutex);
if (compareAndSet(&m_record.refColor(), color)) {
markDirtyAndUnlock(&lock);
}
}

QString Track::getComment() const {
QMutexLocker lock(&m_qMutex);
return m_record.getMetadata().getTrackInfo().getComment();
Expand Down
4 changes: 4 additions & 0 deletions src/track/track.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ class Track : public QObject {
QString getGenre() const;
// Set genre
void setGenre(const QString&);
// Returns the track color
mixxx::RgbColor::optional_t getColor() const;
// Sets the track color
void setColor(mixxx::RgbColor::optional_t);
// Returns the user comment
QString getComment() const;
// Sets the user commnet
Expand Down
2 changes: 2 additions & 0 deletions src/track/trackrecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "track/playcounter.h"

#include "library/coverart.h"
#include "util/color/rgbcolor.h"


namespace mixxx {
Expand Down Expand Up @@ -44,6 +45,7 @@ class TrackRecord final {
PROPERTY_SET_BYVAL_GET_BYREF(QString, fileType, FileType)
PROPERTY_SET_BYVAL_GET_BYREF(QString, url, Url)
PROPERTY_SET_BYVAL_GET_BYREF(PlayCounter, playCounter, PlayCounter)
PROPERTY_SET_BYVAL_GET_BYREF(RgbColor::optional_t, color, Color)
PROPERTY_SET_BYVAL_GET_BYREF(CuePosition, cuePoint, CuePoint)
PROPERTY_SET_BYVAL_GET_BYREF(int, rating, Rating)
PROPERTY_SET_BYVAL_GET_BYREF(bool, bpmLocked, BpmLocked)
Expand Down
35 changes: 26 additions & 9 deletions src/widget/wcolorpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace {
const int kNumColumns = 4;
}

WColorPicker::WColorPicker(QWidget* parent)
WColorPicker::WColorPicker(ColorOption colorOption, QWidget* parent)
: QWidget(parent) {
QGridLayout* pLayout = new QGridLayout();
pLayout->setMargin(0);
Expand All @@ -34,7 +34,8 @@ WColorPicker::WColorPicker(QWidget* parent)
int row = 0;
int column = 0;
for (const auto& pColor : Color::kPredefinedColorsSet.allColors) {
if (*pColor == *Color::kPredefinedColorsSet.noColor) {
if (colorOption != ColorOption::AllowNoColor &&
pColor == Color::kPredefinedColorsSet.noColor) {
continue;
}

Expand All @@ -43,10 +44,14 @@ WColorPicker::WColorPicker(QWidget* parent)
pColorButton->setStyle(m_pStyle);
}

// Set the background color of the button. This can't be overridden in skin stylesheets.
pColorButton->setStyleSheet(
QString("QPushButton { background-color: #%1; }").arg(pColor->m_defaultRgba.rgb(), 6, 16, QChar('0'))
);
if (pColor->m_defaultRgba.isValid()) {
// Set the background color of the button. This can't be overridden in skin stylesheets.
pColorButton->setStyleSheet(
QString("QPushButton { background-color: #%1; }").arg(pColor->m_defaultRgba.rgb(), 6, 16, QChar('0'))
);
} else {
pColorButton->setProperty("noColor", true);
}

pColorButton->setToolTip(pColor->m_sDisplayName);
pColorButton->setCheckable(true);
Expand All @@ -59,9 +64,16 @@ WColorPicker::WColorPicker(QWidget* parent)
row++;
}

connect(pColorButton, &QPushButton::clicked, this, [pColor, this]() {
emit colorPicked(pColor);
});
connect(this,
&WColorPicker::colorPicked,
this,
&WColorPicker::slotColorPicked);
connect(pColorButton,
&QPushButton::clicked,
this,
[pColor, this]() {
emit colorPicked(pColor);
});
}
setLayout(pLayout);
}
Expand Down Expand Up @@ -106,3 +118,8 @@ void WColorPicker::useColorSet(PredefinedColorsRepresentation* pColorRepresentat
pColorButton->setToolTip(pColor->m_sDisplayName);
}
}


void WColorPicker::slotColorPicked(PredefinedColorPointer pColor) {
setSelectedColor(pColor);
}
Loading