[vlc-devel] commit: Change the toolbar layout to make it smaller and have the advanced buttons on the same line as the other ones . (Jean-Baptiste Kempf )

git version control git at videolan.org
Tue Aug 12 18:54:30 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Aug 12 09:55:19 2008 -0700| [51da2ea33a3a0c204b4928b41ebc1274e4812d8c] | committer: Jean-Baptiste Kempf 

Change the toolbar layout to make it smaller and have the advanced buttons on the same line as the other ones.

If you think it was better before, please scream NOW.

I am just bored of being insulted for the work I do/not do. All the decisions may not be optimal, and I am always open to discussion. Insults by mail is NOT OK.

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

 modules/gui/qt4/components/interface_widgets.cpp |   42 ++++++++++++----------
 modules/gui/qt4/util/input_slider.cpp            |    5 +--
 modules/gui/qt4/util/input_slider.hpp            |    5 ++-
 3 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 6dd508a..0c711bc 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -674,34 +674,38 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
         controlLayout->setSpacing( 0 );
         controlLayout->setLayoutMargins( 7, 5, 7, 3, 6 );
 
-        controlLayout->addWidget( slider, 0, 1, 1, 16 );
+        controlLayout->addWidget( slider, 0, 1, 1, 18 );
         controlLayout->addWidget( slowerButton, 0, 0 );
-        controlLayout->addWidget( fasterButton, 0, 17 );
+        controlLayout->addWidget( fasterButton, 0, 19 );
 
-        controlLayout->addWidget( advControls, 1, 3, 2, 4, Qt::AlignBottom );
-        controlLayout->addWidget( discFrame, 1, 10, 2, 3, Qt::AlignBottom );
-        controlLayout->addWidget( telexFrame, 1, 10, 2, 4, Qt::AlignBottom );
+        controlLayout->addWidget( discFrame, 1, 8, 2, 3, Qt::AlignBottom );
+        controlLayout->addWidget( telexFrame, 1, 8, 2, 5, Qt::AlignBottom );
 
-        controlLayout->addWidget( playButton, 2, 0, 2, 2 );
-        controlLayout->setColumnMinimumWidth( 2, 20 );
+        controlLayout->addWidget( playButton, 2, 0, 2, 2, Qt::AlignBottom );
+        controlLayout->setColumnMinimumWidth( 2, 10 );
         controlLayout->setColumnStretch( 2, 0 );
 
-        controlLayout->addLayout( controlButLayout, 3, 3, 1, 3 );
-        controlLayout->setColumnMinimumWidth( 7, 20 );
+        controlLayout->addLayout( controlButLayout, 3, 3, 1, 3, Qt::AlignBottom );
+        /* Column 6 is unused */
+        controlLayout->setColumnStretch( 6, 0 );
         controlLayout->setColumnStretch( 7, 0 );
-        controlLayout->setColumnStretch( 8, 0 );
-        controlLayout->setColumnStretch( 9, 0 );
+        controlLayout->setColumnMinimumWidth( 7, 10 );
 
-        controlLayout->addWidget( fullscreenButton, 3, 10, Qt::AlignBottom );
-        controlLayout->addWidget( playlistButton, 3, 11, Qt::AlignBottom );
-        controlLayout->addWidget( extSettingsButton, 3, 12, Qt::AlignBottom );
+        controlLayout->addWidget( fullscreenButton, 3, 8, Qt::AlignBottom );
+        controlLayout->addWidget( playlistButton, 3, 9, Qt::AlignBottom );
+        controlLayout->addWidget( extSettingsButton, 3, 10, Qt::AlignBottom );
+        controlLayout->setColumnStretch( 11, 0 ); /* telex alignment */
 
-        controlLayout->setColumnStretch( 13, 0 );
-        controlLayout->setColumnMinimumWidth( 13, 24 );
-        controlLayout->setColumnStretch( 14, 5 );
+        controlLayout->setColumnStretch( 12, 0 );
+        controlLayout->setColumnMinimumWidth( 12, 10 );
 
-        controlLayout->addWidget( volMuteLabel, 3, 15, Qt::AlignBottom );
-        controlLayout->addWidget( volumeSlider, 2, 16, 2 , 2, Qt::AlignBottom );
+        controlLayout->addWidget( advControls, 3, 13, 1, 3, Qt::AlignBottom );
+
+        controlLayout->setColumnStretch( 16, 10 );
+        controlLayout->setColumnMinimumWidth( 16, 10 );
+
+        controlLayout->addWidget( volMuteLabel, 3, 17, Qt::AlignBottom );
+        controlLayout->addWidget( volumeSlider, 3, 18, 1 , 2, Qt::AlignBottom );
     }
 
     updateInput();
diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp
index a6ea509..2cf6102 100644
--- a/modules/gui/qt4/util/input_slider.cpp
+++ b/modules/gui/qt4/util/input_slider.cpp
@@ -120,9 +120,6 @@ SoundSlider::SoundSlider( QWidget *_parent, int _i_step, bool b_hard,
                           char *psz_colors )
                         : QAbstractSlider( _parent )
 {
-    paddingL = 3;
-    paddingR = 2;
-
     f_step = ( _i_step * 100 ) / AOUT_VOLUME_MAX ;
     setRange( SOUNDMIN, b_hard ? (2 * SOUNDMAX) : SOUNDMAX  );
     setMouseTracking( true );
@@ -202,7 +199,7 @@ void SoundSlider::mouseMoveEvent( QMouseEvent *event )
     if( b_sliding )
     {
         QRect rect( paddingL - 15,    -1,
-                    WLENGTH + 15 * 2, WHEIGHT + 5 );
+                    WLENGTH  , WHEIGHT + 5 );
         if( !rect.contains( event->pos() ) )
         { /* We are outside */
             if ( !b_outside )
diff --git a/modules/gui/qt4/util/input_slider.hpp b/modules/gui/qt4/util/input_slider.hpp
index d282499..39b5066 100644
--- a/modules/gui/qt4/util/input_slider.hpp
+++ b/modules/gui/qt4/util/input_slider.hpp
@@ -63,9 +63,10 @@ class SoundSlider : public QAbstractSlider
 public:
     SoundSlider( QWidget *_parent, int _i_step, bool b_softamp, char * );
     virtual ~SoundSlider() {};
+
 protected:
-    int paddingL;
-    int paddingR;
+    const static int paddingL = 3;
+    const static int paddingR = 2;
     virtual void paintEvent(QPaintEvent *);
     virtual void wheelEvent( QWheelEvent *event );
     virtual void mousePressEvent( QMouseEvent * );




More information about the vlc-devel mailing list