diff --git a/mainwindow.cpp b/mainwindow.cpp index 7ffac85c..985f2831 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -37,7 +37,6 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->newEventToolButton, SIGNAL(newEventAdded(QString)), this, SLOT(addNewEvent(QString))); new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z), this, SLOT(redo())); - new QShortcut(Qt::Key_M, this, SLOT(toggleEditModeMove())); editor = new Editor(ui); connect(editor, SIGNAL(objectsChanged()), this, SLOT(updateSelectedObjects())); @@ -996,6 +995,12 @@ void MainWindow::on_toolButton_Move_clicked() void MainWindow::on_toolButton_Shift_clicked() { editor->map_edit_mode = "shift"; + editor->cursor = QCursor(QPixmap(":/icons/shift_cursor.ico"), 10, 10); + + ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); + ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + QScroller::ungrabGesture(ui->scrollArea); + checkToolButtons(); } @@ -1008,26 +1013,6 @@ void MainWindow::checkToolButtons() { ui->toolButton_Shift->setChecked(editor->map_edit_mode == "shift"); } -void MainWindow::toggleEditModeMove() { - if (editor->map_edit_mode == "move") { - if (editor->prev_edit_mode == "paint") { - on_toolButton_Paint_clicked(); - } else if (editor->prev_edit_mode == "fill") { - on_toolButton_Fill_clicked(); - } else if (editor->prev_edit_mode == "pick") { - on_toolButton_Dropper_clicked(); - } else if (editor->prev_edit_mode == "select") { - on_toolButton_Select_clicked(); - } else if (editor->prev_edit_mode == "shift") { - on_toolButton_Shift_clicked(); - } - } - else { - editor->prev_edit_mode = editor->map_edit_mode; - on_toolButton_Move_clicked(); - } -} - void MainWindow::onLoadMapRequested(QString mapName, QString fromMapName) { setMap(mapName); editor->setSelectedConnectionFromMap(fromMapName); diff --git a/mainwindow.h b/mainwindow.h index a9f9bf99..58380406 100755 --- a/mainwindow.h +++ b/mainwindow.h @@ -37,7 +37,6 @@ private slots: void undo(); void redo(); - void toggleEditModeMove(); void openInTextEditor(); void onLoadMapRequested(QString, QString); diff --git a/resources/icons/shift_cursor.ico b/resources/icons/shift_cursor.ico new file mode 100644 index 00000000..0c8722c3 Binary files /dev/null and b/resources/icons/shift_cursor.ico differ diff --git a/resources/images.qrc b/resources/images.qrc index 2c0cf39d..2094922f 100755 --- a/resources/images.qrc +++ b/resources/images.qrc @@ -21,5 +21,6 @@ icons/pencil_cursor.ico icons/pipette_cursor.ico icons/shift.ico + icons/shift_cursor.ico