!54 托盘面板交互动效调整为滑动

Merge pull request !54 from dongyu/huanghe
This commit is contained in:
江川朗月 2024-11-14 03:39:37 +00:00 committed by Gitee
commit ec6c99869e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 35 additions and 3 deletions

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
ukui-power-manager (5.0.0.0-ok1.0) huanghe; urgency=medium
* BUG号
* 需求号:#369471 【交互动效】【电源管理】托盘面板交互动效调整
* 其他改动说明:托盘面板交互动效调整为滑动
* 其他改动影响域:无
-- dongyu <dongyu@kylinos.cn> Wed, 13 Nov 2024 15:00:36 +0800
ukui-power-manager (4.10.0.0-ok1.33) nile; urgency=medium
* 更新0920维哈克翻译

View File

@ -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;

View File

@ -64,6 +64,7 @@ public:
void setPowerStateLabelForBatteryInfoChanged();
void setPercentageLabelFontsize();
void showPowerWindow();
void slideWindowByPanelPosition(int panelPosition);
private :
bool m_isWayland = false;