style improve

This commit is contained in:
xueyan hu
2021-12-24 16:06:03 +08:00
parent d36fc118f8
commit 32500542af
10 changed files with 102 additions and 74 deletions

View File

@@ -7,11 +7,7 @@
ImageSwitch::ImageSwitch(QWidget* parent) : QWidget(parent)
{
isChecked = false;
buttonStyle = ButtonStyle_2;
imgOffFile = ":/image/imageswitch/btncheckoff2.png";
imgOnFile = ":/image/imageswitch/btncheckon2.png";
imgFile = imgOffFile;
setButtonStyle(ButtonStyle_1);
}
void ImageSwitch::mousePressEvent(QMouseEvent*)
@@ -48,12 +44,12 @@ ImageSwitch::ButtonStyle ImageSwitch::getButtonStyle() const
QSize ImageSwitch::sizeHint() const
{
return QSize(87, 28);
return QSize(220, 64);
}
QSize ImageSwitch::minimumSizeHint() const
{
return QSize(87, 28);
return sizeHint();
}
void ImageSwitch::setChecked(bool isChecked)
@@ -73,17 +69,17 @@ void ImageSwitch::setButtonStyle(const ImageSwitch::ButtonStyle& buttonStyle)
if (buttonStyle == ButtonStyle_1) {
imgOffFile = ":/icons/imageswitch/btncheckoff1.png";
imgOnFile = ":/icons/imageswitch/btncheckon1.png";
this->resize(87, 28);
this->resize(sizeHint());
}
else if (buttonStyle == ButtonStyle_2) {
imgOffFile = ":/icons/imageswitch/btncheckoff2.png";
imgOnFile = ":/icons/imageswitch/btncheckon2.png";
this->resize(87, 28);
this->resize(sizeHint());
}
else if (buttonStyle == ButtonStyle_3) {
imgOffFile = ":/icons/imageswitch/btncheckoff3.png";
imgOnFile = ":/icons/imageswitch/btncheckon3.png";
this->resize(96, 38);
this->resize(sizeHint());
}
imgFile = isChecked ? imgOnFile : imgOffFile;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>863</width>
<height>678</height>
<width>819</width>
<height>662</height>
</rect>
</property>
<property name="sizePolicy">
@@ -20,18 +20,19 @@
<string>Network Settings</string>
</property>
<property name="styleSheet">
<string notr="true">QTabWidget::pane {
<string notr="true">
QTabWidget::pane {
border-top: 0px;
}
QTabBar::tab {
font-size:30px;
height:50px;
width:150px;
font-size:25px;
height:40px;
width:120px;
background:#4d4d4d;
border: 0px;
border-top-left-radius: 20%;
border-top-right-radius: 20%;
border-top-left-radius: 0%;
border-top-right-radius: 0%;
border-bottom-left-radius:0%;
border-bottom-right-radius:0%;
padding: 2px;
@@ -45,13 +46,23 @@ background: #505050;}</string>
<item>
<widget class="QWidget" name="formWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="title">
<property name="text">
<string>Network Setting</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="currentIndex">
<number>1</number>
<number>2</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@@ -420,16 +431,17 @@ background: #505050;}</string>
<attribute name="title">
<string>Result</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QWidget" name="widget_3" native="true">
<property name="geometry">
<rect>
<x>30</x>
<y>20</y>
<width>781</width>
<height>541</height>
</rect>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
</widget>
</item>
<item>
<widget class="QPlainTextEdit" name="output">
<property name="enabled">
@@ -439,6 +451,8 @@ background: #505050;}</string>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>

View File

@@ -600,6 +600,10 @@ parameters
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Network Setting</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>systemSettingForm</name>

View File

@@ -600,6 +600,10 @@ parameters
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Network Setting</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>systemSettingForm</name>

Binary file not shown.

View File

@@ -680,76 +680,81 @@ parameters
<context>
<name>networkCfgDialog</name>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="361"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="383"/>
<source>Network Settings</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="371"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="394"/>
<source>Address</source>
<translation>IP配置</translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="362"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="385"/>
<location filename="../network/networkcfgdialog.cpp" line="34"/>
<source>IP Address</source>
<translation>IP地址</translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="363"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="384"/>
<source>Network Setting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="386"/>
<source>Dynamic Address</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="364"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="387"/>
<source>Dev</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="366"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="389"/>
<source>Subnet Mask</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="367"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="390"/>
<source>Additional Address</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="368"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="375"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="391"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="398"/>
<source>Add</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="369"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="376"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="392"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="399"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="370"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="377"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="393"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="400"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="378"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="401"/>
<source>Routing</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="373"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="396"/>
<source>Default IPv4 Gateway</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="374"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="397"/>
<source>Routing Table</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="379"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="402"/>
<source>Result</source>
<translation></translation>
</message>

View File

@@ -680,76 +680,81 @@ parameters
<context>
<name>networkCfgDialog</name>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="361"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="383"/>
<source>Network Settings</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="371"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="394"/>
<source>Address</source>
<translation>IP配置</translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="362"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="385"/>
<location filename="../network/networkcfgdialog.cpp" line="34"/>
<source>IP Address</source>
<translation>IP地址</translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="363"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="384"/>
<source>Network Setting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="386"/>
<source>Dynamic Address</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="364"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="387"/>
<source>Dev</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="366"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="389"/>
<source>Subnet Mask</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="367"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="390"/>
<source>Additional Address</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="368"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="375"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="391"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="398"/>
<source>Add</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="369"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="376"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="392"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="399"/>
<source>Edit</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="370"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="377"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="393"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="400"/>
<source>Delete</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="378"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="401"/>
<source>Routing</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="373"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="396"/>
<source>Default IPv4 Gateway</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="374"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="397"/>
<source>Routing Table</source>
<translation></translation>
</message>
<message>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="379"/>
<location filename="../../out/build/x64-Debug/ui_networkcfgdialog.h" line="402"/>
<source>Result</source>
<translation></translation>
</message>