From 693d7f4ade53e4eb59b1201b4f73d5874fb0be98 Mon Sep 17 00:00:00 2001 From: peijiankang Date: Wed, 29 Jun 2022 10:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8F=9C=E5=8D=95=E6=8C=89?= =?UTF-8?q?=E9=92=AEhover=E6=A0=B7=E5=BC=8F=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ir-menu-button-hover-style-exception.patch | 81 +++++++++++++++++++ indicator-china-weather.spec | 7 +- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 0007-Repair-menu-button-hover-style-exception.patch diff --git a/0007-Repair-menu-button-hover-style-exception.patch b/0007-Repair-menu-button-hover-style-exception.patch new file mode 100644 index 0000000..2367bba --- /dev/null +++ b/0007-Repair-menu-button-hover-style-exception.patch @@ -0,0 +1,81 @@ +From dc3c07f95c6e8c87f184afb5ac45ec52b38579a8 Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Wed, 29 Jun 2022 10:43:03 +0800 +Subject: [PATCH] Repair menu button hover style exception + +--- + src/leftupsearchbox.cpp | 9 +++------ + src/menumodule.cpp | 10 +++++++++- + src/menumodule.h | 1 + + 3 files changed, 13 insertions(+), 7 deletions(-) + +diff --git a/src/leftupsearchbox.cpp b/src/leftupsearchbox.cpp +index 5412056..6e2a95e 100644 +--- a/src/leftupsearchbox.cpp ++++ b/src/leftupsearchbox.cpp +@@ -87,18 +87,15 @@ bool LeftUpSearchBox::event(QEvent *e){ + switch(k->key()){ + case Qt::Key_Up:{ + emit lineEditKeyEvent("up"); +-// return true; +- break; ++ break; + } + case Qt::Key_Down:{ + emit lineEditKeyEvent("down"); +- // return true; +- break; ++ break; + } + case Qt::Key_Return:{ + emit lineEditKeyEvent("enter"); +- // return true; +- break; ++ break; + } + } + } +diff --git a/src/menumodule.cpp b/src/menumodule.cpp +index 39d8a8d..3e83462 100644 +--- a/src/menumodule.cpp ++++ b/src/menumodule.cpp +@@ -14,7 +14,9 @@ void menuModule::initAction(){ + iconSize = QSize(30,30); + menuButton = new QPushButton; + menuButton->setIcon(QIcon::fromTheme("application-menu")); ++ menuButton->setFlat(true); + menuButton->setFixedSize(iconSize); ++ + m_menu = new QMenu(); + addCityAction = new AddCityAction(m_menu); + QList actions ; +@@ -249,7 +251,13 @@ QVBoxLayout* menuModule::initBody(){ + } + + void menuModule::setStyle(){ +- menuButton->setStyleSheet("QPushButton::menu-indicator{image:None;}"); ++ //menuButton->setStyleSheet("QPushButton{border:0px;border-radius:4px;background:transparent;}" ++ // "QPushButton:Hover{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.1);}" ++ // "QPushButton:Pressed{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.15);}"); ++ menuButton->setStyleSheet("QPushButton{border:0px;border-radius:4px;background:transparent;}" ++ "QPushButton:Hover{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.1);}" ++ "QPushButton:Pressed{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.15);}" ++ "QPushButton::menu-indicator{image:None;}"); + } + + void menuModule::initGsetting(){ +diff --git a/src/menumodule.h b/src/menumodule.h +index 480443b..d3a8717 100644 +--- a/src/menumodule.h ++++ b/src/menumodule.h +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + #include + #include +-- +2.33.0 + diff --git a/indicator-china-weather.spec b/indicator-china-weather.spec index 908f4eb..51507e1 100644 --- a/indicator-china-weather.spec +++ b/indicator-china-weather.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: indicator-china-weather Version: 3.1.0 -Release: 13 +Release: 14 Summary: The weather data are from the heweather API s6 version. License: GPL-3.0+ URL: https://github.com/UbuntuKylin/indicator-china-weather @@ -28,6 +28,7 @@ patch3: 0003-add-X-UKUI-AutoRestart-filed-in-desktop.patch patch4: 0004-update-translation-file.patch patch5: 0005-Increase-the-drag-bar-of-forecast-part.patch patch6: 0006-Hide-tray-icon-in-case-of-network-exception.patch +patch7: 0007-Repair-menu-button-hover-style-exception.patch %description Indicator that displays China weather information @@ -44,6 +45,7 @@ patch6: 0006-Hide-tray-icon-in-case-of-network-exception.patch %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 %build %{qmake_qt5} %{_qt5_qmake_flags} CONFIG+=enable-by-default indicator-china-weather.pro @@ -75,6 +77,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/man/man1/indicator-china-weather.1.gz %changelog +* Wed Jun 29 2022 peijiankang - 3.1.0-14 +- 修复菜单按钮hover样式异常 + * Wed Jun 29 2022 peijiankang - 3.1.0-13 - 网络异常情况下隐藏托盘icon