Commit 860c2a92 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Hide markers when position become incoherent

parent 8b6ffb9c
......@@ -265,6 +265,15 @@ qint64 PreviewRuler::getMarker( Marker m ) const
return ( m == START ? m_markerStart : m_markerStop );
}
void
PreviewRuler::hideMarker( Marker m )
{
if ( m == START )
m_markerStart = -1;
else if ( m == STOP )
m_markerStop = -1;
}
void PreviewRuler::clear()
{
m_markerStart = MARKER_DEFAULT;
......
......@@ -46,9 +46,10 @@ public:
PreviewRuler( QWidget* parent = 0 );
virtual ~PreviewRuler() { }
void setRenderer( GenericRenderer* renderer );
void setMarker( Marker m );
qint64 getMarker( Marker m ) const;
void setRenderer( GenericRenderer* renderer );
void setMarker( Marker m );
void hideMarker( Marker m );
qint64 getMarker( Marker m ) const;
public slots:
void setFrame( qint64 frame, bool broadcastEvent = false );
......
......@@ -170,11 +170,24 @@ void PreviewWidget::stop()
void PreviewWidget::markerStartClicked()
{
m_ui->rulerWidget->setMarker( PreviewRuler::START );
qint64 beg = m_ui->rulerWidget->getMarker( PreviewRuler::START );
qint64 end = m_ui->rulerWidget->getMarker( PreviewRuler::STOP );
if ( beg > end )
{
m_ui->rulerWidget->hideMarker( PreviewRuler::STOP );;
}
}
void PreviewWidget::markerStopClicked()
{
m_ui->rulerWidget->setMarker( PreviewRuler::STOP );
qint64 beg = m_ui->rulerWidget->getMarker( PreviewRuler::START );
qint64 end = m_ui->rulerWidget->getMarker( PreviewRuler::STOP );
if ( beg > end )
{
m_ui->rulerWidget->hideMarker( PreviewRuler::START );;
}
}
void PreviewWidget::createNewClipFromMarkers()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment