fix fold indicators

portability/macos
zetaPRIME 2019-07-21 04:13:16 -04:00
parent b380959241
commit 914f987487
1 changed files with 4 additions and 3 deletions

View File

@ -114,14 +114,15 @@ void PatternEditorItemDelegate::paint(QPainter *painter, const QStyleOptionViewI
//painter->fillRect(option.rect, Config::colorScheme.patternSelection);
}
if (mdl->folded && p->fold > 1) {
if (row > 0 && mdl->folded && p->fold > 1) {
bool show = false;
int cc = index.column() % PatternEditorModel::colsPerChannel;
int ch = (index.column() - cc) / PatternEditorModel::colsPerChannel;
if (ch < static_cast<int>(p->numChannels())) {
int rowEnd = row + p->fold;
for (int i = row + 1; i < rowEnd; i++) {
int rs = row + 1;
int rowEnd = rs + p->fold;
for (int i = rs + 1; i < rowEnd; i++) {
QString v = index.siblingAtRow(i).data(Qt::DisplayRole).toString();
if (!(v.isEmpty() or v == " - " or v == "- " or v == "» ")) { show = true; break; }
}