Fixbug 132105最大字体显示

This commit is contained in:
zhangyuanyuan1 2022-08-08 11:36:10 +08:00
parent b37de39bf2
commit a54b049b91
6 changed files with 75 additions and 24 deletions

View File

@ -69,7 +69,8 @@ void JoinHiddenWiFiPage::initUI()
m_secuWidget->setSecurity(KySecuType::WPA_AND_WPA2_PERSONAL);
m_descriptionLabel = new QLabel(this);
m_nameLabel = new QLabel(this);
m_nameLabel = new FixLabel(this);
m_nameLabel->setFixedWidth(LABEL_MIN_WIDTH);
m_nameEdit =new LineEdit(this);
m_emptyLabel = new QLabel(this);
@ -143,7 +144,7 @@ void JoinHiddenWiFiPage::initUI()
QFont font = m_descriptionLabel->font();
font.setWeight(75);
m_descriptionLabel->setFont(font);
m_nameLabel->setText(tr("Network name(SSID)")); //网络名(SSID)
m_nameLabel->setLabelText(tr("Network name(SSID)")); //网络名(SSID)
m_checkLabel->setText(tr("Remember the Network")); //记住该网络
m_showListBtn->setText(tr("Show Network List")); //显示网络列表
m_cancelBtn->setText(tr("Cancel"));

View File

@ -62,7 +62,7 @@ private:
SecurityPage *m_secuWidget;
QLabel *m_descriptionLabel;
QLabel *m_nameLabel;
FixLabel *m_nameLabel;
LineEdit *m_nameEdit;
QLabel *m_emptyLabel;

View File

