From 548b72d0c1ab5c5e07904a2baa37792be8640e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=95=8F?= Date: Thu, 15 Aug 2024 05:43:46 +0000 Subject: [PATCH] =?UTF-8?q?!99=20fixbug=20Merge=20pull=20request=20!99=20f?= =?UTF-8?q?rom=20=E6=9D=A8=E6=95=8F/openkylin/nile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 11 +++ debian/patches/0055-99-fixbug.patch | 103 ++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 115 insertions(+) create mode 100644 debian/patches/0055-99-fixbug.patch diff --git a/debian/changelog b/debian/changelog index d12b95d..5091300 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +ukui-screensaver (4.10.0.0-ok30~0815) nile; urgency=medium + + * BUG号:#IAHFEB 锁屏登录界面网络连接按钮悬浮色与其他按钮不一致 + #IA5AIS【次要】【屏保】mp4动态屏保的预览界面、屏保界面不会循环播放 + #IABL4C【次要】【gg-维哈柯】【屏保】哈柯文,屏保界面休息时间,时分秒显示顺序错误 + * 需求号:无 + * 其他改动说明:无 + * 其他改动影响域:无 + + -- Yang Min Thu, 15 Aug 2024 13:39:12 +0800 + ukui-screensaver (4.10.0.0-ok29~0802) nile; urgency=medium * BUG号:#IAF8BR 显示器息屏后,自动断开重连会导致电脑自动解锁登录 diff --git a/debian/patches/0055-99-fixbug.patch b/debian/patches/0055-99-fixbug.patch new file mode 100644 index 0000000..dd24c7f --- /dev/null +++ b/debian/patches/0055-99-fixbug.patch @@ -0,0 +1,103 @@ +From: =?utf-8?b?5p2o5pWP?= +Date: Thu, 15 Aug 2024 05:43:46 +0000 +Subject: =?utf-8?q?!99_fixbug_Merge_pull_request_!99_from_=E6=9D=A8?= + =?utf-8?q?=E6=95=8F/openkylin/nile?= + +--- + src/CMakeLists.txt | 2 +- + src/widgets/networkbutton.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 54 insertions(+), 2 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 7094827..f76501d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -118,7 +118,7 @@ add_executable(ukui-screensaver-dialog ${dialog_SRC}) + add_definitions(-DAPP_API_MAJOR=0 + -DAPP_API_MINOR=11 + -DAPP_API_FUNC=0 +-# -DSUPPORT_MEDIA_CONTROL ++ -DSUPPORT_MEDIA_CONTROL + ) + target_include_directories(ukui-screensaver-dialog PRIVATE ${KYSDKSYSTIME_INCLUDE_DIRS} ${KYSDKWAYLANDHELPER_INCLUDE_DIRS}) + target_link_directories(ukui-screensaver-dialog PRIVATE ${KYSDKSYSTIME_LIBRARY_DIRS} ${KYSDKWAYLANDHELPER_LIBRARY_DIRS}) +diff --git a/src/widgets/networkbutton.cpp b/src/widgets/networkbutton.cpp +index b64b2ec..9d5972b 100644 +--- a/src/widgets/networkbutton.cpp ++++ b/src/widgets/networkbutton.cpp +@@ -18,7 +18,9 @@ + #include "networkbutton.h" + #include + #include ++#include + #include ++#include "commonfunc.h" + + NetWorkButton::NetWorkButton(QWidget *parent) : KyNetworkIcon(parent) + { +@@ -58,6 +60,14 @@ void NetWorkButton::paintEvent(QPaintEvent *e) + // painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6); + // painter.restore(); + // } ++ if (option.state & QStyle::State_MouseOver) { ++ painter.save(); ++ painter.setPen(Qt::NoPen); ++ painter.setBrush(Qt::white); ++ painter.setOpacity(0.15); ++ painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6); ++ painter.restore(); ++ } + + if (curStatus == CLICKED) { + painter.save(); +@@ -84,7 +94,49 @@ void NetWorkButton::paintEvent(QPaintEvent *e) + painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6); + painter.restore(); + } +- QPushButton::paintEvent(e); ++ ++ if (option.state & QStyle::State_HasFocus) { ++ painter.save(); ++ painter.setPen(Qt::NoPen); ++ painter.setBrush(Qt::white); ++ painter.setOpacity(0.25); ++ painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6); ++ painter.restore(); ++ painter.save(); ++ QStyleOption opt; ++ QColor color = opt.palette.color(QPalette::Highlight); ++ painter.setPen(QPen(color, 2)); ++ painter.setBrush(Qt::NoBrush); ++ painter.drawRoundedRect(option.rect.adjusted(1, 1, -1, -1), 6, 6); ++ painter.restore(); ++ } ++ // 绘制图片 ++ int buttonWidget = this->width(); ++ int buttonHeight = this->height(); ++ QRect buttonRect(0, 0, buttonWidget, buttonHeight); ++ ++ QPixmap pixmap = option.icon.pixmap(option.iconSize, QIcon::Active); ++ pixmap = drawSymbolicColoredPixmap(pixmap, "white"); ++ int pixmapWidth = static_cast(pixmap.width() / qApp->devicePixelRatio()); ++ int pixmapHeight = static_cast(pixmap.height() / qApp->devicePixelRatio()); ++ QRect pixmapRect(0, 0, pixmapWidth, pixmapHeight); ++ ++ int deltaX = 0; ++ int deltaY = 0; ++ if (pixmapRect.width() < buttonRect.width()) ++ deltaX = buttonRect.width() - pixmapRect.width(); ++ else ++ deltaX = pixmapRect.width() - buttonRect.width(); ++ if (pixmapRect.height() < buttonRect.height()) ++ deltaY = buttonRect.height() - pixmapRect.height(); ++ else ++ deltaY = pixmapRect.height() - buttonRect.height(); ++ ++ painter.save(); ++ painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); ++ painter.translate(deltaX / 2, deltaY / 2); ++ painter.drawPixmap(pixmapRect, pixmap); ++ painter.restore(); + } + + void NetWorkButton::mouseReleaseEvent(QMouseEvent *e) diff --git a/debian/patches/series b/debian/patches/series index 7fd715a..ec8c54a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -52,3 +52,4 @@ 0052-94.patch 0053-97-fixbug.patch 0054-98-IABL4C-gg-IA5AIS-mp4.patch +0055-99-fixbug.patch