From b18b2af45a595dba05b1b98d54ae8dd0848fffff Mon Sep 17 00:00:00 2001 From: Alexandre Quessy Date: Wed, 31 Dec 2014 13:32:30 -0500 Subject: [PATCH] use green as default color + remember last choice --- MainWindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MainWindow.cpp b/MainWindow.cpp index f8355cc..970e3ba 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -458,10 +458,15 @@ void MainWindow::addColor() videoTimer->stop(); // Pop-up color-choosing dialog to choose color paint. - QColor initialColor; - QColor color = QColorDialog::getColor(initialColor, this); + // FIXME: we use a static variable to store the last chosen color + // it should rather be a member of this class, or so. + static QColor color = QColor(0, 255, 0, 255); + color = QColorDialog::getColor(color, this, tr("Select Color"), + QColorDialog::DontUseNativeDialog | QColorDialog::ShowAlphaChannel); if (color.isValid()) + { addColorPaint(color); + } // Restart video playback. XXX Hack videoTimer->start();