From 4385c1cdd3920b15e336ad9f20902e2821567ccd Mon Sep 17 00:00:00 2001 From: huayadong Date: Sat, 7 Dec 2024 07:32:05 +0800 Subject: [PATCH] fix Selection box arrow error --- ....0.0.0-fix-Selection-box-arrow-error.patch | 75 +++++++++++++++++++ time-shutdown.spec | 6 +- 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 time-shutdown-4.0.0.0-fix-Selection-box-arrow-error.patch diff --git a/time-shutdown-4.0.0.0-fix-Selection-box-arrow-error.patch b/time-shutdown-4.0.0.0-fix-Selection-box-arrow-error.patch new file mode 100644 index 0000000..8840cb7 --- /dev/null +++ b/time-shutdown-4.0.0.0-fix-Selection-box-arrow-error.patch @@ -0,0 +1,75 @@ +From 38bc681fe4187f5843498c12b2b93d10273872dc Mon Sep 17 00:00:00 2001 +From: huayadong +Date: Sat, 7 Dec 2024 07:29:19 +0800 +Subject: [PATCH] fix Selection box arrow error + +--- + time-shutdown/comboxwidget.cpp | 2 +- + time-shutdown/widget.cpp | 13 +++++++------ + time-shutdown/widget.h | 1 + + 3 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/time-shutdown/comboxwidget.cpp b/time-shutdown/comboxwidget.cpp +index d40f8a4..df5020a 100644 +--- a/time-shutdown/comboxwidget.cpp ++++ b/time-shutdown/comboxwidget.cpp +@@ -45,7 +45,7 @@ void comBoxWidget::initMemberVariable() + m_pLabel_3 = new QLabel(); + QIcon labelIcon = QIcon::fromTheme("ukui-down.symbolic"); + m_pLabel_3->setPixmap(labelIcon.pixmap(QSize(16, 16))); +- m_pLabel_3->setProperty("useIconHighlightEffect", 0x2); ++ m_pLabel_3->setProperty("useIconHighlightEffect", 0x1); + m_pHcomBoxWidgetLayout = new QHBoxLayout(); + m_pHcomBoxWidgetLayout->setSpacing(0); + m_pHcomBoxWidgetLayout->setContentsMargins(0, 0, 0, 0); +diff --git a/time-shutdown/widget.cpp b/time-shutdown/widget.cpp +index 0aea716..bc1b05f 100644 +--- a/time-shutdown/widget.cpp ++++ b/time-shutdown/widget.cpp +@@ -542,24 +542,25 @@ void Widget::updatedropDownBoxSelectSlots() + void Widget::confirmButtonSlots() + { + if (m_weekSelect[0] == NEVER_SHUTDON) { +- QMessageBox *msg = new QMessageBox(this); +- msg->setIcon(QMessageBox::Warning); ++ KMessageBox *msg = new KMessageBox(this); ++ msg->setIcon(KMessageBox::Warning); + msg->setText(tr("no set shutdown")); + QPushButton *button = new QPushButton(QObject::tr("OK")); + button->setProperty("useButtonPalette", true); +- msg->addButton(button, QMessageBox::RejectRole); ++ msg->addButton(button, KMessageBox::RejectRole); ++ msg->move(this->x() - (msg->width() - this->width()) / 8, this->y() + 60); + msg->show(); + // QMessageBox::warning(NULL, tr("warning"), tr("no set shutdown"), QMessageBox::Ok); + return; + } + + if (determineShutdownTime()) { +- QMessageBox *msg = new QMessageBox(this); +- msg->setIcon(QMessageBox::Warning); ++ KMessageBox *msg = new KMessageBox(this); + msg->setText(tr("The shutdown time is shorter than the current time")); + QPushButton *button = new QPushButton(QObject::tr("OK")); + button->setProperty("useButtonPalette", true); +- msg->addButton(button, QMessageBox::RejectRole); ++ msg->addButton(button, KMessageBox::RejectRole); ++ msg->move(this->x() - (msg->width() - this->width()) / 8, this->y() + 60); + msg->show(); + // QMessageBox::warning(NULL, tr("warning"), \ + // tr("The shutdown time is shorter than the current time"), \ +diff --git a/time-shutdown/widget.h b/time-shutdown/widget.h +index 02e4706..153c70e 100644 +--- a/time-shutdown/widget.h ++++ b/time-shutdown/widget.h +@@ -55,6 +55,7 @@ + #include "comboxwidget.h" + #include "dropdownmenu.h" + #include "kwidget.h" ++#include "kmessagebox.h" + #include "kaboutdialog.h" + #include "usermanual.h" + +-- +2.46.0 + diff --git a/time-shutdown.spec b/time-shutdown.spec index 1afc9fc..6e52732 100644 --- a/time-shutdown.spec +++ b/time-shutdown.spec @@ -1,6 +1,6 @@ Name: time-shutdown Version: 4.0.0.0 -Release: 2 +Release: 3 Summary: The time-shutdown is mainly used in the desktop operating system License: GPL-3+ @@ -8,6 +8,7 @@ URL: https://github.com/ukui/time-shutdown Source0: %{name}-%{version}.tar.gz Patch1: time-shutdown-4.0.0.0-resolve-the-issue-of-reversed-fonts-in-the-Qidian-theme.patch +Patch2: time-shutdown-4.0.0.0-fix-Selection-box-arrow-error.patch BuildRequires: glib2-devel BuildRequires: qt5-qtbase-devel @@ -52,6 +53,9 @@ popd %{_datadir}/ukui-time-shutdown/translations %changelog +* Mon Dec 9 2024 huayadong - 4.0.0.0-3 +- add patch time-shutdown-4.0.0.0-fix-Selection-box-arrow-error.patch + * Thu Nov 21 2024 huayadong - 4.0.0.0-2 - add Patch1:time-shutdown-4.0.0.0-resolve-the-issue-of-reversed-fonts-in-the-Qidian-theme.patch -- Gitee