Merge branch 'ukuibug' into 'dbus-interface'

fix bug 125703 任务栏显示图标和默认弹出界面不一致

See merge request kylin-desktop/kylin-nm!675
This commit is contained in:
赵世旭 2022-07-28 03:39:06 +00:00
commit be48c30738
2 changed files with 17 additions and 0 deletions

View File

@ -508,11 +508,27 @@ void MainWindow::showByWaylandHelper()
}
void MainWindow::setCentralWidgetType(IconActiveType iconStatus)
{
if (iconStatus == WLAN_CONNECTED || iconStatus == WLAN_CONNECTED_LIMITED) {
m_centralWidget->setCurrentIndex(WLAN_PAGE_INDEX);
} else if (iconStatus == ACTIVATING) {
if (m_wlanWidget->checkWlanStatus(NetworkManager::ActiveConnection::State::Activating)) {
m_centralWidget->setCurrentIndex(WLAN_PAGE_INDEX);
} else {
m_centralWidget->setCurrentIndex(LAN_PAGE_INDEX);
}
} else {
m_centralWidget->setCurrentIndex(LAN_PAGE_INDEX);
}
}
/**
* @brief MainWindow::onTrayIconActivated
*/
void MainWindow::onTrayIconActivated(QSystemTrayIcon::ActivationReason reason)
{
setCentralWidgetType(iconStatus);
if (reason == QSystemTrayIcon::ActivationReason::Context) {
m_trayIconMenu->popup(QCursor::pos());
} else {

View File

@ -155,6 +155,7 @@ private:
void resetWindowTheme();
void showControlCenter();
void showByWaylandHelper();
void setCentralWidgetType(IconActiveType iconStatus);
double m_transparency=1.0; //透明度
QGSettings * m_transGsettings; //透明度配置文件
int currentIconIndex=0;