Merge branch '2209bug-tray' into 'yhkylin/v101'

fix bug 网络名称和按钮显示重叠 名称显示异常问题

See merge request kylinos-src/kylin-nm!111
This commit is contained in:
赵世旭 2023-03-08 03:30:13 +00:00
commit 399cf12d25
2 changed files with 8 additions and 6 deletions

View File

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

View File

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