From 3c56b3315644427765d4fd392ca05441bb326989 Mon Sep 17 00:00:00 2001 From: xueyan hu <576627988@qq.com> Date: Fri, 24 Dec 2021 17:41:56 +0800 Subject: [PATCH] style improve --- src/ScanFormWidget.cpp | 1 - src/mainwindow.cpp | 2 +- src/network/networkcfgdialog.cpp | 7 ++-- src/networkcfgdialog.ui | 23 ++++++++----- src/res.qrc | 1 + src/stylesheet/Dark2.qss | 1 + src/systemsettingform.cpp | 2 +- src/translations/zh_CN.ts | 58 ++++++++++++++++---------------- src/translations/zh_CN.ts.bak | 58 ++++++++++++++++---------------- 9 files changed, 81 insertions(+), 72 deletions(-) create mode 100644 src/stylesheet/Dark2.qss diff --git a/src/ScanFormWidget.cpp b/src/ScanFormWidget.cpp index 436619b..ac19f46 100644 --- a/src/ScanFormWidget.cpp +++ b/src/ScanFormWidget.cpp @@ -30,7 +30,6 @@ ScanFormWidget::ScanFormWidget(QWidget* parent) : TabFormWidget(parent) { "QWidget#broadcast_widget{border:2px solid #515151; border-radius: 20px; background-color:black}" "QWidget#broadcast_widget QLabel{background-color:black}" "QLabel#lbl_protocol{font-size:32px; margin:0; color:silver}" - // "QLabel#viewer{border:1px solid yellow}" "QLabel#lbl_title,QLabel#lbl_ptitle{font-size:20px;margin:0; border-bottom:1px solid silver}" "QLabel#lbl_end{font-size:20px;margin:0; border-top:1px solid #0078d8}" "QLabel#lbl_e{font-size:20px;}" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7517750..025100e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -53,7 +53,7 @@ MainWindow::MainWindow(QWidget* parent) : ui(new Ui::MainWindow) { - this->loadStyleSheet("Dark"); + this->loadStyleSheet("Dark2"); ui->setupUi(this); tab = new QTabWidget(this); tab->setTabPosition(QTabWidget::South); diff --git a/src/network/networkcfgdialog.cpp b/src/network/networkcfgdialog.cpp index 0794f62..b74cb56 100644 --- a/src/network/networkcfgdialog.cpp +++ b/src/network/networkcfgdialog.cpp @@ -23,7 +23,7 @@ networkCfgDialog::networkCfgDialog(QWidget* parent) : msgDialog->hide(); ui->sw_dhcp->setChecked(true); - ui->sw_dhcp->setButtonStyle(ImageSwitch::ButtonStyle_1); + //ui->sw_dhcp->setButtonStyle(ImageSwitch::ButtonStyle_1); model_addr = new NetCfgTableModel(this); @@ -161,7 +161,10 @@ networkCfgDialog::networkCfgDialog(QWidget* parent) : { applyData(); }); - + connect(ui->btn_group->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [=]() + { + reject(); + }); ui->tabWidget->setCurrentIndex(0); } diff --git a/src/networkcfgdialog.ui b/src/networkcfgdialog.ui index ba8d388..672d896 100644 --- a/src/networkcfgdialog.ui +++ b/src/networkcfgdialog.ui @@ -40,12 +40,17 @@ padding: 2px; QTabBar::tab:selected, QTabBar::tab:hover { border-bottom:5px solid #4a88c7; -background: #505050;} +background: #505050;} + +QLineEdit#led_inface{font-size:15px;border: 0px;} + + 10 + @@ -62,7 +67,7 @@ background: #505050;} true - 2 + 0 @@ -435,13 +440,6 @@ background: #505050;} - - - - Qt::Horizontal - - - @@ -456,6 +454,13 @@ background: #505050;} + + + + Qt::Horizontal + + + diff --git a/src/res.qrc b/src/res.qrc index d4469e0..3038e07 100644 --- a/src/res.qrc +++ b/src/res.qrc @@ -37,5 +37,6 @@ icons/imageswitch/btncheckon2.png icons/imageswitch/btncheckon3.png stylesheet/Dark.qss + stylesheet/Dark2.qss diff --git a/src/stylesheet/Dark2.qss b/src/stylesheet/Dark2.qss new file mode 100644 index 0000000..64ca969 --- /dev/null +++ b/src/stylesheet/Dark2.qss @@ -0,0 +1 @@ + /*------1.silver-->grey--------------------------*/ *{background-color:#3c3c3c; color:#fcfcfc;margin:0;font-size:16px;} QTabBar::tab { height:60px; width:300px; font-size: 25px; background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #333333, stop: 1.0 #505050); border: 2px solid #505050; border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; min-width: 8ex; padding: 2px; } QTabBar::tab:selected, QTabBar::tab:hover { border-top:5px solid #4a88c7; background: #505050;} QTabWidget::pane{margin:0} QPlainTextEdit{border:0px} QGroupBox{border:0px} QLabel{color:#fcfcfc; font-weight:bold; font-size:16px;} QLineEdit{min-height:36px;max-height:36px; border:1px solid #505050;color:grey;border-radius:3px;} QLineEdit:enabled{background-color: #505050;color:#fcfcfc;} QDateEdit{min-height:36px;max-height:36px; border:1px solid #505050;color:grey;border-radius:3px;} QDateEdit:enabled{background-color: #505050;color:#fcfcfc;} QTextEdit{ border:1px solid #505050;color:grey;border-radius:3px;} QTextEdit:enabled{background-color: #505050;color:#fcfcfc;} QComboBox{text-align:center;min-height:36px;max-height:36px; border:1px solid #505050} QComboBox:enabled{background-color: #505050} QComboBox::drop-down{width:20px} QComboBox QAbstractItemView{min-width:120px;} QComboBox QAbstractItemView::item {min-height:60px;max-height:60px; border:1px solid white;} QWidget QToolButton{border:none;border-radius:10%;font-size:26px; font-weight:Bold;padding:5px;} QWidget QToolButton:disabled{color:#606060 } QWidget QToolButton:hover{background:#505050;} QWidget QToolButton:checked{border:5px solid darkorange;padding:0px;} QPushButton{border:1px solid #505050 ;padding-left:50px;padding-right:50px; border-radius:5px; min-height:28px; max-height:28px; background:#4c5052} QListView{border:none;margin:5px; font-weight:bold} QListView::item{background:#4c5052;min-height:30px; border:1px solid #505050; border-radius:5px} QListView::item:selected{background:#365880;font-weight:bold;color:#fcfcfc;} /*QListView::item:selected{ background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ABAFE5, stop: 1 #8588B2); border:1px solid #505050; }*/ QHeaderView::section{background-color:#595959;min-height:50px;max-height:50px;font-weight:Bold; font-size:16px; border:1px solid #323232;} QHeaderView::section:horizontal{border-bottom: 1px solid rgb(0,170,255);} QHeaderView::section:vertical{min-height:36px;max-height:36px;} QTableView{border:none;alternate-background-color: #595959;selection-color:#fcfcfc;selection-background-color:#0078d8} /*-----------Specific---------------*/ QLabel#sliderPickerLabel{color:grey;padding:0;background:#505050;font-weight:normal;font-size:50px;} QWidget#topbarWidget{min-height:36px;max-height:36px;} QWidget#contentWidget{border-top:1px solid #505050;} QWidget#commandWidget{min-height:123px;max-height:123px;border-top:1px solid #505050; border-bottom:1px solid #323232;} QLabel#logo{min-width:30px;max-width:30px} QLabel#company{min-width:150px;max-width:150px; } QLabel#systemMsgBar{min-width:500px;} QLabel#warn{color:#CCCC00;background:transparent;font-size:20px;} QWidget QWidget#statusBarWidget{min-width:300px;} QToolButton#btn_main{border:2px solid #0078d8;border-radius:10%;font-size:26px; font-weight:Bold;padding:5px;} QWidget#editcmdWidget{min-height:83px;max-height:83px;} QWidget#verSpaceLine{ border-right:1px solid #0078d8;} QWidget#topBottomLine{ border-top:2px solid #0078d8;border-bottom:2px solid #0078d8;background:transparent} /*-----蒙版Dialog-----*/ QDialog QWidget#innerWidget{ background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0.0 darkgray, stop: 0.5 lightgray, stop: 1.0 darkgray); border-radius:20px;border:5px solid #0078d8; } QDialog#MessageDialog QWidget QWidget{ background:transparent;color:#3078d8} QDialog#MessageDialog QWidget QWidget QLabel{ font-size:30px} #spacer_1, #spacer_2{min-width:2px;max-width:2px;margin-top:6px;margin-bottom:6px;border-right:1px solid #0078d8;} /*-----FormDialog-----*/ QPushButton#btnOK{background:#365880; font-weight:bold} QDialog#formDialog{border:3px solid grey; border-radius:8px} QWidget#slider_one{border:1px solid #505050; border-radius:8px} QWidget#formWidget QLabel#endline{border-bottom:1px solid grey} QWidget#formWidget{font-size:30px;} QLabel#title{font-size:30px; border-bottom:1px solid #3078d8 } QWidget#edit_patient{min-width:300px;max-width:300px;} QToolButton#sexBtn{min-width:120px;max-width:120px;font-size:20px;padding:2px;} QToolButton#sexBtn:disabled{color:grey} QWidget#sexpanelwidget{border:1px solid #505050;} QWidget#sexpanelwidget:enabled{background-color: #505050;} QToolButton#sexBtn:checked{border:2px solid darkorange;padding:0px;} \ No newline at end of file diff --git a/src/systemsettingform.cpp b/src/systemsettingform.cpp index 80dbe1b..c8ce749 100644 --- a/src/systemsettingform.cpp +++ b/src/systemsettingform.cpp @@ -31,7 +31,7 @@ systemSettingForm::systemSettingForm(QWidget* parent) : ui->btnAccept->setIcon(QIcon(":/icons/selected.png")); ui->btnAccept->setIconSize(QSize(50, 50)); ui->swt_verify->setChecked(true); - ui->swt_verify->setButtonStyle(ImageSwitch::ButtonStyle_1); + //ui->swt_verify->setButtonStyle(ImageSwitch::ButtonStyle_1); diff --git a/src/translations/zh_CN.ts b/src/translations/zh_CN.ts index c70e553..6cd174c 100644 --- a/src/translations/zh_CN.ts +++ b/src/translations/zh_CN.ts @@ -561,48 +561,48 @@ ScanFormWidget - + Protocol 扫描协议 - + LEFT 左侧 - + RIGHT 右侧 - + Refresh 空扫 - + Preview 预扫 - + Stop 停止 - + Scan 扫描 - + Preview Parameters 预览参数 - - + + some settings parameters @@ -610,7 +610,7 @@ parameters XXX - + Scan Parameters 扫描参数 @@ -680,81 +680,81 @@ parameters networkCfgDialog - + Network Settings 网络配置 - + Address IP配置 - + IP Address IP地址 - + Network Setting 网络配置 - + Dynamic Address 动态地址 - + Dev 设备 - + Subnet Mask 子网掩码 - + Additional Address 额外地址 - - + + Add 新增 - - + + Edit 编辑 - - + + Delete 删除 - + Routing 路由配置 - + Default IPv4 Gateway 默认网关 - + Routing Table 路由表 - + Result 结果 diff --git a/src/translations/zh_CN.ts.bak b/src/translations/zh_CN.ts.bak index c70e553..6cd174c 100644 --- a/src/translations/zh_CN.ts.bak +++ b/src/translations/zh_CN.ts.bak @@ -561,48 +561,48 @@ ScanFormWidget - + Protocol 扫描协议 - + LEFT 左侧 - + RIGHT 右侧 - + Refresh 空扫 - + Preview 预扫 - + Stop 停止 - + Scan 扫描 - + Preview Parameters 预览参数 - - + + some settings parameters @@ -610,7 +610,7 @@ parameters XXX - + Scan Parameters 扫描参数 @@ -680,81 +680,81 @@ parameters networkCfgDialog - + Network Settings 网络配置 - + Address IP配置 - + IP Address IP地址 - + Network Setting 网络配置 - + Dynamic Address 动态地址 - + Dev 设备 - + Subnet Mask 子网掩码 - + Additional Address 额外地址 - - + + Add 新增 - - + + Edit 编辑 - - + + Delete 删除 - + Routing 路由配置 - + Default IPv4 Gateway 默认网关 - + Routing Table 路由表 - + Result 结果