@ -37,7 +37,8 @@
#define WINDOW_HEIGHT 602
#define ICON_SIZE 22,22
#define TITLE_LAYOUT_MARGINS 9,9,0,0
#define LAYOUT_MARGINS 0,0,0,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
#define DETAIL_PAGE_NUM 0
@ -49,6 +50,9 @@
#define PAGE_MIN_HEIGHT 40
#define LAN_TAB_WIDTH 180
#define WLAN_TAB_WIDTH 240
#define SCRO_WIDTH 472
#define PEAP_SCRO_HEIGHT 300
#define TLS_SCRO_HEIGHT 480
//extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);
@ -131,7 +135,7 @@ NetDetail::NetDetail(QString interface, QString name, QString uuid, bool isActiv
initComponent();
getConInfo(m_info);
pagePadding(name,isWlan);
setSecuPageHeight();
connect(qApp, &QApplication::paletteChanged, this, &NetDetail::onPaletteChanged);
isCreateOk = !(m_isCreateNet && !isWlan);
@ -244,7 +248,8 @@ void NetDetail::centerToScreen()
void NetDetail::initUI()
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(24,9,24,24);
mainLayout->setContentsMargins(0,9,0,24);
mainLayout->setSpacing(24);
detailPage = new DetailPage(isWlan, m_name.isEmpty(), this);
@ -259,11 +264,25 @@ void NetDetail::initUI()
centerWidget = new QWidget(this);
bottomWidget = new QWidget(this);
m_secuPageScrollArea = new QScrollArea(this);
m_secuPageScrollArea->setFrameShape(QFrame::NoFrame);
m_secuPageScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_secuPageScrollArea->setWidget(securityPage);
QPalette pal = m_secuPageScrollArea->palette();
pal.setBrush(QPalette::Window, Qt::transparent);
m_secuPageScrollArea->setPalette(pal);
detailPage->setFixedWidth(SCRO_WIDTH);
ipv4Page->setFixedWidth(SCRO_WIDTH);
ipv6Page->setFixedWidth(SCRO_WIDTH);
createNetPage->setFixedWidth(SCRO_WIDTH);
configPage->setFixedWidth(SCRO_WIDTH);
stackWidget = new QStackedWidget(centerWidget);
stackWidget->addWidget(detailPage);
stackWidget->addWidget(ipv4Page);
stackWidget->addWidget(ipv6Page);
stackWidget->addWidget(securityPage);
stackWidget->addWidget(m_secuPageScrollArea);
stackWidget->addWidget(configPage);
stackWidget->addWidget(createNetPage);
@ -320,13 +339,13 @@ void NetDetail::initUI()
this->setWindowIcon(QIcon::fromTheme("kylin-network"));
QVBoxLayout *centerlayout = new QVBoxLayout(centerWidget);
centerlayout->setContentsMargins(LAYOUT_MARGINS);
centerlayout->setContentsMargins(CENTER_LAYOUT_MARGINS);
centerlayout->addWidget(pageFrame);
centerlayout->addSpacing(4);
centerlayout->addWidget(stackWidget);
QHBoxLayout *bottomLayout = new QHBoxLayout(bottomWidget);
bottomLayout->setContentsMargins(LAYOUT_MARGINS);
bottomLayout->setContentsMargins(BOTTOM_LAYOUT_MARGINS);
bottomLayout->setSpacing(BOTTOM_LAYOUT_SPACING);
bottomLayout->addWidget(forgetBtn);
bottomLayout->addStretch();
@ -394,6 +413,13 @@ void NetDetail::initComponent()
isSecuOk = status;
setConfirmEnable();
});
connect(securityPage, &SecurityPage::secuTypeChanged, this, [=]() {
setSecuPageHeight();
});
connect(securityPage, &SecurityPage::eapTypeChanged, this, [=]() {
setSecuPageHeight();
});
}
void NetDetail::pagePadding(QString netName, bool isWlan)
@ -660,6 +686,22 @@ void NetDetail::initSecuData()
}
}
void NetDetail::setSecuPageHeight()
{
KySecuType secuType;
KyEapMethodType eapType;
securityPage->getSecuType(secuType, eapType);
if (secuType == WPA_AND_WPA2_ENTERPRISE) {
if (eapType == TLS) {
securityPage->setFixedSize(SCRO_WIDTH, TLS_SCRO_HEIGHT);
} else {
securityPage->setFixedSize(SCRO_WIDTH, PEAP_SCRO_HEIGHT);
}
} else {
securityPage->setFixedSize(SCRO_WIDTH, PEAP_SCRO_HEIGHT);
}
}
void NetDetail::initTlsInfo(ConInfo &conInfo)
{
m_resource->getEnterPriseInfoTls(m_uuid, conInfo.tlsInfo);

View File

@ -86,6 +86,7 @@ private:
void loadPage();
void pagePadding(QString netName, bool isWlan);
void initSecuData();
void setSecuPageHeight();
void initTlsInfo(ConInfo &conInfo);
void initPeapInfo(ConInfo &conInfo);
@ -133,6 +134,7 @@ private:
QWidget * centerWidget;
QWidget * bottomWidget;
QScrollArea * m_secuPageScrollArea;
QPushButton * cancelBtn;
QPushButton * forgetBtn;

View File

@ -44,13 +44,18 @@ void SecurityPage::initUI()
domainLable = new QLabel(this);
caCertPathLabel = new QLabel(this);
caNeedFlagLabel = new QLabel(this);
clientCertPathLabel = new QLabel(this);
clientPrivateKeyLabel = new QLabel(this);
clientPrivateKeyPwdLabel = new QLabel(this);
pwdOptionLabel = new QLabel(this);
clientCertPathLabel = new FixLabel(this);
clientCertPathLabel->setFixedWidth(MIN_LABEL_WIDTH);
clientPrivateKeyLabel = new FixLabel(this);
clientPrivateKeyLabel->setFixedWidth(MIN_LABEL_WIDTH);
clientPrivateKeyPwdLabel = new FixLabel(this);
clientPrivateKeyPwdLabel->setFixedWidth(MIN_LABEL_WIDTH);
pwdOptionLabel = new FixLabel(this);
pwdOptionLabel->setFixedWidth(MIN_LABEL_WIDTH);
//PEAP TTLS共有
eapMethodLabel = new QLabel(this);
eapMethodLabel = new FixLabel(this);
eapMethodLabel->setFixedWidth(MIN_LABEL_WIDTH);
userNameLabel = new QLabel(this);
userPwdLabel = new QLabel(this);
userPwdFlagLabel = new QLabel(this);
@ -183,15 +188,15 @@ void SecurityPage::initUI()
domainLable->setText(tr("Domain"));
caCertPathLabel->setText(tr("CA certficate"));
caNeedFlagLabel->setText(tr("no need for CA certificate"));
clientCertPathLabel->setText(tr("User certificate"));
clientPrivateKeyLabel->setText(tr("User private key"));
clientPrivateKeyPwdLabel->setText(tr("User key password"));
pwdOptionLabel->setText(tr("Password options"));
clientCertPathLabel->setLabelText(tr("User certificate"));
clientPrivateKeyLabel->setLabelText(tr("User private key"));
clientPrivateKeyPwdLabel->setLabelText(tr("User key password"));
pwdOptionLabel->setLabelText(tr("Password options"));
identityEdit->setPlaceholderText(tr("Required"));
clientPrivateKeyPwdEdit->setPlaceholderText(hintRequired);
//PEAP TTLS共有
eapMethodLabel->setText(tr("Ineer authentication"));
eapMethodLabel->setLabelText(tr("Ineer authentication"));
userNameLabel->setText(tr("Usename"));
userPwdLabel->setText(tr("Password"));
userPwdFlagLabel->setText(tr("Ask pwd each query"));

View File

@ -28,6 +28,7 @@
#include <QCheckBox>
#include "coninfo.h"
#include "detailwidget.h"
#include "kwidget.h"
#include "kpasswordedit.h"
@ -69,13 +70,13 @@ private:
QLabel *domainLable;
QLabel *caCertPathLabel;
QLabel *caNeedFlagLabel;
QLabel *clientCertPathLabel;
QLabel *clientPrivateKeyLabel;
QLabel *clientPrivateKeyPwdLabel;
QLabel *pwdOptionLabel;
FixLabel *clientCertPathLabel;
FixLabel *clientPrivateKeyLabel;
FixLabel *clientPrivateKeyPwdLabel;
FixLabel *pwdOptionLabel;
//PEAP TTLS共有
QLabel *eapMethodLabel;
FixLabel *eapMethodLabel;
QLabel *userNameLabel;
QLabel *userPwdLabel;
QLabel *userPwdFlagLabel;