From 1feabd094e79f58e52543726dff82ae06d49888b Mon Sep 17 00:00:00 2001 From: crrs666 Date: Fri, 28 May 2021 16:11:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui)=20=E6=9C=89=E7=BA=BF/=E6=97=A0=E7=BA=BF?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=BD=91=E7=BB=9C=E7=AA=97=E5=8F=A3ui?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/confform.cpp | 52 ++++++++++++++++------------- wireless-security/kylinheadfile.cpp | 7 ++-- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/confform.cpp b/src/confform.cpp index 96087226..e23a8699 100644 --- a/src/confform.cpp +++ b/src/confform.cpp @@ -21,6 +21,7 @@ #include "kylin-network-interface.h" #include "backthread.h" #include "utils.h" +#include "wireless-security/kylinheadfile.h" #include #include @@ -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); diff --git a/wireless-security/kylinheadfile.cpp b/wireless-security/kylinheadfile.cpp index 069c9f10..3312fbe8 100644 --- a/wireless-security/kylinheadfile.cpp +++ b/wireless-security/kylinheadfile.cpp @@ -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);"; }