refactor: centralize hardcoded color values into Colors namespace
Add src/util/colors.hpp with named constants for all QColor values (brand accents, badge colors, text shades, surface backgrounds) and replace scattered QColor constructor calls across 7 source files. Stylesheet string colors are intentionally left inline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "tracklistmodel.hpp"
|
||||
#include "../util/colors.hpp"
|
||||
|
||||
#include <QJsonValue>
|
||||
#include <QColor>
|
||||
@@ -255,7 +256,7 @@ QVariant TrackListModel::data(const QModelIndex &index, int role) const
|
||||
QFont f; f.setBold(true); return f;
|
||||
}
|
||||
if (role == Qt::ForegroundRole)
|
||||
return QColor(0xFF, 0xB2, 0x32);
|
||||
return Colors::QobuzOrange;
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -278,8 +279,8 @@ QVariant TrackListModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
|
||||
if (role == Qt::ForegroundRole) {
|
||||
if (!t.streamable) return QColor(0x55, 0x55, 0x55);
|
||||
if (isPlaying) return QColor(0xFF, 0xB2, 0x32); // Qobuz orange
|
||||
if (!t.streamable) return Colors::DisabledText;
|
||||
if (isPlaying) return Colors::QobuzOrange;
|
||||
}
|
||||
|
||||
if (role == Qt::DecorationRole && index.column() == ColNumber && isPlaying) {
|
||||
|
||||
Reference in New Issue
Block a user