Skip to content

Commit

Permalink
library/basesqltablemodel: Use constant for track color row opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Mar 9, 2020
1 parent a873f7f commit 3e9678f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/library/basesqltablemodel.cpp
Expand Up @@ -40,6 +40,9 @@ const int kMaxSortColumns = 3;
// Constant for getModelSetting(name)
const QString COLUMNS_SORTING = QStringLiteral("ColumnsSorting");

// Alpha value for row color background (range 0 - 255)
constexpr int kTrackColorRowBackgroundOpacity = 0x20; // 12.5% opacity

} // anonymous namespace

BaseSqlTableModel::BaseSqlTableModel(QObject* pParent,
Expand Down Expand Up @@ -732,7 +735,7 @@ QVariant BaseSqlTableModel::data(const QModelIndex& index, int role) const {
QColor color = mixxx::RgbColor::toQColor(
mixxx::RgbColor::fromQVariant(getBaseValue(colorIndex, role)));
if (color.isValid()) {
color.setAlpha(32); // Make this 12.5% opaque
color.setAlpha(kTrackColorRowBackgroundOpacity);
value = QBrush(color);
}
break;
Expand Down

0 comments on commit 3e9678f

Please sign in to comment.