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 系统正忙,请稍等