]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.hpp
Qt: more of the same simplifications and warnings
[vlc] / modules / gui / qt4 / components / interface_widgets.hpp
index 85cbe24ffaa18ddcaaf87b465102a7420310f60e..a2ce18f0916568aa5b97a6182b61efcd0308ce02 100644 (file)
@@ -35,6 +35,8 @@
 
 #include "components/controller.hpp"
 #include "components/controller_widget.hpp"
+#include "dialogs_provider.hpp"
+#include "components/info_panels.hpp"
 
 #include <QWidget>
 #include <QFrame>
@@ -46,24 +48,19 @@ class QPixmap;
 class QHBoxLayout;
 class QMenu;
 class QSlider;
-class ReparentableWidget;
 
 /******************** Video Widget ****************/
 class VideoWidget : public QFrame
 {
     Q_OBJECT
-friend class ReparentableWidget;
-
 public:
     VideoWidget( intf_thread_t * );
     virtual ~VideoWidget();
 
-    WId request( int *, int *,
-                 unsigned int *, unsigned int *, bool );
+    WId request( int *, int *, unsigned int *, unsigned int *, bool );
     void  release( void );
     int   control( void *, int, va_list );
-
-    virtual QSize sizeHint() const;
+    void  sync( void );
 
 protected:
     virtual QPaintEngine *paintEngine() const
@@ -74,16 +71,13 @@ protected:
 private:
     intf_thread_t *p_intf;
 
-    QSize videoSize;
-    QWidget *reparentable;
+    QWidget *stable;
     QLayout *layout;
-
 signals:
-    void keyPressed( QKeyEvent * );
+    void sizeChanged( int, int );
 
 public slots:
     void SetSizing( unsigned int, unsigned int );
-    void SetFullScreen( bool );
 };
 
 /******************** Background Widget ****************/
@@ -92,13 +86,17 @@ class BackgroundWidget : public QWidget
     Q_OBJECT
 public:
     BackgroundWidget( intf_thread_t * );
-
+    void setExpandstoHeight( bool b_expand ) { b_expandPixmap = b_expand; }
+    void setWithArt( bool b_withart_ ) { b_withart = b_withart_; };
 private:
-    QLabel *label;
-    virtual void contextMenuEvent( QContextMenuEvent *event );
     intf_thread_t *p_intf;
-    virtual void resizeEvent( QResizeEvent * event );
-
+    QString pixmapUrl;
+    bool b_expandPixmap;
+    bool b_withart;
+    virtual void contextMenuEvent( QContextMenuEvent *event );
+protected:
+    void paintEvent( QPaintEvent *e );
+    static const int MARGIN = 5;
 public slots:
     void toggle(){ TOGGLEV( this ); }
     void updateArt( const QString& );
@@ -142,9 +140,11 @@ private:
     bool b_remainingTime;
     int cachedLength;
     QTimer *bufTimer;
-    float bufVal;
+
     bool buffering;
     bool showBuffering;
+    float bufVal;
+
     char psz_length[MSTRTIME_MAX_SIZE];
     char psz_time[MSTRTIME_MAX_SIZE];
     void toggleTimeDisplay();
@@ -176,6 +176,7 @@ private slots:
 private:
     intf_thread_t *p_intf;
     QMenu *speedControlMenu;
+    QString tooltipStringPattern;
     SpeedControlWidget *speedControl;
 };
 
@@ -189,6 +190,7 @@ public:
 private:
     intf_thread_t *p_intf;
     QSlider *speedSlider;
+    int lastValue;
 
 public slots:
     void activateOnState();
@@ -205,6 +207,15 @@ public:
     CoverArtLabel( QWidget *parent, intf_thread_t * );
     virtual ~CoverArtLabel();
 
+protected:
+    virtual void mouseDoubleClickEvent( QMouseEvent *event )
+    {
+        if( qobject_cast<MetaPanel *>(this->window()) == NULL )
+        {
+            THEDP->mediaInfoDialog();
+        }
+        event->accept();
+    }
 private:
     intf_thread_t *p_intf;