keep selected tool when switching tabs
This commit is contained in:
parent
f57ef7a819
commit
333fe69dd8
3 changed files with 5 additions and 4 deletions
|
@ -128,7 +128,6 @@ public:
|
||||||
QList<DraggablePixmapItem*> *selected_events = nullptr;
|
QList<DraggablePixmapItem*> *selected_events = nullptr;
|
||||||
|
|
||||||
QString map_edit_mode;
|
QString map_edit_mode;
|
||||||
QString prev_edit_mode;
|
|
||||||
|
|
||||||
int scale_exp = 0;
|
int scale_exp = 0;
|
||||||
double scale_base = sqrt(2); // adjust scale factor with this
|
double scale_base = sqrt(2); // adjust scale factor with this
|
||||||
|
|
|
@ -133,6 +133,8 @@ void Editor::setEditingObjects() {
|
||||||
}
|
}
|
||||||
if (map_item) {
|
if (map_item) {
|
||||||
map_item->paintingMode = MapPixmapItem::PaintMode::EventObjects;
|
map_item->paintingMode = MapPixmapItem::PaintMode::EventObjects;
|
||||||
|
displayMapConnections();
|
||||||
|
map_item->draw();
|
||||||
map_item->setVisible(true);
|
map_item->setVisible(true);
|
||||||
setConnectionsVisibility(ui->checkBox_ToggleBorder->isChecked());
|
setConnectionsVisibility(ui->checkBox_ToggleBorder->isChecked());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1216,12 +1216,12 @@ void MainWindow::on_mainTabBar_tabBarClicked(int index)
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
ui->stackedWidget_MapEvents->setCurrentIndex(0);
|
ui->stackedWidget_MapEvents->setCurrentIndex(0);
|
||||||
on_tabWidget_2_currentChanged(ui->tabWidget_2->currentIndex());
|
on_tabWidget_2_currentChanged(ui->tabWidget_2->currentIndex());
|
||||||
clickToolButtonFromEditMode(editor->prev_edit_mode);
|
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
ui->stackedWidget_MapEvents->setCurrentIndex(1);
|
ui->stackedWidget_MapEvents->setCurrentIndex(1);
|
||||||
editor->prev_edit_mode = editor->map_edit_mode;
|
|
||||||
editor->setEditingObjects();
|
editor->setEditingObjects();
|
||||||
clickToolButtonFromEditMode("select");
|
QStringList validOptions = {"select", "move", "paint", "shift"};
|
||||||
|
QString newEditMode = validOptions.contains(editor->map_edit_mode) ? editor->map_edit_mode : "select";
|
||||||
|
clickToolButtonFromEditMode(newEditMode);
|
||||||
} else if (index == 3) {
|
} else if (index == 3) {
|
||||||
editor->setEditingConnections();
|
editor->setEditingConnections();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue