chore: update ui

This commit is contained in:
x-tools-author 2024-03-27 09:31:44 +08:00
parent 38779672b9
commit 3d62b116b3
6 changed files with 631 additions and 439 deletions

View File

@ -136,11 +136,12 @@ static void xToolsInitHdpi()
static void xToolsInitAppStyle()
{
qInfo() << "The supported application styles are:"
<< qPrintable(QStyleFactory::keys().join(QChar(',')));
const QStringList keys = QStyleFactory::keys();
qInfo() << "The supported application styles are:" << qPrintable(keys.join(QChar(',')));
const QString style = xToolsSettings::instance()->appStyle();
if (QStyleFactory::keys().contains(style)) {
qInfo() << "The current application style is:" << qPrintable(style);
qInfo() << style;
if (keys.contains(style)) {
qInfo() << "The current style of application is:" << qPrintable(style);
QApplication::setStyle(QStyleFactory::create(style));
}
}

View File

@ -81,7 +81,7 @@ QString xToolsSettings::appStyle()
#ifdef X_TOOLS_DEFAULT_APP_STYLE
return value(mSettingsKey.appStyle, X_TOOLS_DEFAULT_APP_STYLE).toString();
#else
return QString("Funcsion");
return QString("Fusion");
#endif
}

View File

@ -515,26 +515,26 @@ void xToolsModbusStudioUi::OnDeviceTypeChanged()
// Hide ui component first then show ui component,
// or the window will be resize to the max size of default.
if (isSerial) {
ui->networkGroupBox->setHidden(true);
ui->serialPortGroupBox->setHidden(false);
ui->widgetNetworkSettings->setHidden(true);
ui->widgetSerialPortSettings->setHidden(false);
} else {
ui->serialPortGroupBox->setHidden(true);
ui->networkGroupBox->setHidden(false);
ui->widgetSerialPortSettings->setHidden(true);
ui->widgetNetworkSettings->setHidden(false);
}
if (isClient) {
ui->console_->setVisible(true);
ui->serverGroupBox->setHidden(true);
ui->widgetServerParameters->setHidden(true);
ui->registersGroupBox->setHidden(true);
ui->clientOperationsGroupBox->setHidden(false);
ui->widgetClientParameters->setHidden(false);
ui->clientCustomCommandGroupBox->setHidden(false);
ui->clientRegistersGroupBox->setHidden(false);
} else {
ui->console_->setVisible(false);
ui->clientCustomCommandGroupBox->setHidden(true);
ui->clientRegistersGroupBox->setHidden(true);
ui->clientOperationsGroupBox->setHidden(true);
ui->serverGroupBox->setHidden(false);
ui->widgetClientParameters->setHidden(true);
ui->widgetServerParameters->setHidden(false);
ui->registersGroupBox->setHidden(false);
}
@ -946,11 +946,11 @@ void xToolsModbusStudioUi::UpdateUiState(bool connected)
ui->device_list_->setEnabled(!connected);
ui->cloese_button_->setEnabled(connected);
ui->open_button_->setEnabled(!connected);
ui->networkGroupBox->setEnabled(!connected);
ui->serialPortGroupBox->setEnabled(!connected);
ui->widgetNetworkSettings->setEnabled(!connected);
ui->widgetSerialPortSettings->setEnabled(!connected);
#if 0
ui->clientGroupBox->setEnabled(!connected);
ui->serverGroupBox->setEnabled(!connected);
ui->widgetServerParameters->setEnabled(!connected);
#endif
}

File diff suppressed because it is too large Load Diff

View File

@ -58,6 +58,7 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
@ -109,6 +110,7 @@
<property name="font">
<font>
<pointsize>9</pointsize>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
@ -257,6 +259,7 @@
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<italic>true</italic>
<bold>true</bold>
</font>
</property>

View File

@ -37,6 +37,7 @@ DEFINES += X_TOOLS_VERSION=\"\\\"6.0.0\\\"\"
DEFINES += X_TOOLS_EDITION=\"\\\"Beta\\\"\"
DEFINES += X_TOOLS_AUTHOR=\"\\\"x-tools-author\\\"\"
DEFINES += X_TOOLS_AUTHOR_EMAIL=\"\\\"x-tools@outlook.com\\\"\"
DEFINES += X_TOOLS_DEFAULT_APP_STYLE=\"\\\"Fusion\\\"\"
DEFINES += X_TOOLS_GITHUB_REPOSITORY_URL=\"\\\"https://github.com/x-tools-author/x-tools\\\"\"
DEFINES += X_TOOLS_GITEE_REPOSITORY_URL=\"\\\"https://gitee.com/x-tools-author/x-tools\\\"\"