Don't undo zoom! (#7943)

Makes it so that editor zoom, automation tension, along with quantization, note length, and all other combo boxes are not added to the undo history.

---------

Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
This commit is contained in:
Alex
2025-06-15 20:41:23 +02:00
committed by GitHub
parent 45ab56dd71
commit 76dddd8c66
4 changed files with 15 additions and 8 deletions

View File

@@ -45,6 +45,7 @@ public:
bool isDefaultConstructed = false ) :
IntModel( 0, 0, 0, parent, displayName, isDefaultConstructed )
{
setJournalling(false);
}
void addItem( QString item, std::unique_ptr<PixmapLoader> loader = nullptr );

View File

@@ -114,10 +114,13 @@ AutomationEditor::AutomationEditor() :
//keeps the direction of the widget, undepended on the locale
setLayoutDirection( Qt::LeftToRight );
// Set up tension model
m_tensionModel = new FloatModel(1.f, 0.f, 1.f, 0.01f);
m_tensionModel->setJournalling(false);
connect( m_tensionModel, SIGNAL(dataChanged()),
this, SLOT(setTension()));
// Set up quantization model
for (auto q : Quantizations) {
m_quantizeModel.addItem(QString("1/%1").arg(q));
}

View File

@@ -94,9 +94,7 @@ SongEditor::SongEditor( Song * song ) :
: DEFAULT_SETTINGS_WIDGET_WIDTH + TRACK_OP_WIDTH),
m_selectRegion(false)
{
m_zoomingModel->setParent(this);
m_snappingModel->setParent(this);
// Set up timeline
m_timeLine = new TimeLineWidget(m_trackHeadWidth, 32, pixelsPerBar(),
m_song->getPlayPos(Song::PlayMode::Song),
m_song->getTimeline(Song::PlayMode::Song),
@@ -244,10 +242,15 @@ SongEditor::SongEditor( Song * song ) :
connect(contentWidget()->verticalScrollBar(), SIGNAL(valueChanged(int)),this, SLOT(updateRubberband()));
connect(m_timeLine, SIGNAL(selectionFinished()), this, SLOT(stopSelectRegion()));
//zoom connects
// Set up zooming model
m_zoomingModel->setParent(this);
m_zoomingModel->setJournalling(false);
connect(m_zoomingModel, SIGNAL(dataChanged()), this, SLOT(zoomingChanged()));
// Set up snapping model
m_snappingModel->setParent(this);
for (float bars : SNAP_SIZES)
{
if (bars > 1.0f)

View File

@@ -69,7 +69,7 @@ ComboBox::ComboBox( QWidget * _parent, const QString & _name ) :
void ComboBox::selectNext()
{
model()->setInitValue( model()->value() + 1 );
model()->setValue(model()->value() + 1);
}
@@ -77,7 +77,7 @@ void ComboBox::selectNext()
void ComboBox::selectPrevious()
{
model()->setInitValue( model()->value() - 1 );
model()->setValue(model()->value() - 1);
}
@@ -221,7 +221,7 @@ void ComboBox::wheelEvent( QWheelEvent* event )
if( model() )
{
const int direction = (event->angleDelta().y() < 0 ? 1 : -1) * (event->inverted() ? -1 : 1);
model()->setInitValue(model()->value() + direction);
model()->setValue(model()->value() + direction);
update();
event->accept();
}
@@ -234,7 +234,7 @@ void ComboBox::setItem( QAction* item )
{
if( model() )
{
model()->setInitValue( item->data().toInt() );
model()->setValue(item->data().toInt());
}
}