using different cursors is checkable and added to settings
This commit is contained in:
parent
5b96af47db
commit
ece612a865
4 changed files with 31 additions and 2 deletions
|
@ -1484,11 +1484,15 @@ void MapPixmapItem::updateCurHoveredTile(QPointF pos) {
|
||||||
|
|
||||||
void MapPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
|
void MapPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
|
||||||
updateCurHoveredTile(event->pos());
|
updateCurHoveredTile(event->pos());
|
||||||
setCursor(editor->cursor);
|
if (editor->ui->actionBetter_Cursors->isChecked()){
|
||||||
|
setCursor(editor->cursor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void MapPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
|
void MapPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
|
||||||
map->clearHoveredTile();
|
map->clearHoveredTile();
|
||||||
unsetCursor();
|
if (editor->ui->actionBetter_Cursors->isChecked()){
|
||||||
|
unsetCursor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void MapPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
void MapPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||||
QPointF pos = event->pos();
|
QPointF pos = event->pos();
|
||||||
|
|
|
@ -54,6 +54,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
openProject(default_dir);
|
openProject(default_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings.contains("cursor_mode") && settings.value("cursor_mode") == "0") {
|
||||||
|
ui->actionBetter_Cursors->setChecked(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
|
@ -600,6 +604,11 @@ void MainWindow::on_actionZoom_Out_triggered() {
|
||||||
scaleMapView(-1);
|
scaleMapView(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionBetter_Cursors_triggered() {
|
||||||
|
QSettings settings;
|
||||||
|
settings.setValue("cursor_mode", QString::number(ui->actionBetter_Cursors->isChecked()));
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::scaleMapView(int s) {
|
void MainWindow::scaleMapView(int s) {
|
||||||
editor->map->scale_exp += s;
|
editor->map->scale_exp += s;
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ private slots:
|
||||||
|
|
||||||
void on_actionZoom_In_triggered();
|
void on_actionZoom_In_triggered();
|
||||||
void on_actionZoom_Out_triggered();
|
void on_actionZoom_Out_triggered();
|
||||||
|
void on_actionBetter_Cursors_triggered();
|
||||||
|
|
||||||
void on_toolButton_deleteObject_clicked();
|
void on_toolButton_deleteObject_clicked();
|
||||||
|
|
||||||
|
|
|
@ -2076,6 +2076,7 @@
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionZoom_In"/>
|
<addaction name="actionZoom_In"/>
|
||||||
<addaction name="actionZoom_Out"/>
|
<addaction name="actionZoom_Out"/>
|
||||||
|
<addaction name="actionBetter_Cursors"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuFile"/>
|
<addaction name="menuFile"/>
|
||||||
<addaction name="menuEdit"/>
|
<addaction name="menuEdit"/>
|
||||||
|
@ -2154,6 +2155,20 @@
|
||||||
<string>-</string>
|
<string>-</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionBetter_Cursors">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Better Cursors</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Use reticule-styled cursors with icon showing currently selected tool.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
|
Loading…
Reference in a new issue