feat: 优化结果回放控制条布局

- 增加属性标签并补充中文翻译
- 收紧属性和时间下拉框的宽度范围
- 移除时间下拉框的扩展布局策略
- 使用固定间距区分属性设置与播放控制
- 将剩余空间统一保留在控制条右侧
feature/nmNum-postprocessing-view-20260910
lh 2 weeks ago
parent 9705fec0b7
commit a8e7d8a79e

Binary file not shown.

@ -2840,6 +2840,7 @@ Reason: %1</source>
</context>
<context>
<name>nmWxPebiResultControlBar</name>
<message><source>Property</source><translation>属性</translation></message>
<message><source>Display property</source><translation>显示属性</translation></message>
<message><source>Color settings</source><translation>颜色设置</translation></message>
<message><source>First frame</source><translation>第一帧</translation></message>

@ -10,6 +10,7 @@
#include <QCoreApplication>
#include <QHBoxLayout>
#include <QIcon>
#include <QLabel>
#include <QSize>
#include <QSizePolicy>
#include <QToolButton>
@ -17,6 +18,14 @@
namespace {
const int PROPERTY_COMBO_MINIMUM_WIDTH = 110;
const int PROPERTY_COMBO_MAXIMUM_WIDTH = 140;
const int TIME_COMBO_MINIMUM_WIDTH = 160;
const int TIME_COMBO_MAXIMUM_WIDTH = 240;
const int CONTROL_GROUP_GAP = 8;
// Qt 4 按 20 个“X”字符估算 SizeHint,常用字体下约为 190px。
const int TIME_COMBO_MINIMUM_CONTENT_LENGTH = 20;
QString resultControlIconPath(const QString& sFileName)
{
const QString sApplicationDir = QCoreApplication::applicationDirPath();
@ -306,8 +315,12 @@ void nmWxPebiResultControlBar::createUi()
pLayout->setContentsMargins(4, 3, 4, 3);
pLayout->setSpacing(4);
QLabel* pPropertyLabel = new QLabel(tr("Property"), this);
pPropertyLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
m_pPropertyCombo = new QComboBox(this);
m_pPropertyCombo->setMinimumWidth(140);
m_pPropertyCombo->setMinimumWidth(PROPERTY_COMBO_MINIMUM_WIDTH);
m_pPropertyCombo->setMaximumWidth(PROPERTY_COMBO_MAXIMUM_WIDTH);
m_pPropertyCombo->setFixedHeight(24);
m_pPropertyCombo->setSizePolicy(
QSizePolicy::Preferred, QSizePolicy::Fixed);
@ -324,10 +337,15 @@ void nmWxPebiResultControlBar::createUi()
this, QString::fromLatin1("NmPreviousStep.png"),
tr("Previous frame"));
m_pTimeCombo = new QComboBox(this);
m_pTimeCombo->setMinimumWidth(150);
m_pTimeCombo->setMinimumWidth(TIME_COMBO_MINIMUM_WIDTH);
m_pTimeCombo->setMaximumWidth(TIME_COMBO_MAXIMUM_WIDTH);
m_pTimeCombo->setMinimumContentsLength(
TIME_COMBO_MINIMUM_CONTENT_LENGTH);
m_pTimeCombo->setSizeAdjustPolicy(
QComboBox::AdjustToMinimumContentsLengthWithIcon);
m_pTimeCombo->setFixedHeight(24);
m_pTimeCombo->setSizePolicy(
QSizePolicy::Expanding, QSizePolicy::Fixed);
QSizePolicy::Preferred, QSizePolicy::Fixed);
m_pTimeCombo->setToolTip(tr("Result time"));
m_pNextButton = createControlButton(
this, QString::fromLatin1("NmNextStep.png"),
@ -342,15 +360,18 @@ void nmWxPebiResultControlBar::createUi()
this, QString::fromLatin1("NmAnimationSettings.png"),
tr("Animation settings"));
pLayout->addWidget(pPropertyLabel, 0, Qt::AlignVCenter);
pLayout->addWidget(m_pPropertyCombo);
pLayout->addWidget(m_pColorSettingsButton);
pLayout->addSpacing(CONTROL_GROUP_GAP);
pLayout->addWidget(m_pFirstButton);
pLayout->addWidget(m_pPreviousButton);
pLayout->addWidget(m_pTimeCombo, 1);
pLayout->addWidget(m_pTimeCombo);
pLayout->addWidget(m_pNextButton);
pLayout->addWidget(m_pLastButton);
pLayout->addWidget(m_pPlayPauseButton);
pLayout->addWidget(m_pSettingsButton);
pLayout->addStretch(1);
connect(m_pPropertyCombo, SIGNAL(currentIndexChanged(int)),
this, SLOT(onPropertyIndexChanged(int)));

Loading…
Cancel
Save