diff --git a/pcscreenmanage/suspendtabbar.cpp b/pcscreenmanage/suspendtabbar.cpp index 69f39dd..b044da9 100644 --- a/pcscreenmanage/suspendtabbar.cpp +++ b/pcscreenmanage/suspendtabbar.cpp @@ -97,11 +97,11 @@ void SuspendTabBar::setDeskBtnState(bool isDesktop) { if (isDesktop) { m_deskBtnState = false; - m_switchDeskBtn->setIcon(QIcon(":/tabbaricon/screenshare.svg")); + m_switchDeskBtn->setIcon(QIcon(":/tabbaricon/desktop.svg")); m_switchDeskBtn->setToolTip(tr("Back to the desktop")); } else { m_deskBtnState = true; - m_switchDeskBtn->setIcon(QIcon(":/tabbaricon/desktop.svg")); + m_switchDeskBtn->setIcon(QIcon(":/tabbaricon/screenshare.svg")); m_switchDeskBtn->setToolTip(tr("Resume screen projection")); } } @@ -257,9 +257,9 @@ void SuspendTabBar::onClicked() } } else if (btn == m_switchDeskBtn) { if (m_deskBtnState) { - Q_EMIT sigBtnClicked(SuspendTabBar::BtnType::ReturnDesktopBtn); - } else { Q_EMIT sigBtnClicked(SuspendTabBar::BtnType::ScreenShareBtn); + } else { + Q_EMIT sigBtnClicked(SuspendTabBar::BtnType::ReturnDesktopBtn); } } } diff --git a/pcscreenmanage/suspendtabbar.h b/pcscreenmanage/suspendtabbar.h index 1e6a228..b89d237 100644 --- a/pcscreenmanage/suspendtabbar.h +++ b/pcscreenmanage/suspendtabbar.h @@ -49,7 +49,7 @@ private: QPropertyAnimation *m_setHeightAnimation = nullptr; bool m_ctrlBtnState = true; - bool m_deskBtnState = true; + bool m_deskBtnState = false; bool m_isOpen = true; PublicAttributes::Theme m_theme = PublicAttributes::Theme::Light; // 主题 diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index 51814c9..14add64 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -862,6 +862,10 @@ void MainWindow::slotDisconnect() { clearConnectionInfo(); Q_EMIT sigDisconnect(); + if (m_suspendTabBar != nullptr) { + m_suspendTabBar->deleteLater(); + m_suspendTabBar = nullptr; + } m_isConnect = false; m_winFlage = WinFlage::DisconnectWin; m_uploadPath = ""; @@ -1207,7 +1211,7 @@ void MainWindow::slotRequestReceived(PcScreenManage::ScreenMsg msg) connect(m_suspendTabBar, &SuspendTabBar::sigBtnClicked, this, &MainWindow::slotTabBtnClicked); } m_suspendTabBar->setTheme(m_theme); - m_suspendTabBar->setDeskBtnState(true); + m_suspendTabBar->setDeskBtnState(false); m_suspendTabBar->showTabBar(); } break; case PcScreenManage::ScreenMsg::ShowView: {