Commit 0469e383 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

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

parent 88a0b150
...@@ -282,6 +282,7 @@ QSize VideoWidget::sizeHint() const ...@@ -282,6 +282,7 @@ QSize VideoWidget::sizeHint() const
#define ICON_SIZE 128 #define ICON_SIZE 128
#define MAX_BG_SIZE 400 #define MAX_BG_SIZE 400
#define MIN_BG_SIZE 128 #define MIN_BG_SIZE 128
#define MARGIN 5
BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
:QWidget( NULL ), p_intf( _p_i ) :QWidget( NULL ), p_intf( _p_i )
...@@ -298,7 +299,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) ...@@ -298,7 +299,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
/* A cone in the middle */ /* A cone in the middle */
label = new QLabel; label = new QLabel;
label->setMargin( 5 ); label->setMargin( MARGIN );
label->setAlignment( Qt::AlignCenter ); label->setAlignment( Qt::AlignCenter );
/* Init the cone art */ /* Init the cone art */
...@@ -317,7 +318,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) ...@@ -317,7 +318,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
void BackgroundWidget::resizeEvent( QResizeEvent * event ) void BackgroundWidget::resizeEvent( QResizeEvent * event )
{ {
if( event->size().height() <= MIN_BG_SIZE ) if( event->size().height() <= MIN_BG_SIZE + MARGIN * 2 + 2 )
label->hide(); label->hide();
else else
label->show(); label->show();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment