diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp index 43d6f918..b7ded727 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp @@ -52,6 +52,7 @@ #include "Qt/keyscan.h" #include "Qt/throttle.h" #include "Qt/fceuWrapper.h" +#include "Qt/ColorMenu.h" #include "Qt/ConsoleWindow.h" #include "Qt/ConsoleUtilities.h" #include "Qt/TasEditor/TasColors.h" @@ -318,6 +319,7 @@ QMenuBar *TasEditorWindow::buildMenuBar(void) *patternMenu; QActionGroup *actGroup; QAction *act; + ColorMenuItem *colorAct; int useNativeMenuBar=0; QMenuBar *menuBar = new QMenuBar(this); @@ -683,6 +685,16 @@ QMenuBar *TasEditorWindow::buildMenuBar(void) viewMenu->addAction(act); + viewMenu->addSeparator(); + + // View -> Piano Roll Grid Color + colorAct = new ColorMenuItem(tr("Piano Roll Grid Color..."), "SDL.TasPianoRollGridColor", this); + colorAct->setStatusTip(tr("Select Piano Roll Grid Color")); + + colorAct->connectColor( &pianoRoll->gridColor ); + + viewMenu->addAction(colorAct); + // Config confMenu = menuBar->addMenu(tr("&Config")); @@ -3804,6 +3816,10 @@ QPianoRoll::QPianoRoll(QWidget *parent) hotChangesColors[14] = QColor( 0xCF, 0x72, 0x00 ); hotChangesColors[15] = QColor( 0xC7, 0x8B, 0x3C ); + gridColor = QColor( 0x00, 0x00, 0x00 ); + + fceuLoadConfigColor("SDL.TasPianoRollGridColor" , &gridColor ); + calcFontData(); } //---------------------------------------------------------------------------- @@ -6292,7 +6308,7 @@ void QPianoRoll::paintEvent(QPaintEvent *event) { painter.setPen( QColor( 128, 128, 128 ) ); painter.drawLine( x, 0, x, viewHeight ); x++; - painter.setPen( QColor( 0, 0, 0 ) ); + painter.setPen( gridColor ); painter.drawLine( x, 0, x, viewHeight ); x--; painter.setPen( headerLightsColors[ headerColors[COLUMN_JOYPAD1_A + (i*8) + j] ] ); @@ -6302,7 +6318,7 @@ void QPianoRoll::paintEvent(QPaintEvent *event) } painter.setPen( QColor( 128, 128, 128 ) ); painter.drawLine( x, 0, x, viewHeight ); x++; - painter.setPen( QColor( 0, 0, 0 ) ); + painter.setPen( gridColor ); painter.drawLine( x, 0, x, viewHeight ); } y = 0; diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.h b/src/drivers/Qt/TasEditor/TasEditorWindow.h index b1e5caba..e1cc0bb9 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.h +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.h @@ -161,6 +161,8 @@ class QPianoRoll : public QWidget void periodicUpdate(void); void setFont( QFont &font ); + + QColor gridColor; protected: void calcFontData(void); void resizeEvent(QResizeEvent *event) override; diff --git a/src/drivers/Qt/config.cpp b/src/drivers/Qt/config.cpp index ce6edc06..cc17a21b 100644 --- a/src/drivers/Qt/config.cpp +++ b/src/drivers/Qt/config.cpp @@ -760,6 +760,7 @@ InitConfig() config->addOption("SDL.TasPianoRollFont", ""); config->addOption("SDL.TasBookmarksFont", ""); config->addOption("SDL.TasBranchesFont" , ""); + config->addOption("SDL.TasPianoRollGridColor", "#000000"); config->addOption("SDL.TasAutoSaveEnabled" , tasCfg.autosaveEnabled ); config->addOption("SDL.TasAutoSavePeriod" , tasCfg.autosavePeriod );