]> git.sesse.net Git - vlc/commitdiff
skins2: parametrize how long fullscreen controller stays on screen
authorErwan Tulou <erwan10@videolan.org>
Wed, 27 Jun 2012 08:54:40 +0000 (10:54 +0200)
committerErwan Tulou <erwan10@videolan.org>
Wed, 27 Jun 2012 16:52:48 +0000 (18:52 +0200)
Use the mouse-hide-timeout parameter for that purpose, as
the other interfaces do in vlc.

this fixes #7017

modules/gui/skins2/src/fsc_window.cpp
modules/gui/skins2/src/fsc_window.hpp

index ed368af0aa15f25a14c2956e0b9a3b4c3653a752..e8eb60b8cc2e86c2958dacdcf5877cc2bcf96628 100644 (file)
@@ -28,7 +28,7 @@
 
 /**
  * Fading out is computed in the following way:
- *    - a timer is fired with a given period (FSC_DELAY)
+ *    - a timer is fired with a given period (m_delay)
  *    - a total of FSC_COUNT transitions are processed before
  *      hiding the controller
  *    - transparency is changed in the following way :
@@ -57,6 +57,11 @@ FscWindow::FscWindow( intf_thread_t *pIntf, int left, int top,
     // opacity overridden by user
     m_opacity = 255 * var_InheritFloat( getIntf(), "qt-fs-opacity" );
 
+    // fullscreen-controller timeout overridden by user
+    m_delay = var_InheritInteger( getIntf(), "mouse-hide-timeout" ) / FSC_COUNT;
+    if( m_delay <= 0 )
+        m_delay = FSC_DELAY;
+
     // register Fsc
     VoutManager::instance( getIntf())->registerFSC( this );
 }
@@ -85,7 +90,7 @@ void FscWindow::onMouseMoved( )
             m_pTimer->stop();
             m_count = FSC_COUNT;
             setOpacity( m_opacity );
-            m_pTimer->start( FSC_DELAY, false );
+            m_pTimer->start( m_delay, false );
         }
     }
 }
@@ -130,7 +135,7 @@ void FscWindow::processEvent( EvtLeave &rEvtLeave )
 
     m_count = FSC_COUNT;
     setOpacity( m_opacity );
-    m_pTimer->start( FSC_DELAY, false );
+    m_pTimer->start( m_delay, false );
 
     TopWindow::processEvent( rEvtLeave  );
 }
@@ -156,7 +161,7 @@ void FscWindow::innerShow()
 
     m_count = FSC_COUNT;
     setOpacity( m_opacity );
-    m_pTimer->start( FSC_DELAY, false );
+    m_pTimer->start( m_delay, false );
 }
 
 
index 92244900484fdf05cec0343bf312114663a349b8..67f9b981ffba7b1c2d4be44561de5ef98430e2f7 100644 (file)
@@ -67,6 +67,8 @@ private:
     int m_count;
     /// opacity set by user
     int m_opacity;
+    /// delay set by user
+    int m_delay;
 
     /// Callback for the timer
     DEFINE_CALLBACK( FscWindow, FscHide )