allow strutting into new columns if not multiselecting

master
Zithia Satazaki 2022-03-29 14:34:31 -04:00
parent 9bed15f564
commit 00cfb9df3a
2 changed files with 6 additions and 3 deletions

4
notes
View File

@ -42,7 +42,9 @@ TODO {
- fix space on note or port column (previewing) generating an undo action
- make space preview on port column
fix strut not working except to overwrite another param
- fix strut not working except to overwrite another param
add negate function to param columns
revert-to-saved menu action

View File

@ -170,7 +170,7 @@ bool PatternEditorItemDelegate::eventFilter(QObject *obj, QEvent *event) {
bool PatternEditorItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option [[maybe_unused]], const QModelIndex &index) {
if (index.data().isNull()) return false; // no channels?
auto type = event->type();
if (type == QEvent::KeyRelease) qDebug() << "key release";
//if (type == QEvent::KeyRelease) qDebug() << "key release";
if (type == QEvent::KeyPress) {
if (static_cast<QKeyEvent*>(event)->isAutoRepeat()) return false; // reject autorepeat
@ -194,7 +194,7 @@ bool PatternEditorItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *m
} else {
if (k == Qt::Key_Space) { // TODO make this not "modify" if nothing was affected
if (mod & Qt::Modifier::SHIFT) return dc->cancel(); // TODO: once playback is a thing, shift+space to preview row?
if (mod & Qt::Modifier::SHIFT) return dc->cancel(); // nothing on shift yet
dc->cancel();
SelectionBounds s(sel);
@ -207,6 +207,7 @@ bool PatternEditorItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *m
auto mp = s.maxParamSelected(c);
if (mp < 0) continue;
auto mps = std::min(mpc, static_cast<size_t>(mp));
if (!multi) mps++; // allow strutting into new columns if not multiselecting
for (int r = s.y1; r <= s.y2; r++) {
if (multi && mps <= p->rowAt(c, r).numParams()) continue;
auto* dc = new PatternDeltaCommand(p, c, r-1);