按设计稿调整网络名称和按钮间距

This commit is contained in:
zhangyuanyuan1 2023-04-14 15:58:55 +08:00
parent 8277fb7e4f
commit 0d46502479
3 changed files with 4 additions and 3 deletions

View File

@ -276,7 +276,7 @@ void LanListItem::enterEvent(QEvent *event)
void LanListItem::leaveEvent(QEvent *event)
{
m_hoverButton->hide();
if (m_lanConnectItem.m_connectState == Activated) {
if (m_lanConnectItem.m_connectState == Activated || m_connectState == Deactivating) {
m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_ACTIVATED);
m_lbLoadUp->show();
m_lbLoadDown->show();

View File

@ -289,12 +289,12 @@ void ListItem::initUI()
m_hItemLayout->addSpacing(8);
m_hItemLayout->addWidget(m_freq);
m_hItemLayout->addStretch();
m_hItemLayout->addSpacing(8);
m_hItemLayout->addWidget(m_lbLoadUpImg);
m_hItemLayout->addWidget(m_lbLoadUp);
m_hItemLayout->addSpacing(2);
m_hItemLayout->addWidget(m_lbLoadDownImg);
m_hItemLayout->addWidget(m_lbLoadDown);
m_hItemLayout->addSpacing(2);
m_hItemLayout->addWidget(m_hoverButton);
// m_hItemLayout->addWidget(m_infoButton);
@ -358,6 +358,7 @@ void NameLabel::changedLabelSlot()
QFontMetrics fontMetrics(this->font());
int fontSize = fontMetrics.width(m_name);
if (fontSize > m_maximumWidth) {
this->setFixedWidth(m_maximumWidth - 2);
setText(fontMetrics.elidedText(m_name, Qt::ElideRight, m_maximumWidth));
setToolTip(m_name);
} else {

View File

@ -225,7 +225,7 @@ void WlanListItem::leaveEvent(QEvent *event)
//qDebug()<< LOG_FLAG <<"leaveEvent"<< m_wirelessNetItem.m_NetSsid;
m_mouseIsOut = true;
m_hoverButton->hide();
if (m_connectState == Activated) {
if (m_connectState == Activated || m_connectState == Deactivating) {
m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_ACTIVATED);
m_lbLoadUp->show();
m_lbLoadDown->show();