small visual improvements to the timeline's timecode label
This commit is contained in:
@@ -37,6 +37,7 @@ SliderBase::SliderBase(Mode mode, QWidget *parent) :
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
|
||||
|
||||
label_ = new SliderLabel(this);
|
||||
|
||||
addWidget(label_);
|
||||
|
||||
editor_ = new SliderLineEdit(this);
|
||||
@@ -72,6 +73,11 @@ void SliderBase::SetRequireValidInput(bool e)
|
||||
require_valid_input_ = e;
|
||||
}
|
||||
|
||||
void SliderBase::SetAlignment(Qt::Alignment alignment)
|
||||
{
|
||||
label_->setAlignment(alignment);
|
||||
}
|
||||
|
||||
const QVariant &SliderBase::Value()
|
||||
{
|
||||
if (dragged_) {
|
||||
|
||||
@@ -42,6 +42,8 @@ public:
|
||||
|
||||
void SetRequireValidInput(bool e);
|
||||
|
||||
void SetAlignment(Qt::Alignment alignment);
|
||||
|
||||
signals:
|
||||
void ValueChanged(QVariant v);
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ TimelineWidget::TimelineWidget(QWidget *parent) :
|
||||
vert_layout->addLayout(ruler_and_time_layout);
|
||||
|
||||
timecode_label_ = new TimeSlider();
|
||||
timecode_label_->SetAlignment(Qt::AlignCenter);
|
||||
timecode_label_->setVisible(false);
|
||||
connect(timecode_label_, SIGNAL(ValueChanged(int64_t)), this, SIGNAL(TimeChanged(const int64_t&)));
|
||||
connect(timecode_label_, SIGNAL(ValueChanged(int64_t)), this, SLOT(UpdateInternalTime(const int64_t&)));
|
||||
ruler_and_time_layout->addWidget(timecode_label_);
|
||||
@@ -138,6 +140,8 @@ void TimelineWidget::SetTimebase(const rational &timebase)
|
||||
ruler_->SetTimebase(timebase);
|
||||
timecode_label_->SetTimebase(timebase);
|
||||
|
||||
timecode_label_->setVisible(!timebase.isNull());
|
||||
|
||||
foreach (TimelineAndTrackView* view, views_) {
|
||||
view->view()->SetTimebase(timebase);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user