@@ -40,6 +40,7 @@ DavisGUI::DavisGUI(QWidget* parent)
4040 ui->setupUi (this );
4141 isAboutWindowShowed = false ;
4242 m_isMinStyleWindow = false ;
43+ m_isUseCustomSkins = false ;
4344 m_skin = checkSkin ();
4445 this ->setAcceptDrops (true );
4546 QHBoxLayout* hbl = ui->horizontalLayout_menu ;
@@ -81,10 +82,27 @@ DavisGUI::DavisGUI(QWidget* parent)
8182 menu_matrix_view->addAction (action_surface);
8283 menu_matrix_view->addAction (action_heatmap);
8384
84- action_fitPlotToAllWindow = new QAction (" Graph fit to window" );
85+ action_fitPlotToAllWindow = new QAction (" Fit graph to window" );
8586 action_fitPlotToAllWindow->setCheckable (true );
8687 menu_root->addAction (action_fitPlotToAllWindow);
8788
89+ action_holidaysSkins = new QAction (" Holidays custom skins" );
90+ action_holidaysSkins->setCheckable (true );
91+ menu_root->addAction (action_holidaysSkins);
92+ connect (action_holidaysSkins, &QAction::triggered, [this ]() {
93+ m_isUseCustomSkins = action_holidaysSkins->isChecked ();
94+ Skins skin = m_skin;
95+ m_skin = checkSkin ();
96+ if (m_skin == skin) {
97+ return ;
98+ }
99+ if (m_isMinStyleWindow) {
100+ setMinStyleWindow (0 );
101+ } else {
102+ setMaxStyleWindow (0 );
103+ }
104+ });
105+
88106 mb->addMenu (menu_root);
89107 hbl->addWidget (mb);
90108 hbl->addItem (new QSpacerItem (2 , 25 , QSizePolicy::Expanding, QSizePolicy::Expanding));
@@ -162,20 +180,14 @@ DavisGUI::DavisGUI(QWidget* parent)
162180 connect (this , &DavisGUI::hideProgressBar, barCool, &coolProgressBar::stopAnimation);
163181
164182 qpbOpen = new AnimatedButton (" Open" , QColor (120 , 120 , 120 ), QColor (42 , 130 , 218 ), this );
165- // qpbOpen->setGeometry(65, 180, 90, 30);
166-
167183 qpbBuffer = new AnimatedButton (" Past from clipboard (Ctrl+V)" ,
168184 QColor (120 , 120 , 120 ),
169185 QColor (42 , 130 , 218 ),
170186 this );
171- // qpbBuffer->setGeometry(165, 180, 170, 30);
172187
173188 connect (qpbOpen, &QPushButton::released, this , &DavisGUI::selectAndShowFiles);
174189 connect (qpbBuffer, &QPushButton::released, this , &DavisGUI::pasteFromClipboard);
175190
176-
177-
178-
179191 // New Year
180192 QString fileGifPath = " :/res/newYear.gif" ;
181193 QMovie* movie = new QMovie (fileGifPath);
@@ -369,6 +381,9 @@ bool DavisGUI::mayBeShowMatrixToMatrix(QJsonArray& stamps,
369381}
370382
371383Skins DavisGUI::checkSkin () {
384+ if (!m_isUseCustomSkins) {
385+ return Skins::DEFAULT;
386+ }
372387 Skins skin;
373388 QDate currentDate = QDate::currentDate ();
374389 if ((currentDate.month () == 12 && currentDate.day () >= 15 )
@@ -1031,17 +1046,6 @@ void DavisGUI::mouseMoveEvent(QMouseEvent* event) {
10311046void DavisGUI::keyPressEvent (QKeyEvent* event) {
10321047 if (event->modifiers () == Qt::ControlModifier && event->key () == Qt::Key_V) {
10331048 pasteFromClipboard ();
1034- } else if (event->modifiers () == Qt::ControlModifier && event->key () == Qt::Key_1) {
1035- if (m_skin == Skins::DEFAULT) {
1036- m_skin = Skins::NEWYEAR;
1037- } else {
1038- m_skin = Skins::DEFAULT;
1039- }
1040- if (m_isMinStyleWindow) {
1041- setMinStyleWindow (0 );
1042- } else {
1043- setMaxStyleWindow (0 );
1044- }
10451049 } else {
10461050 QMainWindow::keyPressEvent (event);
10471051 }
0 commit comments