From e4b8d1fc87c374a667b48085a651c5095d68e06a Mon Sep 17 00:00:00 2001 From: "zoujunnan@kylinos.cn" Date: Mon, 12 Dec 2022 09:55:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=85bug=E4=BF=AE=E5=A4=8D=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E5=85=B6=E4=BB=96=E5=BD=B1=E5=93=8D):=20issues?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=E5=A4=8D=E6=9C=80=E5=A4=A7=E5=8C=96=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 9 +++++++++ src/src.pro | 2 +- src/view/kyview.cpp | 36 ++++++++++++++++++++++++------------ src/view/kyview.h | 1 + 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index a8dca5d..351f946 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +kylin-photo-viewer (1.3.0.3-ok8) yangtze; urgency=medium + + * BUG号:无 + * 需求号:无 + * 其他改动说明:issues【X】【看图】打开看图将其最大化后点击最小化按钮,点击任务栏图标打开看图后最大化/最小化按钮均不生效-修复最大化点击问题,最小化非看图问题 + * 影响域:仅修复最大化问题,最小化问题非看图问题 + + -- zoujunnan Mon, 12 Dec 2022 18:43:28 +0800 + kylin-photo-viewer (1.3.0.3-ok7) yangtze; urgency=medium * BUG号:# 130531【设计】【看图】ocr识别中的提示文字没居中 diff --git a/src/src.pro b/src/src.pro index 2c225bb..85b6880 100644 --- a/src/src.pro +++ b/src/src.pro @@ -11,7 +11,7 @@ CONFIG += link_pkgconfig VERSION = 1.3.0.3 DEFINES += APP_VERSION=\\\"$$VERSION\\\" ##定义一个字符串,可以将版本号数字之后的部分添加进去 -DEFINES += APP_VERSION_DETAIL=\\\"$$VERSION-ok7\\\" +DEFINES += APP_VERSION_DETAIL=\\\"$$VERSION-ok8\\\" QMAKE_CXXFLAGS += -g diff --git a/src/view/kyview.cpp b/src/view/kyview.cpp index 67bda4c..9f004b8 100644 --- a/src/view/kyview.cpp +++ b/src/view/kyview.cpp @@ -770,8 +770,6 @@ void KyView::fullScreen() { if (this->isFullScreen()) { KWindowSystem::clearState(winId(), NET::FullScreen); - // m_titlebar->g_fullscreen->setIcon(QIcon::fromTheme("window-maximize-symbolic"));//主题库的全屏图标 - // m_titlebar->g_fullscreen->setToolTip(tr("full srceen")); } else { KWindowSystem::setState(winId(), NET::FullScreen); m_titlebar->g_fullscreen->setIcon(QIcon::fromTheme("window-restore-symbolic")); //主题库的恢复图标 @@ -838,14 +836,13 @@ void KyView::markToolChange() //最大化和还原 void KyView::changOrigSize() { - if (windowState() == Qt::WindowMaximized) { + if (this->isMaximized()) { this->showNormal(); - } else if (windowState() == Qt::WindowNoState) { + } else if (this->isFullScreen() || m_nowFullScreen) { + KWindowSystem::clearState(winId(), NET::FullScreen); + m_nowFullScreen = false; + } else { this->showMaximized(); - } else if (windowState() == Qt::WindowFullScreen) { - KWindowSystem::clearState(winId(), NET::FullScreen); - } else if (windowState() == Qt::WindowMaximized | Qt::WindowFullScreen) { - KWindowSystem::clearState(winId(), NET::FullScreen); } m_titlebar->dealEditState(); } @@ -989,7 +986,7 @@ void KyView::resizeEvent(QResizeEvent *event) albumChange(); markChange(); brushSettingsChange(); - if (this->isMaximized() || this->isFullScreen()) { + if (this->isMaximized() || this->isFullScreen() || m_nowFullScreen) { m_titlebar->g_fullscreen->setIcon(QIcon::fromTheme("window-restore-symbolic")); //主题库的全屏图标 m_titlebar->g_fullscreen->setToolTip(tr("recovery")); } else { @@ -1214,11 +1211,15 @@ void KyView::dealMouseDouble() if (!m_navigator->isHidden() && (m_navigator->geometry().contains(this->mapFromGlobal(QCursor::pos())))) { return; } - if (this->isFullScreen()) { + if (this->isFullScreen() || m_nowFullScreen) { KWindowSystem::clearState(winId(), NET::FullScreen); + m_nowFullScreen = false; } else { KWindowSystem::setState(winId(), NET::FullScreen); + m_nowFullScreen = true; + m_titlebar->g_fullscreen->setIcon(QIcon::fromTheme("window-restore-symbolic")); //主题库的恢复图标 + m_titlebar->g_fullscreen->setToolTip(tr("recovery")); } } else if (m_titlebar->geometry().contains(this->mapFromGlobal(QCursor::pos()))) { @@ -1512,7 +1513,6 @@ void KyView::changeEvent(QEvent *event) { if (QEvent::WindowStateChange == event->type()) { Qt::WindowStates state = windowState(); - if (state == Qt::WindowNoState) { m_titlebar->g_fullscreen->setIcon(QIcon::fromTheme("window-maximize-symbolic")); //主题库的全屏图标 m_titlebar->g_fullscreen->setToolTip(tr("full srceen")); @@ -1523,11 +1523,23 @@ void KyView::changeEvent(QEvent *event) this->move((screen->geometry().width() - this->width()) / 2, (screen->geometry().height() - this->height()) / 2); } - } else if (state == Qt::WindowMaximized) { + } else { m_titlebar->g_fullscreen->setIcon(QIcon::fromTheme("window-restore-symbolic")); //主题库的恢复图标 m_titlebar->g_fullscreen->setToolTip(tr("recovery")); } } + if (m_nowFullScreen) { + m_titlebar->g_fullscreen->setIcon(QIcon::fromTheme("window-restore-symbolic")); //主题库的恢复图标 + m_titlebar->g_fullscreen->setToolTip(tr("recovery")); + } else { + if (this->isMaximized()) { + m_titlebar->g_fullscreen->setIcon(QIcon::fromTheme("window-restore-symbolic")); //主题库的恢复图标 + m_titlebar->g_fullscreen->setToolTip(tr("recovery")); + } else { + m_titlebar->g_fullscreen->setIcon(QIcon::fromTheme("window-maximize-symbolic")); //主题库的全屏图标 + m_titlebar->g_fullscreen->setToolTip(tr("full srceen")); + } + } return; } diff --git a/src/view/kyview.h b/src/view/kyview.h index 1e32655..13a13bd 100644 --- a/src/view/kyview.h +++ b/src/view/kyview.h @@ -174,6 +174,7 @@ private: KAboutDialog *m_aboutDialog = nullptr; void initAboutDialog(); //初始化关于窗口 bool m_needCLoseGrabGesture = false; + bool m_nowFullScreen = false; private Q_SLOTS: