Skip to content

Commit

Permalink
fix default Color column width
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Feb 20, 2024
1 parent 0d4fb5f commit d71ebd8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/library/basetracktablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,16 @@ QVariant BaseTrackTableModel::data(
return QBrush(bgColor);
}

// Return the preferred (default) width of the Color column.
// This works around inconsistencies when the width is determined by
// color values. See https://github.com/mixxxdj/mixxx/issues/12850
if (role == Qt::SizeHintRole) {
const auto field = mapColumn(index.column());
if (field == ColumnCache::COLUMN_LIBRARYTABLE_COLOR) {
return QSize(defaultColumnWidth() / 2, 0);
}
}

// Only retrieve a value for supported roles
if (role != Qt::DisplayRole &&
role != Qt::EditRole &&
Expand Down

0 comments on commit d71ebd8

Please sign in to comment.