From 8eb8a4f24a43e71e7203cc9e781e793b858969b6 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Tue, 7 Mar 2023 13:59:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E5=90=8D=E7=A7=B0=E5=92=8C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=E9=87=8D=E5=8F=A0=20?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/list-items/lanlistitem.cpp | 4 +--- src/frontend/list-items/wlanlistitem.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/frontend/list-items/lanlistitem.cpp b/src/frontend/list-items/lanlistitem.cpp index 99e9278f..ab9a7a01 100644 --- a/src/frontend/list-items/lanlistitem.cpp +++ b/src/frontend/list-items/lanlistitem.cpp @@ -219,10 +219,8 @@ void LanListItem::updateConnectionState(ConnectState state) m_netButton->stopLoading(); if (state == Activated) { setIcon(true); - m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_ACTIVATED); } else { setIcon(false); - m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_DEACTIVATED); } } else { m_netButton->startLoading(); @@ -284,7 +282,7 @@ void LanListItem::leaveEvent(QEvent *event) m_lbLoadDown->show(); m_lbLoadDownImg->show(); m_lbLoadUpImg->show(); - } else if (m_lanConnectItem.m_connectState == Deactivated) { + } else { m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_DEACTIVATED); } return ListItem::leaveEvent(event); diff --git a/src/frontend/list-items/wlanlistitem.cpp b/src/frontend/list-items/wlanlistitem.cpp index 2f5a6154..89248b39 100644 --- a/src/frontend/list-items/wlanlistitem.cpp +++ b/src/frontend/list-items/wlanlistitem.cpp @@ -229,7 +229,7 @@ void WlanListItem::leaveEvent(QEvent *event) m_lbLoadDown->show(); m_lbLoadDownImg->show(); m_lbLoadUpImg->show(); - } else if (m_connectState == Deactivated) { + } else { m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_DEACTIVATED); } if (m_pwdFrame && m_pwdFrame->isVisible()) { @@ -661,7 +661,9 @@ void WlanListItem::updateConnectState(ConnectState state) m_hoverButton->setProperty("useButtonPalette", true); m_hoverButton->setProperty("isImportant", false); m_hoverButton->setButtonText(tr("Disconnect")); - m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_ACTIVATED); + if (m_hoverButton->isHidden()) { + m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_ACTIVATED); + } } else if(Deactivated == state) { qDebug() << "[WlanListItem] stop loading connect state:" << state; m_netButton->stopLoading(); @@ -669,7 +671,9 @@ void WlanListItem::updateConnectState(ConnectState state) m_hoverButton->setProperty("isImportant", true); m_hoverButton->setProperty("useButtonPalette", false); m_hoverButton->setButtonText(tr("Connect")); - m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_DEACTIVATED); + if (m_hoverButton->isHidden()) { + m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_DEACTIVATED); + } } else { qDebug() << "[WlanListItem] start loading connect state:" << state; m_netButton->startLoading();