diff options
Diffstat (limited to 'src/qml/qmlconfigproxy.cpp')
-rw-r--r-- | src/qml/qmlconfigproxy.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/qml/qmlconfigproxy.cpp b/src/qml/qmlconfigproxy.cpp new file mode 100644 index 0000000000..9e0bec8224 --- /dev/null +++ b/src/qml/qmlconfigproxy.cpp @@ -0,0 +1,36 @@ +#include "qml/qmlconfigproxy.h" + +#include "preferences/colorpalettesettings.h" + +namespace { +QVariantList paletteToQColorList(const ColorPalette& palette) { + QVariantList colors; + for (mixxx::RgbColor rgbColor : palette) { + colors.append(mixxx::RgbColor::toQVariantColor(rgbColor)); + } + return colors; +} +} // namespace + +namespace mixxx { +namespace skin { +namespace qml { + +QmlConfigProxy::QmlConfigProxy( + UserSettingsPointer pConfig, QObject* parent) + : QObject(parent), m_pConfig(pConfig) { +} + +QVariantList QmlConfigProxy::getHotcueColorPalette() { + ColorPaletteSettings colorPaletteSettings(m_pConfig); + return paletteToQColorList(colorPaletteSettings.getHotcueColorPalette()); +} + +QVariantList QmlConfigProxy::getTrackColorPalette() { + ColorPaletteSettings colorPaletteSettings(m_pConfig); + return paletteToQColorList(colorPaletteSettings.getTrackColorPalette()); +} + +} // namespace qml +} // namespace skin +} // namespace mixxx |