From bf585496668a5e76f2ccc49b47808bd38fc79b21 Mon Sep 17 00:00:00 2001 From: garak Date: Fri, 1 Nov 2019 23:08:45 -0400 Subject: [PATCH] update midnight theme disabled widgets, disable some ui in event tab --- include/editor.h | 1 + resources/icons/cursor.ico | Bin 1150 -> 1150 bytes resources/themes/midnight.qss | 2 +- src/editor.cpp | 21 +++++++++++++++++++++ src/mainwindow.cpp | 2 +- src/ui/mappixmapitem.cpp | 4 ++-- 6 files changed, 26 insertions(+), 4 deletions(-) diff --git a/include/editor.h b/include/editor.h index 31279095..c63217ea 100644 --- a/include/editor.h +++ b/include/editor.h @@ -70,6 +70,7 @@ public: void setEditingCollision(); void setEditingObjects(); void setEditingConnections(); + void setMapEditingButtonsVisibile(bool visible); void clearWildMonTabWidgets(); void setCurrentConnectionDirection(QString curDirection); void updateCurrentConnectionDirection(QString curDirection); diff --git a/resources/icons/cursor.ico b/resources/icons/cursor.ico index b502cb0444e6d7fb91794333dce0cb03b37221e7..7cab36073d87974a37776e4d042c7ed4e128e296 100644 GIT binary patch delta 14 Vcmeyz@sDGI_GEDu;f;0cursorMapTileRect->stopSingleTileMode(); this->cursorMapTileRect->setVisibility(true); + + setMapEditingButtonsVisibile(true); } void Editor::setEditingCollision() { @@ -120,6 +122,8 @@ void Editor::setEditingCollision() { setConnectionItemsVisible(false); this->cursorMapTileRect->setSingleTileMode(); this->cursorMapTileRect->setVisibility(true); + + setMapEditingButtonsVisibile(true); } void Editor::setEditingObjects() { @@ -139,6 +143,22 @@ void Editor::setEditingObjects() { setConnectionItemsVisible(false); this->cursorMapTileRect->setSingleTileMode(); this->cursorMapTileRect->setVisibility(false); + + setMapEditingButtonsVisibile(false); +} + +void Editor::setMapEditingButtonsVisibile(bool visible) { + this->ui->toolButton_Fill->setEnabled(visible); + // If the fill button is pressed, unpress it and select the pointer. + if (!visible && this->ui->toolButton_Fill->isChecked()) { + qDebug() << "deselect flood fill button"; + this->map_edit_mode = "select"; + this->settings->mapCursor = QCursor(); + this->cursorMapTileRect->setSingleTileMode(); + this->ui->toolButton_Fill->setChecked(false); + this->ui->toolButton_Select->setChecked(true); + } + this->ui->checkBox_smartPaths->setEnabled(visible); } void Editor::setEditingConnections() { @@ -987,6 +1007,7 @@ void Editor::setSmartPathCursorMode(QGraphicsSceneMouseEvent *event) } void Editor::mouseEvent_map(QGraphicsSceneMouseEvent *event, MapPixmapItem *item) { + // TODO: add event tab object painting tool buttons stuff here if (!item->paintingEnabled) { return; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 18afecc3..1cdc8df0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2054,7 +2054,7 @@ void MainWindow::on_toolButton_Paint_clicked() void MainWindow::on_toolButton_Select_clicked() { editor->map_edit_mode = "select"; - editor->settings->mapCursor = QCursor(QPixmap(":/icons/cursor.ico"), 0, 0); + editor->settings->mapCursor = QCursor();//QPixmap(":/icons/cursor.ico"), 0, 0); editor->cursorMapTileRect->setSingleTileMode(); ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); diff --git a/src/ui/mappixmapitem.cpp b/src/ui/mappixmapitem.cpp index 103a15c5..8bcfef7a 100644 --- a/src/ui/mappixmapitem.cpp +++ b/src/ui/mappixmapitem.cpp @@ -558,13 +558,13 @@ void MapPixmapItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { int x = static_cast(event->pos().x()) / 16; int y = static_cast(event->pos().y()) / 16; emit this->hoveredMapMetatileChanged(x, y); - if (this->settings->betterCursors && this->paintingEnabled) { + if (this->settings->betterCursors/* && this->paintingEnabled*/) { setCursor(this->settings->mapCursor); } } void MapPixmapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *) { emit this->hoveredMapMetatileCleared(); - if (this->settings->betterCursors && this->paintingEnabled) { + if (this->settings->betterCursors/* && this->paintingEnabled*/) { unsetCursor(); } }