From 02fb46f976c8bc886ab8c6ecead79726d2bcfc34 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Fri, 10 Jun 2022 14:28:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9plugin=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=83=AD=E7=82=B9=E9=97=B4=E8=B7=9D=E4=B8=BA16px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/mobilehotspot/mobilehotspotwidget.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/plugins/mobilehotspot/mobilehotspotwidget.cpp b/plugins/mobilehotspot/mobilehotspotwidget.cpp index 4fd62922..3edf7164 100644 --- a/plugins/mobilehotspot/mobilehotspotwidget.cpp +++ b/plugins/mobilehotspot/mobilehotspotwidget.cpp @@ -3,14 +3,14 @@ #define LABEL_RECT 17, 0, 105, 23 #define CONTENTS_MARGINS 0, 0, 0, 0 +#define ITEM_MARGINS 16, 0, 16, 0 #define FRAME_MIN_SIZE 550, 60 #define FRAME_MAX_SIZE 16777215, 16777215 #define CONTECT_FRAME_MAX_SIZE 16777215, 60 -#define LABLE_MIN_WIDTH 140 +#define LABLE_MIN_WIDTH 188 #define COMBOBOX_MIN_WIDTH 200 #define LINE_MAX_SIZE 16777215, 1 #define LINE_MIN_SIZE 0, 1 -#define LAYOUT_LEFT_MARGINS 8 #define ICON_SIZE 24,24 #define WIRELESS 1 @@ -367,7 +367,7 @@ void MobileHotspotWidget::setSwitchFrame() m_switchLabel = new QLabel(tr("Open"), this); m_switchLabel->setMinimumWidth(LABLE_MIN_WIDTH); m_switchBtn = new KSwitchButton(this); - switchLayout->addSpacing(LAYOUT_LEFT_MARGINS); + switchLayout->setContentsMargins(ITEM_MARGINS); switchLayout->addWidget(m_switchLabel); switchLayout->addStretch(); switchLayout->addWidget(m_switchBtn); @@ -390,7 +390,8 @@ void MobileHotspotWidget::setApNameFrame() m_apNameLine = new QLineEdit(this); m_apNameLine->setMinimumWidth(COMBOBOX_MIN_WIDTH); m_apNameLine->setMaxLength(AP_NAME_MAX_LENGTH); - apNameHLayout->addSpacing(LAYOUT_LEFT_MARGINS); + apNameHLayout->setContentsMargins(ITEM_MARGINS); + apNameHLayout->setSpacing(0); apNameHLayout->addWidget(m_apNameLabel); apNameHLayout->addWidget(m_apNameLine); m_ApNameFrame->setLayout(apNameHLayout); @@ -412,7 +413,8 @@ void MobileHotspotWidget::setPasswordFrame() m_pwdNameLine = new QLineEdit(this); m_pwdNameLine->setMinimumWidth(COMBOBOX_MIN_WIDTH); m_pwdNameLine->setEchoMode(QLineEdit::Password); - passwordHLayout->addSpacing(LAYOUT_LEFT_MARGINS); + passwordHLayout->setContentsMargins(ITEM_MARGINS); + passwordHLayout->setSpacing(0); passwordHLayout->addWidget(m_pwdLabel); passwordHLayout->addWidget(m_pwdNameLine); @@ -453,7 +455,8 @@ void MobileHotspotWidget::setFreqBandFrame() m_freqBandComboBox->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed); m_freqBandComboBox->addItem("2.4Ghz"); m_freqBandComboBox->addItem("5Ghz"); - freqBandHLayout->addSpacing(LAYOUT_LEFT_MARGINS); + freqBandHLayout->setContentsMargins(ITEM_MARGINS); + freqBandHLayout->setSpacing(0); freqBandHLayout->addWidget(m_freqBandLabel); freqBandHLayout->addWidget(m_freqBandComboBox); @@ -476,7 +479,8 @@ void MobileHotspotWidget::setInterFaceFrame() m_interfaceComboBox->setInsertPolicy(QComboBox::NoInsert); m_interfaceComboBox->setMinimumWidth(COMBOBOX_MIN_WIDTH); m_interfaceComboBox->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed); - interfaceHLayout->addSpacing(LAYOUT_LEFT_MARGINS); + interfaceHLayout->setContentsMargins(ITEM_MARGINS); + interfaceHLayout->setSpacing(0); interfaceHLayout->addWidget(m_interfaceLabel); interfaceHLayout->addWidget(m_interfaceComboBox);