fix(ui) 有线/无线创建网络窗口ui一致

This commit is contained in:
crrs666 2021-05-28 16:11:46 +08:00
parent 687beca073
commit 1feabd094e
2 changed files with 32 additions and 27 deletions

View File

@ -21,6 +21,7 @@
#include "kylin-network-interface.h"
#include "backthread.h"
#include "utils.h"
#include "wireless-security/kylinheadfile.h"
#include <sys/types.h>
#include <unistd.h>
@ -49,25 +50,28 @@ ConfForm::ConfForm(QWidget *parent) :
setProperty("blurRegion", QRegion(path.toFillPolygon().toPolygon()));
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
labelQss = "QLabel{border:0px;color:rgba(255,255,255,0.97);background-color:transparent;}";
cbxQss = "QComboBox{padding-left:20px;font-size:13px;color:rgba(255,255,255,0.91);"
"border:1px solid rgba(255, 255, 255, 0.05);border-radius:4px;background:rgba(255,255,255,0.08);}"
"QComboBox::drop-down{border:0px;width:30px;}"
"QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"
"QComboBox QAbstractItemView {margin:0px 0px 0px 0px;padding: 0px 0px;border-radius:0px;background-color:#48484C;outline:0px;}"
"QComboBox QAbstractItemView::item{padding-left:17px;border-radius:0px;font-size:13px;color:rgba(255,255,255,0.91);height: 32px;background-color:#48484C;outline:0px;}"
"QComboBox QAbstractItemView::item:hover{padding-left:17px;border-radius:0px;font-size:13px;color:rgba(255,255,255,0.91);background-color:#3D6BE5;outline:0px;}";
leQss = "QLineEdit{padding-left:20px;color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}";
btnOffQss = "QPushButton[on=false]{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.08);color:white;font-size:14px;}"
"QPushButton[on=false]:Hover{border:0px solid rgba(255,255,255,0.1);border-radius:4px;background-color:rgba(255,255,255,0.1);}"
"QPushButton[on=false]:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}"
"QPushButton[on=true]{border:0px;border-radius:4px;background-color:rgba(244,244,244,0.12);color:white;font-size:14px;}"
"QPushButton[on=true]:Hover{border:0px solid rgba(244,244,244,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton[on=true]:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}";
btnOnQss = "QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);";
lineQss = "background:rgba(156,156,156,0.1);";
MyQss objQss;
//use uniform ui style instead
// labelQss = "QLabel{border:0px;color:rgba(255,255,255,0.97);background-color:transparent;}";
// cbxQss = "QComboBox{padding-left:20px;font-size:13px;color:rgba(255,255,255,0.91);"
// "border:1px solid rgba(255, 255, 255, 0.05);border-radius:4px;background:rgba(255,255,255,0.08);}"
// "QComboBox::drop-down{border:0px;width:30px;}"
// "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"
// "QComboBox QAbstractItemView {margin:0px 0px 0px 0px;padding: 0px 0px;border-radius:0px;background-color:#48484C;outline:0px;}"
// "QComboBox QAbstractItemView::item{padding-left:17px;border-radius:0px;font-size:13px;color:rgba(255,255,255,0.91);height: 32px;background-color:#48484C;outline:0px;}"
// "QComboBox QAbstractItemView::item:hover{padding-left:17px;border-radius:0px;font-size:13px;color:rgba(255,255,255,0.91);background-color:#3D6BE5;outline:0px;}";
// leQss = "QLineEdit{padding-left:20px;color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}";
// btnOffQss = "QPushButton[on=false]{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.08);color:white;font-size:14px;}"
// "QPushButton[on=false]:Hover{border:0px solid rgba(255,255,255,0.1);border-radius:4px;background-color:rgba(255,255,255,0.1);}"
// "QPushButton[on=false]:Pressed{border-radius:4px;background-color:rgba(255,255,255,0.08);}"
// "QPushButton[on=true]{border:0px;border-radius:4px;background-color:rgba(244,244,244,0.12);color:white;font-size:14px;}"
// "QPushButton[on=true]:Hover{border:0px solid rgba(244,244,244,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
// "QPushButton[on=true]:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}";
// btnOnQss = "QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
// "QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
// "QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);";
// lineQss = "background:rgba(156,156,156,0.1);";
ui->wdHead->setStyleSheet("#wdHead{border:none}");
ui->wgManual->setStyleSheet("#wgManual{border:none}");
@ -83,8 +87,8 @@ ConfForm::ConfForm(QWidget *parent) :
//设置网络名称的正则表达式
// ui->leName->setValidator(new QRegExpValidator(QRegExp("[^ \s]*"), ui->leName));
ui->lineUp->setStyleSheet(lineQss);
ui->lineDown->setStyleSheet(lineQss);
ui->lineUp->setStyleSheet(objQss.lineQss);
ui->lineDown->setStyleSheet(objQss.lineQss);
ui->lineUp->hide();
ui->lineDown->hide();
@ -117,9 +121,9 @@ ConfForm::ConfForm(QWidget *parent) :
ui->btnSave->setProperty("on",false);
ui->btnCreate->setProperty("on",false);
ui->btnCancel->setStyleSheet(btnOffQss);
ui->btnSave->setStyleSheet(btnOffQss);
ui->btnCreate->setStyleSheet(btnOffQss);
ui->btnCancel->setStyleSheet(objQss.btnOffQss);
ui->btnSave->setStyleSheet(objQss.btnOffQss);
ui->btnCreate->setStyleSheet(objQss.btnOffQss);
ui->btnCancel->setFocusPolicy(Qt::NoFocus);
ui->btnSave->setFocusPolicy(Qt::NoFocus);

View File

@ -42,7 +42,8 @@ MyQss::MyQss()
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);}";
lineQss = "background:rgba(156,156,156,0.1);";
btnOffQss = "QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
"QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);";
btnOffQss = "QPushButton[on=false]{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:grey;font-size:14px;}"
"QPushButton[on=true]{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}"
"QPushButton[on=true]:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(107,142,235,1);}"
"QPushButton[on=true]:Pressed{border-radius:4px;background-color:rgba(50,87,202,1);";
}