Set focus to map on launch

This commit is contained in:
GriffinR 2024-01-05 14:12:37 -05:00
parent db1aabe3c2
commit 3d3811f3b1

View file

@ -2219,6 +2219,7 @@ void MainWindow::on_toolButton_Paint_clicked()
ui->graphicsView_Map->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
QScroller::ungrabGesture(ui->graphicsView_Map);
ui->graphicsView_Map->setViewportUpdateMode(QGraphicsView::ViewportUpdateMode::MinimalViewportUpdate);
ui->graphicsView_Map->setFocus();
checkToolButtons();
}
@ -2237,6 +2238,7 @@ void MainWindow::on_toolButton_Select_clicked()
ui->graphicsView_Map->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
QScroller::ungrabGesture(ui->graphicsView_Map);
ui->graphicsView_Map->setViewportUpdateMode(QGraphicsView::ViewportUpdateMode::MinimalViewportUpdate);
ui->graphicsView_Map->setFocus();
checkToolButtons();
}
@ -2255,6 +2257,7 @@ void MainWindow::on_toolButton_Fill_clicked()
ui->graphicsView_Map->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
QScroller::ungrabGesture(ui->graphicsView_Map);
ui->graphicsView_Map->setViewportUpdateMode(QGraphicsView::ViewportUpdateMode::MinimalViewportUpdate);
ui->graphicsView_Map->setFocus();
checkToolButtons();
}
@ -2273,6 +2276,7 @@ void MainWindow::on_toolButton_Dropper_clicked()
ui->graphicsView_Map->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
QScroller::ungrabGesture(ui->graphicsView_Map);
ui->graphicsView_Map->setViewportUpdateMode(QGraphicsView::ViewportUpdateMode::MinimalViewportUpdate);
ui->graphicsView_Map->setFocus();
checkToolButtons();
}
@ -2291,6 +2295,7 @@ void MainWindow::on_toolButton_Move_clicked()
ui->graphicsView_Map->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
QScroller::grabGesture(ui->graphicsView_Map, QScroller::LeftMouseButtonGesture);
ui->graphicsView_Map->setViewportUpdateMode(QGraphicsView::ViewportUpdateMode::FullViewportUpdate);
ui->graphicsView_Map->setFocus();
checkToolButtons();
}
@ -2309,6 +2314,7 @@ void MainWindow::on_toolButton_Shift_clicked()
ui->graphicsView_Map->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
QScroller::ungrabGesture(ui->graphicsView_Map);
ui->graphicsView_Map->setViewportUpdateMode(QGraphicsView::ViewportUpdateMode::MinimalViewportUpdate);
ui->graphicsView_Map->setFocus();
checkToolButtons();
}