From 36f8d3649bc63d6326ccf6c5568c52fcf6540646 Mon Sep 17 00:00:00 2001
From: huayadong <huayadong@kylinos.cn>
Date: Thu, 9 Dec 2021 20:10:11 +0800
Subject: [PATCH] Repair clock stopwatch when not started / reset button can be
 pressed

---
 src/plugins/ukui-clock/clock.cpp                | 7 ++++++-
 src/plugins/ukui-clock/noticeAlarm.cpp          | 1 +
 src/plugins/ukui-clock/setAlarmRepeatDialog.cpp | 1 +
 src/plugins/ukui-clock/setupPage.cpp            | 1 +
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/plugins/ukui-clock/clock.cpp b/src/plugins/ukui-clock/clock.cpp
index 250bf5b..6ff0aa6 100755
--- a/src/plugins/ukui-clock/clock.cpp
+++ b/src/plugins/ukui-clock/clock.cpp
@@ -361,7 +361,8 @@ void Clock::stopwatch_init()
     ui->pushButton_Start->raise();
     ui->pushButton_ring->raise();
     ui->pushButton_timeselect->raise();
-    ui->pushButton_timeselect->hide();
+    ui->pushButton_timeselect->setEnabled(false);
+    ui->pushButton_ring->setEnabled(false);
 }
 //闹钟页初始化
 // Alarm page initialization
@@ -540,6 +541,8 @@ void Clock::Count_down()
 void Clock::on_pushButton_Start_clicked()
 {
     if (!isStarted) {
+        ui->pushButton_timeselect->setEnabled(true);
+        ui->pushButton_ring->setEnabled(true);
         ui->pushButton_timeselect->hide();
         ui->pushButton_Start->setText(tr("suspend"));
 
@@ -665,6 +668,8 @@ void Clock::on_pushButton_timeselect_clicked()
     if (nullptr != timer) {
         if (isStarted)
             return;
+        ui->pushButton_timeselect->setEnabled(false);
+        ui->pushButton_ring->setEnabled(false);
         timer->stop();
         timer_2->stop();
         ui->label_4->setText("00:00.00");
diff --git a/src/plugins/ukui-clock/noticeAlarm.cpp b/src/plugins/ukui-clock/noticeAlarm.cpp
index 72275d5..00cadf1 100755
--- a/src/plugins/ukui-clock/noticeAlarm.cpp
+++ b/src/plugins/ukui-clock/noticeAlarm.cpp
@@ -22,6 +22,7 @@
 #include <QMediaPlayer>
 #include <QMediaPlaylist>
 #include <QDebug>
+#include <QPainterPath>
 
 extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);
 
diff --git a/src/plugins/ukui-clock/setAlarmRepeatDialog.cpp b/src/plugins/ukui-clock/setAlarmRepeatDialog.cpp
index cf7be2c..0f3b7de 100755
--- a/src/plugins/ukui-clock/setAlarmRepeatDialog.cpp
+++ b/src/plugins/ukui-clock/setAlarmRepeatDialog.cpp
@@ -23,6 +23,7 @@
 #include <QPainter>
 #include <QDebug>
 #include <QScroller>
+#include <QPainterPath>
 
 extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);
 
diff --git a/src/plugins/ukui-clock/setupPage.cpp b/src/plugins/ukui-clock/setupPage.cpp
index ff8cca3..a6e1091 100755
--- a/src/plugins/ukui-clock/setupPage.cpp
+++ b/src/plugins/ukui-clock/setupPage.cpp
@@ -22,6 +22,7 @@
 #include "setAlarmRepeatDialog.h"
 #include <QDebug>
 #include <QBitmap>
+#include <QPainterPath>
 #include "customStyle.h"
 
 extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);
-- 
2.30.0

