feat(nmSubWxs): 更新结果视图回放控制栏图标

- 替换帧导航、播放停止和动画设置图标
- 色带设置按钮改用固定图标
- 移除控制栏色带动态图标刷新逻辑
feature/nmNum-postprocessing-view-20260910
lh 2 weeks ago
parent d59006ee9b
commit 9705fec0b7

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

@ -71,8 +71,6 @@ private slots:
void refreshFromController(); void refreshFromController();
/** @brief 将控制器错误转发给后续组合窗口。 */ /** @brief 将控制器错误转发给后续组合窗口。 */
void forwardOperationFailure(const QString& sError); void forwardOperationFailure(const QString& sError);
/** @brief 从 Scene 当前设置刷新颜色按钮的色带预览。 */
void refreshColorPreview();
private: private:
Q_DISABLE_COPY(nmWxPebiResultControlBar) Q_DISABLE_COPY(nmWxPebiResultControlBar)
@ -95,7 +93,7 @@ private:
nmPebiResultSceneController* m_pSceneController; nmPebiResultSceneController* m_pSceneController;
/** @brief 属性选择框,条目数据保存稳定英文属性 ID。 */ /** @brief 属性选择框,条目数据保存稳定英文属性 ID。 */
QComboBox* m_pPropertyCombo; QComboBox* m_pPropertyCombo;
/** @brief 显示当前色带预览并打开颜色设置对话框。 */ /** @brief 使用固定色带图标打开颜色设置对话框。 */
QToolButton* m_pColorSettingsButton; QToolButton* m_pColorSettingsButton;
/** @brief 跳到第 0 帧的图标按钮。 */ /** @brief 跳到第 0 帧的图标按钮。 */
QToolButton* m_pFirstButton; QToolButton* m_pFirstButton;
@ -107,7 +105,7 @@ private:
QToolButton* m_pNextButton; QToolButton* m_pNextButton;
/** @brief 跳到末帧的图标按钮。 */ /** @brief 跳到末帧的图标按钮。 */
QToolButton* m_pLastButton; QToolButton* m_pLastButton;
/** @brief 根据回放状态切换播放和暂停图标。 */ /** @brief 根据回放状态切换开始和停止图形。 */
QToolButton* m_pPlayPauseButton; QToolButton* m_pPlayPauseButton;
/** @brief 打开速度与循环设置对话框。 */ /** @brief 打开速度与循环设置对话框。 */
QToolButton* m_pSettingsButton; QToolButton* m_pSettingsButton;

