From 1cf5dbd89f894586843636cd5cdd3df771b5614d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=B0=91=E5=8B=87?= Date: Thu, 13 Oct 2022 11:06:50 +0800 Subject: [PATCH] =?UTF-8?q?16551=E9=9C=80=E6=B1=82=EF=BC=9A=E5=B9=B3?= =?UTF-8?q?=E6=9D=BF=E6=9C=80=E5=A4=A7=E5=8C=96=E9=80=82=E9=85=8D=E6=94=B9?= =?UTF-8?q?=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kybackup/maindialog.cpp | 23 ++++++++++++++++++++--- kybackup/maindialog.h | 1 + kybackup/qt_bo_CN.ts | 23 ++++++++++++----------- kybackup/qt_zh_CN.ts | 23 ++++++++++++----------- 4 files changed, 45 insertions(+), 25 deletions(-) diff --git a/kybackup/maindialog.cpp b/kybackup/maindialog.cpp index 2d98943..639734a 100755 --- a/kybackup/maindialog.cpp +++ b/kybackup/maindialog.cpp @@ -239,12 +239,12 @@ void MainDialog::initConnect() QDBusReply is_tabletmode = m_statusSessionDbus->call("get_current_tabletmode"); GlobelBackupInfo::inst().setIsTabletMode(is_tabletmode); if (is_tabletmode) { - if (!isMinimized()) + if (!isMinimized()) showMaximized(); + m_maxBtn->setIcon(QIcon::fromTheme("window-restore-symbolic")); + m_maxBtn->setToolTip(tr("Normal")); m_maxBtn->setVisible(false); } else { - if (!isMinimized()) - showNormal(); m_maxBtn->setVisible(true); } connect(m_statusSessionDbus, SIGNAL(mode_change_signal(bool)), this, SLOT(tabletModeChange(bool))); @@ -274,6 +274,23 @@ void MainDialog::tabletModeChange(bool isTabletMode) } } +void MainDialog::changeEvent(QEvent *event) +{ + if (QEvent::WindowStateChange == event->type()) { + // 如果是平板模式 + if (GlobelBackupInfo::inst().isTabletMode()) { + Qt::WindowStates state = this->windowState(); + if (state == Qt::WindowMaximized) { + event->accept(); + showMaximized(); + return ; + } + } + } + + QMainWindow::changeEvent(event); +} + /** * @brief 左侧功能选择栏响应槽 * @param func_type,功能类型 diff --git a/kybackup/maindialog.h b/kybackup/maindialog.h index 9551e17..15d3f39 100755 --- a/kybackup/maindialog.h +++ b/kybackup/maindialog.h @@ -27,6 +27,7 @@ public: protected: void resizeEvent(QResizeEvent *event); + void changeEvent(QEvent *event); public slots: void sltMessageReceived(const QString &msg); diff --git a/kybackup/qt_bo_CN.ts b/kybackup/qt_bo_CN.ts index 13ad6c9..6617a4e 100644 --- a/kybackup/qt_bo_CN.ts +++ b/kybackup/qt_bo_CN.ts @@ -1083,7 +1083,7 @@ - + Maximize ཚད་གཞི་མཐོ་ཤོས་ཀྱི་སྒོ་ནས @@ -1108,7 +1108,8 @@ ཕྱིར་འཐེན་བྱེད་པ། - + + Normal རྒྱུན་ལྡན་གྱི་གནས་ @@ -1251,9 +1252,9 @@ - - - + + + @@ -1283,9 +1284,9 @@ - - - + + + @@ -1350,7 +1351,7 @@ ཅིན་པུའུ་ལུའུ་ཕུའུ། - + An exception occurred when mounting backup partition. རྗེས་གྲབས་ཁག་བགོས་སྒྲིག་སྦྱོར་བྱེད་སྐབས་དམིགས་བསལ་གྱི་གནས་ཚུལ་བྱུང་བ་རེད། @@ -1359,12 +1360,12 @@ 请检查备份还原分区是否存在,在安装操作系统时必须创建备份还原分区。 - + Failed to mount backup partition. རྗེས་གྲབས་ཁག་བགོས་བྱེད་མ་ཐུབ་པ་རེད། - + It's busy, please wait བྲེལ་བ་ཧ་ཅང་ཆེ་བས་སྒུག་དང་། diff --git a/kybackup/qt_zh_CN.ts b/kybackup/qt_zh_CN.ts index 3214039..6f9e793 100755 --- a/kybackup/qt_zh_CN.ts +++ b/kybackup/qt_zh_CN.ts @@ -1083,7 +1083,7 @@ - + Maximize 最大化 @@ -1108,7 +1108,8 @@ 退出 - + + Normal 还原 @@ -1251,9 +1252,9 @@ - - - + + + @@ -1274,9 +1275,9 @@ - - - + + + @@ -1346,7 +1347,7 @@ 备份还原工具 - + An exception occurred when mounting backup partition. 挂载备份分区时发生错误。 @@ -1355,12 +1356,12 @@ 请检查备份还原分区是否存在,在安装操作系统时必须创建备份还原分区。 - + Failed to mount backup partition. 挂载备份分区失败。 - + It's busy, please wait 系统正忙,请稍等