]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.cpp
Implement color change for colorthres and extract filters. Fix dial for rotate filter.
[vlc] / modules / gui / qt4 / components / interface_widgets.cpp
index c0fb11fa77b6135192667485f563e0e208996d41..58e14ea278f261576d1184d53e3be0b3b1493690 100644 (file)
@@ -27,8 +27,7 @@
 #include "main_interface.hpp"
 #include "input_manager.hpp"
 
-#include "pixmaps/art.xpm"
-#include <vlc/vout.h>
+#include <vlc_vout.h>
 
 #include <QLabel>
 #include <QSpacerItem>
@@ -36,6 +35,8 @@
 #include <QPushButton>
 #include <QHBoxLayout>
 #include <QMenu>
+#include <QPalette>
+#include <QResizeEvent>
 
 #define ICON_SIZE 128
 
@@ -78,7 +79,6 @@ VideoWidget::~VideoWidget()
 
 QSize VideoWidget::sizeHint() const
 {
-    fprintf( stderr, "Video Size %ix%i\n", widgetSize.width(), widgetSize.height() );
     return widgetSize;
 }
 
@@ -91,7 +91,7 @@ void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
         return NULL;
     }
     p_vout = p_nvout;
-    setMinimumSize( 1,1 );
+    setMinimumSize( 16, 16 );
     return (void*)winId();
 }
 
@@ -132,7 +132,6 @@ BackgroundWidget::~BackgroundWidget()
 
 QSize BackgroundWidget::sizeHint() const
 {
-    fprintf( stderr, "BG %ix%i\n", widgetSize.width(), widgetSize.height() );
     return widgetSize;
 }
 
@@ -287,11 +286,14 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
     selector->setMaximumWidth( 130 );
     left->addWidget( selector );
 
-    QLabel *art = new QLabel( "" );
+    art = new QLabel( "" );
+    art->setMinimumHeight( 128 );
+    art->setMinimumWidth( 128 );
     art->setMaximumHeight( 128 );
     art->setMaximumWidth( 128 );
     art->setScaledContents( true );
-    art->setPixmap( QPixmap( art_xpm ) ); //":/vlc128.png" ) );
+
+    art->setPixmap( QPixmap( ":/noart.png" ) );
     left->addWidget( art );
 
     playlist_item_t *p_root = playlist_GetPreferredNode( THEPL,
@@ -302,6 +304,13 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
 
     CONNECT( selector, activated( int ), rightPanel, setRoot( int ) );
 
+    CONNECT( qobject_cast<StandardPLPanel *>(rightPanel)->model,
+             artSet( QString ) , this, setArt( QString ) );
+    /* Forward removal requests from the selector to the main panel */
+    CONNECT( qobject_cast<PLSelector *>(selector)->model,
+             shouldRemove( int ),
+             qobject_cast<StandardPLPanel *>(rightPanel), removeItem(int) );
+
     connect( selector, SIGNAL(activated( int )),
              this, SIGNAL( rootChanged( int ) ) );
     emit rootChanged( p_root->i_id );
@@ -312,6 +321,15 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_intf ) :
     setLayout( layout );
 }
 
+void PlaylistWidget::setArt( QString url )
+{
+    if( url.isNull() )
+        art->setPixmap( QPixmap( ":/noart.png" ) );
+    else if( prevArt != url )
+        art->setPixmap( QPixmap( url ) );
+    prevArt = url;
+}
+
 PlaylistWidget::~PlaylistWidget()
 {
 }