Radium Engine  1.5.20
Loading...
Searching...
No Matches
TimelineSlider.cpp
1#include <Gui/Timeline/TimelineSlider.hpp>
2
3#include <QMouseEvent>
4
5namespace Ra::Gui {
6
7TimelineSlider::TimelineSlider( QWidget* parent ) : QLabel( parent ) {}
8
9void TimelineSlider::mousePressEvent( QMouseEvent* event ) {
10 if ( event->button() == Qt::LeftButton ) {
11 m_clicked = true;
12 emit slide( event->x() );
13 }
14}
15
16void TimelineSlider::mouseReleaseEvent( QMouseEvent* event ) {
17 if ( event->button() == Qt::LeftButton ) {
18 setStyleSheet( "background-color: gray" );
19
20 m_clicked = false;
21 }
22}
23
24void TimelineSlider::mouseMoveEvent( QMouseEvent* event ) {
25 if ( m_clicked ) { emit slide( event->x() ); }
26}
27
28} // namespace Ra::Gui