Skip to content

Commit

Permalink
Holding control whilst scrolling now updates selection in slice selec…
Browse files Browse the repository at this point in the history
…tor toolbox
  • Loading branch information
RussellGarwood committed Apr 26, 2020
1 parent 6f44d75 commit 91a410e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion SPIERSedit/src/mainwindowimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,16 @@ void MainWindowImpl::left_pressed()

void MainWindowImpl:: MouseZoom(int delta)
{
ZoomSlider->setValue(ZoomSlider->value() + delta / 5);
if ( QGuiApplication::keyboardModifiers() == Qt::CTRL)
{
QList<QListWidgetItem *> selected = SliceSelectorList->selectedItems();
int selectedRow = SliceSelectorList->row(selected[0]);
int newRow = selectedRow - (delta / 10);
if (newRow < 0) newRow = 0;
if (newRow > SliceSelectorList->count() - 1) newRow = SliceSelectorList->count() - 1;
SliceSelectorList->setCurrentRow(newRow, QItemSelectionModel::ClearAndSelect);
}
else ZoomSlider->setValue(ZoomSlider->value() + delta / 5);
}

void MainWindowImpl::SetMasksFlag()
Expand Down
1 change: 1 addition & 0 deletions SPIERSedit/src/mainwindowimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <QAction>
#include <QEvent>
#include <QTime>
#include <QList>
#include <QTreeWidgetItem>
#include <QSpinBox>
#include <QGraphicsView>
Expand Down

0 comments on commit 91a410e

Please sign in to comment.