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();