ui间距调整

This commit is contained in:
zhangyuanyuan1 2022-10-13 09:47:44 +08:00
parent a75e820cc1
commit cb3fbb5eac
5 changed files with 9 additions and 3 deletions

View File

@ -19,7 +19,7 @@
*/
#include "deviceframe.h"
#define LAYOUT_MARGINS 18,0,24,0
#define LAYOUT_MARGINS 16,0,16,0
#define FRAME_HEIGHT 58
#define RADIUS 6.0

View File

@ -180,8 +180,10 @@ bool NetConnect::eventFilter(QObject *w, QEvent *e) {
void NetConnect::initComponent() {
wiredSwitch = new KSwitchButton(pluginWidget);
ui->openWIifLayout->addWidget(wiredSwitch);
ui->openWIifLayout->setContentsMargins(0,0,8,0);
ui->detailLayOut->setContentsMargins(MAIN_LAYOUT_MARGINS);
ui->verticalLayout_3->setContentsMargins(NO_MARGINS);
ui->verticalLayout_3->setSpacing(8);
ui->availableLayout->setSpacing(SPACING);
ui->horizontalLayout->setContentsMargins(TOP_MARGINS);

View File

@ -173,6 +173,7 @@ QWidget *WlanConnect::pluginUi() {
if(!m_interface->isValid()) {
qWarning() << qPrintable(QDBusConnection::sessionBus().lastError().message());
}
initSearchText();
initComponent();
}
return pluginWidget;
@ -238,8 +239,10 @@ bool WlanConnect::eventFilter(QObject *w, QEvent *e) {
void WlanConnect::initComponent() {
m_wifiSwitch = new KSwitchButton(pluginWidget);
ui->openWIifLayout->addWidget(m_wifiSwitch);
ui->openWIifLayout->setContentsMargins(0,0,8,0);
ui->detailLayOut_3->setContentsMargins(MAIN_LAYOUT_MARGINS);
ui->verticalLayout_3->setContentsMargins(NO_MARGINS);
ui->verticalLayout_3->setSpacing(8);
ui->availableLayout->setSpacing(SPACING);
m_wifiSwitch->installEventFilter(this);

View File

@ -22,7 +22,7 @@
#define MAIN_LAYOUT_MARGINS 0,0,0,0
#define MAIN_LAYOUT_SPACING 0
#define ITEM_FRAME_MARGINS 12,4,16,4
#define ITEM_FRAME_MARGINS 12,6,16,6
#define ITEM_FRAME_SPACING 8
#define FRAME_WIDTH 404

View File

@ -357,6 +357,7 @@ void NetDetail::initUI()
}
pageLayout->addWidget(m_netTabBar, Qt::AlignCenter);
pageLayout->addSpacing(24);
// TabBar关联选项卡页面
connect(m_netTabBar, SIGNAL(currentChanged(int)), this, SLOT(currentRowChangeSlot(int)));
@ -371,7 +372,7 @@ void NetDetail::initUI()
forgetBtn = new QPushButton(this);
QVBoxLayout *centerlayout = new QVBoxLayout(centerWidget);
centerlayout->setContentsMargins(CENTER_LAYOUT_MARGINS);
centerlayout->setContentsMargins(CENTER_LAYOUT_MARGINS); // 右边距为0为安全页滚动区域留出空间
centerlayout->addWidget(pageFrame);
centerlayout->addSpacing(4);
centerlayout->addWidget(stackWidget);