@ -5,7 +5,6 @@
#include "nmPebiResultSceneController.h" #include "nmPebiResultSceneController.h"
#include "nmWxPebiResultAnimationSettingsDlg.h" #include "nmWxPebiResultAnimationSettingsDlg.h"
#include "nmWxPebiResultColorScaleSettingsDlg.h" #include "nmWxPebiResultColorScaleSettingsDlg.h"
#include "nmVTKColorMapCatalog.h"
#include <QComboBox> #include <QComboBox>
#include <QCoreApplication> #include <QCoreApplication>
@ -131,14 +130,11 @@ void nmWxPebiResultControlBar::onColorSettingsClicked()
m_pPlaybackController->pause(); m_pPlaybackController->pause();
nmWxPebiResultColorScaleSettingsDlg oDialog( nmWxPebiResultColorScaleSettingsDlg oDialog(
m_pSceneController, this); m_pSceneController, this);
connect(&oDialog, SIGNAL(displaySettingsApplied()),
this, SLOT(refreshColorPreview()));
connect(&oDialog, SIGNAL(displaySettingsApplied()), connect(&oDialog, SIGNAL(displaySettingsApplied()),
this, SIGNAL(operationSucceeded())); this, SIGNAL(operationSucceeded()));
connect(&oDialog, SIGNAL(operationFailed(QString)), connect(&oDialog, SIGNAL(operationFailed(QString)),
this, SLOT(forwardOperationFailure(QString))); this, SLOT(forwardOperationFailure(QString)));
oDialog.exec(); oDialog.exec();
refreshColorPreview();
} }
void nmWxPebiResultControlBar::onFirstFrameClicked() void nmWxPebiResultControlBar::onFirstFrameClicked()
@ -207,7 +203,6 @@ void nmWxPebiResultControlBar::refreshFromController()
m_listDisplayedPropertyIds.clear(); m_listDisplayedPropertyIds.clear();
m_pPropertyCombo->setEnabled(false); m_pPropertyCombo->setEnabled(false);
m_pColorSettingsButton->setEnabled(false); m_pColorSettingsButton->setEnabled(false);
m_pColorSettingsButton->setIcon(QIcon());
m_pFirstButton->setEnabled(false); m_pFirstButton->setEnabled(false);
m_pPreviousButton->setEnabled(false); m_pPreviousButton->setEnabled(false);
m_pNextButton->setEnabled(false); m_pNextButton->setEnabled(false);
@ -215,7 +210,7 @@ void nmWxPebiResultControlBar::refreshFromController()
m_pPlayPauseButton->setEnabled(false); m_pPlayPauseButton->setEnabled(false);
m_pSettingsButton->setEnabled(false); m_pSettingsButton->setEnabled(false);
m_pPlayPauseButton->setIcon(QIcon(resultControlIconPath( m_pPlayPauseButton->setIcon(QIcon(resultControlIconPath(
QString::fromLatin1("Continue.png")))); QString::fromLatin1("NmStartAnimation.png"))));
m_pPlayPauseButton->setToolTip(tr("Play")); m_pPlayPauseButton->setToolTip(tr("Play"));
return; return;
} }
@ -252,7 +247,6 @@ void nmWxPebiResultControlBar::refreshFromController()
m_pPropertyCombo->blockSignals(bPropertyBlocked); m_pPropertyCombo->blockSignals(bPropertyBlocked);
m_pPropertyCombo->setEnabled(true); m_pPropertyCombo->setEnabled(true);
m_pColorSettingsButton->setEnabled(true); m_pColorSettingsButton->setEnabled(true);
refreshColorPreview();
const bool bTimeDependent = const bool bTimeDependent =
m_pPlaybackController->isPropertyTimeDependent(sPropertyId); m_pPlaybackController->isPropertyTimeDependent(sPropertyId);
@ -294,8 +288,8 @@ void nmWxPebiResultControlBar::refreshFromController()
const bool bPlaying = m_pPlaybackController->isPlaying(); const bool bPlaying = m_pPlaybackController->isPlaying();
m_pPlayPauseButton->setIcon(QIcon(resultControlIconPath( m_pPlayPauseButton->setIcon(QIcon(resultControlIconPath(
bPlaying ? QString::fromLatin1("Pause.png") bPlaying ? QString::fromLatin1("NmStopAnimation.png")
: QString::fromLatin1("Continue.png")))); : QString::fromLatin1("NmStartAnimation.png"))));
m_pPlayPauseButton->setToolTip( m_pPlayPauseButton->setToolTip(
bPlaying ? tr("Pause") : tr("Play")); bPlaying ? tr("Pause") : tr("Play"));
} }
@ -306,19 +300,6 @@ void nmWxPebiResultControlBar::forwardOperationFailure(
emit operationFailed(sError); emit operationFailed(sError);
} }
void nmWxPebiResultControlBar::refreshColorPreview()
{
nmPebiResultDisplaySettings oSettings;
if(m_pSceneController == nullptr ||
!m_pSceneController->getCurrentDisplaySettings(oSettings)) {
m_pColorSettingsButton->setIcon(QIcon());
return;
}
m_pColorSettingsButton->setIcon(QIcon(
nmVTKColorMapCatalog::createPreviewPixmap(
oSettings.m_sColorMapId, QSize(44, 14))));
}
void nmWxPebiResultControlBar::createUi() void nmWxPebiResultControlBar::createUi()
{ {
QHBoxLayout* pLayout = new QHBoxLayout(this); QHBoxLayout* pLayout = new QHBoxLayout(this);
@ -333,14 +314,15 @@ void nmWxPebiResultControlBar::createUi()
m_pPropertyCombo->setToolTip(tr("Display property")); m_pPropertyCombo->setToolTip(tr("Display property"));
m_pColorSettingsButton = createControlButton( m_pColorSettingsButton = createControlButton(
this, QString(), tr("Color settings")); this, QString::fromLatin1("NmColorScaleSettings.png"),
m_pColorSettingsButton->setFixedSize(52, 24); tr("Color settings"));
m_pColorSettingsButton->setIconSize(QSize(44, 14));
m_pFirstButton = createControlButton( m_pFirstButton = createControlButton(
this, QString::fromLatin1("First.png"), tr("First frame")); this, QString::fromLatin1("NmFirstStep.png"),
tr("First frame"));
m_pPreviousButton = createControlButton( m_pPreviousButton = createControlButton(
this, QString::fromLatin1("Prev.png"), tr("Previous frame")); this, QString::fromLatin1("NmPreviousStep.png"),
tr("Previous frame"));
m_pTimeCombo = new QComboBox(this); m_pTimeCombo = new QComboBox(this);
m_pTimeCombo->setMinimumWidth(150); m_pTimeCombo->setMinimumWidth(150);
m_pTimeCombo->setFixedHeight(24); m_pTimeCombo->setFixedHeight(24);
@ -348,13 +330,16 @@ void nmWxPebiResultControlBar::createUi()
QSizePolicy::Expanding, QSizePolicy::Fixed); QSizePolicy::Expanding, QSizePolicy::Fixed);
m_pTimeCombo->setToolTip(tr("Result time")); m_pTimeCombo->setToolTip(tr("Result time"));
m_pNextButton = createControlButton( m_pNextButton = createControlButton(
this, QString::fromLatin1("Next.png"), tr("Next frame")); this, QString::fromLatin1("NmNextStep.png"),
tr("Next frame"));
m_pLastButton = createControlButton( m_pLastButton = createControlButton(
this, QString::fromLatin1("Last.png"), tr("Last frame")); this, QString::fromLatin1("NmLastStep.png"),
tr("Last frame"));
m_pPlayPauseButton = createControlButton( m_pPlayPauseButton = createControlButton(
this, QString::fromLatin1("Continue.png"), tr("Play")); this, QString::fromLatin1("NmStartAnimation.png"),
tr("Play"));
m_pSettingsButton = createControlButton( m_pSettingsButton = createControlButton(
this, QString::fromLatin1("SysTools.png"), this, QString::fromLatin1("NmAnimationSettings.png"),
tr("Animation settings")); tr("Animation settings"));
pLayout->addWidget(m_pPropertyCombo); pLayout->addWidget(m_pPropertyCombo);

Loading…
Cancel
Save