fix(仅bug修复,无其他影响): issues:修复最大化按钮不生效问题

This commit is contained in:
zoujunnan@kylinos.cn 2022-12-12 09:55:43 +08:00
parent 1850aa5a11
commit e4b8d1fc87
4 changed files with 35 additions and 13 deletions

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
kylin-photo-viewer (1.3.0.3-ok8) yangtze; urgency=medium
* BUG号
* 需求号:无
* 其他改动说明issues【X】【看图】打开看图将其最大化后点击最小化按钮点击任务栏图标打开看图后最大化/最小化按钮均不生效-修复最大化点击问题,最小化非看图问题
* 影响域:仅修复最大化问题,最小化问题非看图问题
-- zoujunnan <zoujunnan@kylinos.cn> Mon, 12 Dec 2022 18:43:28 +0800
kylin-photo-viewer (1.3.0.3-ok7) yangtze; urgency=medium
* BUG号# 130531【设计】【看图】ocr识别中的提示文字没居中

View File

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

View File

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

View File

@ -174,6 +174,7 @@ private:
KAboutDialog *m_aboutDialog = nullptr;
void initAboutDialog(); //初始化关于窗口
bool m_needCLoseGrabGesture = false;
bool m_nowFullScreen = false;
private Q_SLOTS: