[vlc-commits] Qt4: use a spin box rather than a slider if there is no min/max

Rémi Denis-Courmont git at videolan.org
Sat Oct 1 21:33:50 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct  1 22:33:22 2011 +0300| [88aa00e43e275fb55f3d4eff32f77c686c1ffddc] | committer: Rémi Denis-Courmont

Qt4: use a spin box rather than a slider if there is no min/max

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=88aa00e43e275fb55f3d4eff32f77c686c1ffddc
---

 modules/gui/qt4/components/extended_panels.cpp |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index fbe523a..b83dac6 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -757,6 +757,7 @@ void ExtV4l2::Refresh( void )
                         hlayout->addWidget( combobox );
                     }
                     else
+                    if( (i_type & VLC_VAR_HASMIN) && (i_type & VLC_VAR_HASMAX) )
                     {
                         QSlider *slider = new QSlider( box );
                         slider->setObjectName( qfu( psz_var ) );
@@ -777,6 +778,17 @@ void ExtV4l2::Refresh( void )
                                  ValueChange( int ) );
                         hlayout->addWidget( slider );
                     }
+                    else
+                    {
+                        QSpinBox *spinBox = new QSpinBox( box );
+                        spinBox->setObjectName( qfu( psz_var ) );
+                        spinBox->setMinimum( INT_MIN );
+                        spinBox->setMaximum( INT_MAX );
+                        spinBox->setValue( i_val );
+                        CONNECT( spinBox, valueChanged( int ), this,
+                                 ValueChange( int ) );
+                        hlayout->addWidget( spinBox );
+                    }
                     layout->addLayout( hlayout );
                     break;
                 }



More information about the vlc-commits mailing list