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,12 +1484,16 @@ void MapPixmapItem::updateCurHoveredTile(QPointF pos) {
|
|||
|
||||
void MapPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) {
|
||||
updateCurHoveredTile(event->pos());
|
||||
if (editor->ui->actionBetter_Cursors->isChecked()){
|
||||
setCursor(editor->cursor);
|
||||
}
|
||||
}
|
||||
void MapPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) {
|
||||
map->clearHoveredTile();
|
||||
if (editor->ui->actionBetter_Cursors->isChecked()){
|
||||
unsetCursor();
|
||||
}
|
||||
}
|
||||
void MapPixmapItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
QPointF pos = event->pos();
|
||||
int x = ((int)pos.x()) / 16;
|
||||
|
|
|
@ -54,6 +54,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
openProject(default_dir);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.contains("cursor_mode") && settings.value("cursor_mode") == "0") {
|
||||
ui->actionBetter_Cursors->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
@ -600,6 +604,11 @@ void MainWindow::on_actionZoom_Out_triggered() {
|
|||
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) {
|
||||
editor->map->scale_exp += s;
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ private slots:
|
|||
|
||||
void on_actionZoom_In_triggered();
|
||||
void on_actionZoom_Out_triggered();
|
||||
void on_actionBetter_Cursors_triggered();
|
||||
|
||||
void on_toolButton_deleteObject_clicked();
|
||||
|
||||
|
|
|
@ -2076,6 +2076,7 @@
|
|||
</property>
|
||||
<addaction name="actionZoom_In"/>
|
||||
<addaction name="actionZoom_Out"/>
|
||||
<addaction name="actionBetter_Cursors"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEdit"/>
|
||||
|
@ -2154,6 +2155,20 @@
|
|||
<string>-</string>
|
||||
</property>
|
||||
</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>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
|
Loading…
Reference in a new issue