Merge branch 'feature/UI-20260528' of http://1.92.128.200:3000/YXS/nmWTAI-Platform into feature/UI-20260528

feature/UI-20260528
lvjunjie 1 week ago
commit 840c2914d9

@ -9,8 +9,7 @@ nmGUIDrawerWidget::nmGUIDrawerWidget(const QString &sTitle, QWidget *parent)
void nmGUIDrawerWidget::initUI()
{
// 标题栏
// 标题栏
// 创建标题
QWidget *headerWidget = new QWidget(this);
headerWidget->setObjectName("headerWidget");
m_pHeaderLayout = new QHBoxLayout(headerWidget);
@ -18,20 +17,23 @@ void nmGUIDrawerWidget::initUI()
m_pToggleButton = new QToolButton(this);
m_pToggleButton->setArrowType(Qt::DownArrow);
m_pToggleButton->setStyleSheet("QToolButton { background: transparent; border: none; }"); // 设置按钮透明背景
m_pTitleLabel = new QLabel(m_sTitle, this);
m_pTitleLabel->setStyleSheet("font-weight: bold;");
m_pTitleLabel->setStyleSheet("font-weight: bold; background: transparent;"); // 设置标题透明背景
m_pHeaderLayout->addWidget(m_pToggleButton);
m_pHeaderLayout->addWidget(m_pTitleLabel);
m_pHeaderLayout->addStretch();
// 内容区域
// 创建内容
m_pWidgetContent = new QWidget(this);
m_pWidgetContent->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
m_pWidgetContent->setVisible(true); // 默认展开
m_pWidgetContent->setVisible(true); // 默认展开
m_pWidgetContent->setObjectName("contentWidget"); // 设置objectName以便样式表定位
m_pWidgetContent->setAutoFillBackground(true); // 确保内容区白底稳定
// 主布局
// 创建布局
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setSpacing(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
@ -51,7 +53,7 @@ void nmGUIDrawerWidget::setExpanded(bool expanded)
if (expanded != m_bExpanded) {
m_bExpanded = expanded;
m_pToggleButton->setArrowType(expanded ? Qt::DownArrow : Qt::RightArrow);
m_pWidgetContent->setVisible(expanded); // 直接显示/隐藏内容区域
m_pWidgetContent->setVisible(expanded);
emit expansionChanged(expanded);
}
}
@ -65,12 +67,11 @@ void nmGUIDrawerWidget::setStyleSheet(const QString &style)
{
QString customStyle =
"#headerWidget {"
" background-color: rgb(173, 216, 230);" // 设置标题栏背景颜色为浅蓝色
" background-color: rgb(173, 216, 230);" // 设置标题栏背景颜色为浅蓝色
" width: 100%;"
"}"
"QToolButton {"
"}"
"QLabel {"
"#contentWidget {"
" background-color: white;" // 设置内容区背景颜色为白色
"}";
QWidget::setStyleSheet(customStyle); // 调用类方法
QWidget::setStyleSheet(customStyle); // 调用类方法
}

@ -58,9 +58,8 @@ void nmWxChartWidget::paintEvent(QPaintEvent *event)
width() - marginLeft - marginRight,
height() - marginTop - marginBottom);
// 设置背景 - 灰色背景匹配目标样式
painter.fillRect(rect(), QColor(240, 240, 240));
painter.fillRect(chartRect, QColor(248, 248, 248));
painter.fillRect(rect(), Qt::white);
painter.fillRect(chartRect, Qt::white);
// 绘制网格、坐标轴、线条和点
drawGrid(painter);

@ -105,12 +105,8 @@ void nmWxPressFlowChartWidget::paintEvent(QPaintEvent *event)
void nmWxPressFlowChartWidget::drawBackground(QPainter& painter)
{
// 绘制整体背景
painter.fillRect(rect(), QColor(240, 240, 240));
// 绘制绘图区域背景
painter.fillRect(m_plotArea, QColor(248, 248, 248));
painter.fillRect(rect(), Qt::white);
painter.fillRect(m_plotArea, Qt::white);
}
double nmWxPressFlowChartWidget::calculateTickInterval(double range, bool isYAxisForPressure)

@ -109,12 +109,15 @@ void nmWxReservoirPropertiesDlg::initUI() {
QWidget* nmWxReservoirPropertiesDlg::initParametersUI() {
QWidget* container = new QWidget;
container->setStyleSheet("background-color: white;"); // 设置容器白底
QVBoxLayout* containerLayout = new QVBoxLayout(container);
QScrollArea* scrollArea = new QScrollArea;
scrollArea->setWidgetResizable(true);
scrollArea->setStyleSheet("QScrollArea { background-color: white; }"); // 设置滚动区域白底
QWidget* scrollContent = new QWidget;
scrollContent->setStyleSheet("background-color: white;"); // 设置滚动内容白底
QVBoxLayout* contentLayout = new QVBoxLayout(scrollContent);
//dimensionlessCheckbox = new QCheckBox(tr("Use dimensionless parameters (M,D)"), container);

@ -538,34 +538,6 @@ void nmWxTimeDependentSkin::initUI()
m_pRightInsertBtn->setEnabled(true);
m_pRightDeleteBtn->setEnabled(true);
// 为右侧按钮也设置样式
QString buttonStyle =
"QPushButton {"
" border: 1px solid #ccc;"
" background-color: #f8f8f8;"
" border-radius: 3px;"
" padding: 2px;"
"}"
"QPushButton:hover {"
" background-color: #e8e8e8;"
" border-color: #999;"
"}"
"QPushButton:pressed {"
" background-color: #d8d8d8;"
"}"
"QPushButton:disabled {"
" background-color: #f0f0f0;"
" color: #aaa;"
" border-color: #ddd;"
"}";
m_pRightAddBtn->setStyleSheet(buttonStyle);
m_pRightInsertBtn->setStyleSheet(buttonStyle);
m_pRightDeleteBtn->setStyleSheet(buttonStyle);
m_pOkBtn->setStyleSheet(buttonStyle);
m_pCancelBtn->setStyleSheet(buttonStyle);
// 在初始化时创建图表模式按钮但不显示
createChartModeBtn();

Loading…
Cancel
Save