|
|
|
|
@ -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)));
|
|
|
|
|
|