radioapp/radiowidgets/src/radiofrequencystrip.cpp
changeset 32 189d20c34778
parent 28 075425b8d9a4
child 33 11b6825f0862
equal deleted inserted replaced
28:075425b8d9a4 32:189d20c34778
   334 {
   334 {
   335     mManualSeekMode = !mManualSeekMode;
   335     mManualSeekMode = !mManualSeekMode;
   336     emit manualSeekChanged( mManualSeekMode );
   336     emit manualSeekChanged( mManualSeekMode );
   337 
   337 
   338     if ( mManualSeekMode ) {
   338     if ( mManualSeekMode ) {
       
   339         grabMouse();
   339         hideButtons();
   340         hideButtons();
   340         mManualSeekTimerId = startTimer( MANUALSEEK_SIGNAL_DELAY );
   341         mManualSeekTimerId = startTimer( MANUALSEEK_SIGNAL_DELAY );
   341     } else {
   342     } else {
       
   343         ungrabMouse();
   342         showButtons();
   344         showButtons();
   343         killTimer( mManualSeekTimerId );
   345         killTimer( mManualSeekTimerId );
   344         mManualSeekTimerId = 0;
   346         mManualSeekTimerId = 0;
   345     }
   347     }
   346 }
   348 }
   387 }
   389 }
   388 
   390 
   389 /*!
   391 /*!
   390  * \reimp
   392  * \reimp
   391  */
   393  */
   392 void RadioFrequencyStrip::scrollPosChanged( QPointF newPosition )
   394 void RadioFrequencyStrip::scrollPosChanged()
   393 {
   395 {
   394     Q_UNUSED( newPosition );
       
   395 
       
   396     if ( mManualSeekMode ) {
   396     if ( mManualSeekMode ) {
   397         const int pos = selectorPos();
   397         const int pos = selectorPos();
   398         const uint frequency = mPositions.value( pos );
   398         const uint frequency = mPositions.value( pos );
   399         if ( frequency > 0 ) {
   399         if ( frequency > 0 ) {
   400             mFrequency = mPositions.value( pos );
   400             mFrequency = mPositions.value( pos );
   406 /*!
   406 /*!
   407  * \reimp
   407  * \reimp
   408  */
   408  */
   409 void RadioFrequencyStrip::resizeEvent ( QGraphicsSceneResizeEvent* event )
   409 void RadioFrequencyStrip::resizeEvent ( QGraphicsSceneResizeEvent* event )
   410 {
   410 {
   411     LOG_METHOD_ENTER;
   411     LOG_METHOD;
   412     RadioStripBase::resizeEvent( event );
   412     RadioStripBase::resizeEvent( event );
   413 
   413 
   414     const qreal height = event->newSize().height();
   414     const qreal height = event->newSize().height();
   415     const qreal width = event->newSize().width();
   415     const qreal width = event->newSize().width();
   416 
   416 
   455 void RadioFrequencyStrip::mousePressEvent( QGraphicsSceneMouseEvent* event )
   455 void RadioFrequencyStrip::mousePressEvent( QGraphicsSceneMouseEvent* event )
   456 {
   456 {
   457     RadioStripBase::mousePressEvent( event );
   457     RadioStripBase::mousePressEvent( event );
   458 
   458 
   459     mManualSeekTimer->stop();
   459     mManualSeekTimer->stop();
   460     if ( !mManualSeekMode ) {
   460     if ( mManualSeekMode ) {
       
   461         const bool insideStrip = rect().contains( event->pos() );
       
   462         if ( !insideStrip ) {
       
   463             toggleManualSeek();
       
   464         }
       
   465     } else {
   461         mManualSeekTimer->start( MANUALSEEK_START_TIMEOUT );
   466         mManualSeekTimer->start( MANUALSEEK_START_TIMEOUT );
   462     }
   467     }
   463 }
   468 }
   464 
   469 
   465 /*!
   470 /*!