[vlc-commits] commit: Qt: bgWidget, add the margin to trigger the hide of the label when resizing ( Jean-Baptiste Kempf )

git at videolan.org git at videolan.org
Tue Mar 9 12:41:23 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Mar  5 00:44:13 2010 +0100| [0469e38363d5eef08efc0732948541e65772516e] | committer: Jean-Baptiste Kempf 

Qt: bgWidget, add the margin to trigger the hide of the label when resizing

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

 modules/gui/qt4/components/interface_widgets.cpp |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index cd1fb80..fc86853 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -282,6 +282,7 @@ QSize VideoWidget::sizeHint() const
 #define ICON_SIZE 128
 #define MAX_BG_SIZE 400
 #define MIN_BG_SIZE 128
+#define MARGIN 5
 
 BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
                  :QWidget( NULL ), p_intf( _p_i )
@@ -298,7 +299,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
 
     /* A cone in the middle */
     label = new QLabel;
-    label->setMargin( 5 );
+    label->setMargin( MARGIN );
     label->setAlignment( Qt::AlignCenter );
 
     /* Init the cone art */
@@ -317,7 +318,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
 
 void BackgroundWidget::resizeEvent( QResizeEvent * event )
 {
-    if( event->size().height() <= MIN_BG_SIZE )
+    if( event->size().height() <= MIN_BG_SIZE + MARGIN * 2 + 2 )
         label->hide();
     else
         label->show();



More information about the vlc-commits mailing list