]> git.sesse.net Git - vlc/commitdiff
Disable focus on buttons to avoid "space" to be catched by a button on focus.
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 18 Sep 2008 03:21:02 +0000 (20:21 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 18 Sep 2008 04:27:36 +0000 (21:27 -0700)
Moreover, use a function instead of a macro (like in 0.9-branch)
Partially cherry picked from commit 73ab1cd94773956e463009088bf5f477cec1ae80

modules/gui/qt4/components/interface_widgets.cpp

index c63a3ac35b48909951e655c92b28cfc4b24ccf5a..34224f35dffaecbe2bc33a2ce54cd6783921dfb3 100644 (file)
@@ -306,10 +306,13 @@ void VisualSelector::next()
  * TEH controls
  **********************************************************************/
 
-#define setupSmallButton( aButton ){  \
-    aButton->setMaximumSize( QSize( 26, 26 ) ); \
-    aButton->setMinimumSize( QSize( 26, 26 ) ); \
-    aButton->setIconSize( QSize( 20, 20 ) ); }
+static void setupSmallButton( QPushButton *aButton )
+{
+    aButton->setMaximumSize( QSize( 26, 26 ) );
+    aButton->setMinimumSize( QSize( 26, 26 ) );
+    aButton->setIconSize( QSize( 20, 20 ) );
+    aButton->setFocusPolicy( Qt::NoFocus );
+}
 
 /* init static variables in advanced controls */
 mtime_t AdvControlsWidget::timeA = 0;
@@ -518,12 +521,14 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
     slowerButton = new QToolButton;
     slowerButton->setAutoRaise( true );
     slowerButton->setMaximumSize( QSize( 26, 20 ) );
+    slowerButton->setFocusPolicy( Qt::NoFocus );
 
     BUTTON_SET_ACT( slowerButton, "-", qtr( "Slower" ), slower() );
 
     fasterButton = new QToolButton;
     fasterButton->setAutoRaise( true );
     fasterButton->setMaximumSize( QSize( 26, 20 ) );
+    fasterButton->setFocusPolicy( Qt::NoFocus );
 
     BUTTON_SET_ACT( fasterButton, "+", qtr( "Faster" ), faster() );
 
@@ -634,7 +639,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
     playButton->setMaximumSize( QSize( 36, 36 ) );
     playButton->setMinimumSize( QSize( 36, 36 ) );
     playButton->setIconSize( QSize( 30, 30 ) );
-
+    playButton->setFocusPolicy( Qt::NoFocus );
 
     /** Prev + Stop + Next Block **/
     controlButLayout = new QHBoxLayout;