From f1aecccce068bb078c4daecfe6946a78898d3b5d Mon Sep 17 00:00:00 2001 From: dongyu Date: Wed, 13 Nov 2024 14:58:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E6=89=98=E7=9B=98=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E5=8A=A8=E6=95=88=E8=B0=83=E6=95=B4=E4=B8=BA?= =?UTF-8?q?=E6=BB=91=E5=8A=A8(story#33051)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ukui-power-manager-tray/powerwindow.cpp | 28 ++++++++++++++++++++++--- ukui-power-manager-tray/powerwindow.h | 1 + 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ukui-power-manager-tray/powerwindow.cpp b/ukui-power-manager-tray/powerwindow.cpp index ffa768d..e6c981e 100644 --- a/ukui-power-manager-tray/powerwindow.cpp +++ b/ukui-power-manager-tray/powerwindow.cpp @@ -411,6 +411,7 @@ void powerwindow::showPowerWindow() resetWindowPosition(); KWindowSystem::setState(this->winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher); this->show(); + powerwindow::slideWindowByPanelPosition(m_panelPosition); this->activateWindow(); } else { this->show(); @@ -418,6 +419,27 @@ void powerwindow::showPowerWindow() kdk::WindowManager::setSkipTaskBar(this->windowHandle(), true); kdk::WindowManager::setSkipSwitcher(this->windowHandle(), true); resetWindowPosition(); + powerwindow::slideWindowByPanelPosition(m_panelPosition); + } +} + +void powerwindow::slideWindowByPanelPosition(int panelPosition) +{ + if(panelPosition == 0) + { + KWindowEffects::slideWindow(this->winId(), KWindowEffects::BottomEdge); + } + else if (panelPosition == 1) + { + KWindowEffects::slideWindow(this->winId(), KWindowEffects::TopEdge); + } + else if(panelPosition == 2) + { + KWindowEffects::slideWindow(this->winId(), KWindowEffects::LeftEdge); + } + else + { + KWindowEffects::slideWindow(this->winId(), KWindowEffects::RightEdge); } } @@ -425,13 +447,13 @@ void powerwindow::resetWindowPosition() { QVariant value; int panelSize = 46; - int panelPosition = panel_bottom; + m_panelPosition = panel_bottom; if (true == UpmGsettings::self()->getGsettingsConfig(GSETTINGS_KEY_PANEL_SIZE, value)) { panelSize = value.toInt(); } if (true == UpmGsettings::self()->getGsettingsConfig(GSETTINGS_KEY_PANEL_POSITION, value)) { - panelPosition = value.toInt(); + m_panelPosition = value.toInt(); } QRect availableGeometry = QGuiApplication::screenAt(QCursor::pos())->geometry(); @@ -439,7 +461,7 @@ void powerwindow::resetWindowPosition() int y = 0; int margin = 8; - switch (panelPosition) { + switch (m_panelPosition) { case PanelPosition::panel_top: if (true == m_specialLanguage) { x = availableGeometry.x() + margin; diff --git a/ukui-power-manager-tray/powerwindow.h b/ukui-power-manager-tray/powerwindow.h index b23e9a5..cdaa032 100644 --- a/ukui-power-manager-tray/powerwindow.h +++ b/ukui-power-manager-tray/powerwindow.h @@ -64,6 +64,7 @@ public: void setPowerStateLabelForBatteryInfoChanged(); void setPercentageLabelFontsize(); void showPowerWindow(); + void slideWindowByPanelPosition(int panelPosition); private : bool m_isWayland = false; From ee5caa0b7c0c5b7d1328b529448dc463eb696eb4 Mon Sep 17 00:00:00 2001 From: dongyu Date: Wed, 13 Nov 2024 15:07:07 +0800 Subject: [PATCH 2/2] update changelog --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index dde353a..a540fca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +ukui-power-manager (5.0.0.0-ok1.0) huanghe; urgency=medium + + * BUG号: 无 + * 需求号:#369471 【交互动效】【电源管理】托盘面板交互动效调整 + * 其他改动说明:托盘面板交互动效调整为滑动 + * 其他改动影响域:无 + + -- dongyu Wed, 13 Nov 2024 15:00:36 +0800 + ukui-power-manager (4.10.0.0-ok1.33) nile; urgency=medium * 更新0920维哈克翻译