diff --git a/YUViewLib/src/ui/views/SplitViewWidget.cpp b/YUViewLib/src/ui/views/SplitViewWidget.cpp index 32c053689..0a9e027ad 100644 --- a/YUViewLib/src/ui/views/SplitViewWidget.cpp +++ b/YUViewLib/src/ui/views/SplitViewWidget.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -1387,6 +1388,16 @@ void splitViewWidget::setRegularGridSize(unsigned int size, update(); } +void splitViewWidget::selectRegularGridColor() +{ + QColor newColor = QColorDialog::getColor(regularGridColor); + if (newColor.isValid() && regularGridColor != newColor) + { + regularGridColor = newColor; + update(); + } +} + void splitViewWidget::currentSelectedItemsChanged(playlistItem *item1, playlistItem *item2) { Q_ASSERT_X(this->isMasterView, Q_FUNC_INFO, "Call this function only on the primary widget."); @@ -1946,9 +1957,12 @@ void splitViewWidget::addMenuActions(QMenu *menu) splitViewMenu->addAction(&actionSplitView[i]); splitViewMenu->setToolTipsVisible(true); - QMenu *drawGridMenu = menu->addMenu("Draw Grid"); + QMenu *gridSettingsMenu = menu->addMenu("Grid Settings"); + QMenu *gridSizeMenu = gridSettingsMenu->addMenu("Size"); for (size_t i = 0; i < 6; i++) - drawGridMenu->addAction(&actionGrid[i]); + gridSizeMenu->addAction(&actionGrid[i]); + + gridSettingsMenu->addAction("Select Color", this, &splitViewWidget::selectRegularGridColor); menu->addAction(&actionZoomBox); diff --git a/YUViewLib/src/ui/views/SplitViewWidget.h b/YUViewLib/src/ui/views/SplitViewWidget.h index ebe9a3782..90c2cd0b8 100644 --- a/YUViewLib/src/ui/views/SplitViewWidget.h +++ b/YUViewLib/src/ui/views/SplitViewWidget.h @@ -263,6 +263,7 @@ private slots: unsigned int regularGridSize{0}; //!< The size of each block in the regular grid in pixels void setRegularGridSize(unsigned int size, bool setOtherViewIfLinked = true, bool callUpdate = false); + void selectRegularGridColor(); QColor regularGridColor; void paintRegularGrid(QPainter *painter, playlistItem *item); //!< paint the grid