From 05ab23d15643b26130c45ddd8b097449cfbfab24 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Mon, 26 Sep 2022 15:34:20 +0800 Subject: [PATCH 1/2] Fix bug 141661 --- src/frontend/netdetails/detailpage.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/netdetails/detailpage.cpp b/src/frontend/netdetails/detailpage.cpp index 8b410378..9356f1c1 100644 --- a/src/frontend/netdetails/detailpage.cpp +++ b/src/frontend/netdetails/detailpage.cpp @@ -23,6 +23,7 @@ #define MAX_NAME_LENGTH 32 #define MAX_LABEL_WIDTH 250 +#define MAX_SSID_WIDTH 133 extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); @@ -50,10 +51,10 @@ void DetailPage::setSSID(const QString &ssid) { return; } m_formerSSID = ssid; - QFontMetrics fontMetrics(this->font()); + QFontMetrics fontMetrics(m_SSIDLabel->font()); int fontSize = fontMetrics.width(ssid); - if (fontSize > this->width()) { - this->m_SSIDLabel->setText(fontMetrics.elidedText(ssid, Qt::ElideRight, this->width())); + if (fontSize > MAX_SSID_WIDTH) { + this->m_SSIDLabel->setText(fontMetrics.elidedText(ssid, Qt::ElideRight, MAX_SSID_WIDTH)); this->setToolTip(ssid); } else { this->m_SSIDLabel->setText(ssid); From 58316bed5933a93dd27550b468e06e68d64b0193 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Mon, 26 Sep 2022 16:34:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=A1=B5TLS=E5=AE=89=E5=85=A8=E7=B1=BB=E5=9E=8B=E6=9C=89?= =?UTF-8?q?=E9=81=AE=E6=8C=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/netdetails/netdetail.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/netdetails/netdetail.cpp b/src/frontend/netdetails/netdetail.cpp index cc04c773..02d4dc1c 100644 --- a/src/frontend/netdetails/netdetail.cpp +++ b/src/frontend/netdetails/netdetail.cpp @@ -37,7 +37,7 @@ #define WINDOW_HEIGHT 602 #define ICON_SIZE 22,22 #define TITLE_LAYOUT_MARGINS 9,9,0,0 -#define CENTER_LAYOUT_MARGINS 24,0,24,0 +#define CENTER_LAYOUT_MARGINS 24,0,0,0 #define BOTTOM_LAYOUT_MARGINS 24,0,24,0 #define BOTTOM_LAYOUT_SPACING 16 #define PAGE_LAYOUT_SPACING 1