按设计稿调整网络名称和按钮间距
This commit is contained in:
parent
8277fb7e4f
commit
0d46502479
|
@ -276,7 +276,7 @@ void LanListItem::enterEvent(QEvent *event)
|
||||||
void LanListItem::leaveEvent(QEvent *event)
|
void LanListItem::leaveEvent(QEvent *event)
|
||||||
{
|
{
|
||||||
m_hoverButton->hide();
|
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_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_ACTIVATED);
|
||||||
m_lbLoadUp->show();
|
m_lbLoadUp->show();
|
||||||
m_lbLoadDown->show();
|
m_lbLoadDown->show();
|
||||||
|
|
|
@ -289,12 +289,12 @@ void ListItem::initUI()
|
||||||
m_hItemLayout->addSpacing(8);
|
m_hItemLayout->addSpacing(8);
|
||||||
m_hItemLayout->addWidget(m_freq);
|
m_hItemLayout->addWidget(m_freq);
|
||||||
m_hItemLayout->addStretch();
|
m_hItemLayout->addStretch();
|
||||||
|
m_hItemLayout->addSpacing(8);
|
||||||
m_hItemLayout->addWidget(m_lbLoadUpImg);
|
m_hItemLayout->addWidget(m_lbLoadUpImg);
|
||||||
m_hItemLayout->addWidget(m_lbLoadUp);
|
m_hItemLayout->addWidget(m_lbLoadUp);
|
||||||
m_hItemLayout->addSpacing(2);
|
m_hItemLayout->addSpacing(2);
|
||||||
m_hItemLayout->addWidget(m_lbLoadDownImg);
|
m_hItemLayout->addWidget(m_lbLoadDownImg);
|
||||||
m_hItemLayout->addWidget(m_lbLoadDown);
|
m_hItemLayout->addWidget(m_lbLoadDown);
|
||||||
m_hItemLayout->addSpacing(2);
|
|
||||||
m_hItemLayout->addWidget(m_hoverButton);
|
m_hItemLayout->addWidget(m_hoverButton);
|
||||||
// m_hItemLayout->addWidget(m_infoButton);
|
// m_hItemLayout->addWidget(m_infoButton);
|
||||||
|
|
||||||
|
@ -358,6 +358,7 @@ void NameLabel::changedLabelSlot()
|
||||||
QFontMetrics fontMetrics(this->font());
|
QFontMetrics fontMetrics(this->font());
|
||||||
int fontSize = fontMetrics.width(m_name);
|
int fontSize = fontMetrics.width(m_name);
|
||||||
if (fontSize > m_maximumWidth) {
|
if (fontSize > m_maximumWidth) {
|
||||||
|
this->setFixedWidth(m_maximumWidth - 2);
|
||||||
setText(fontMetrics.elidedText(m_name, Qt::ElideRight, m_maximumWidth));
|
setText(fontMetrics.elidedText(m_name, Qt::ElideRight, m_maximumWidth));
|
||||||
setToolTip(m_name);
|
setToolTip(m_name);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -225,7 +225,7 @@ void WlanListItem::leaveEvent(QEvent *event)
|
||||||
//qDebug()<< LOG_FLAG <<"leaveEvent"<< m_wirelessNetItem.m_NetSsid;
|
//qDebug()<< LOG_FLAG <<"leaveEvent"<< m_wirelessNetItem.m_NetSsid;
|
||||||
m_mouseIsOut = true;
|
m_mouseIsOut = true;
|
||||||
m_hoverButton->hide();
|
m_hoverButton->hide();
|
||||||
if (m_connectState == Activated) {
|
if (m_connectState == Activated || m_connectState == Deactivating) {
|
||||||
m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_ACTIVATED);
|
m_nameLabel->setLabelMaximumWidth(NAMELABLE_MAX_WIDTH_ACTIVATED);
|
||||||
m_lbLoadUp->show();
|
m_lbLoadUp->show();
|
||||||
m_lbLoadDown->show();
|
m_lbLoadDown->show();
|
||||||
|
|
Loading…
Reference in New Issue