]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/util/customwidgets.hpp
Qt: respect font sizes
[vlc] / modules / gui / qt4 / util / customwidgets.hpp
index 2ee76e8ece8c3286dd44453c89585ce561d12627..266d954493855a0864b83517d4c7baad0ab21b14 100644 (file)
@@ -3,7 +3,7 @@
  ****************************************************************************
  * Copyright (C) 2006 the VideoLAN team
  * Copyright (C) 2004 Daniel Molkentin <molkentin@kde.org>
- * $Id: qvlcframe.hpp 16283 2006-08-17 18:16:09Z zorglub $
+ * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
  * The "ClickLineEdit" control is based on code by  Daniel Molkentin
@@ -28,6 +28,8 @@
 #define _CUSTOMWIDGETS_H_
 
 #include <QLineEdit>
+#include <QPushButton>
+#include <QLabel>
 
 /**
   This class provides a QLineEdit which contains a greyed-out hinting
@@ -56,47 +58,61 @@ private:
     bool mDrawClickMsg;
 };
 
-/*****************************************************************
- * Custom views
- *****************************************************************/
-#include <QMouseEvent>
-#include <QTreeView>
-#include <QCursor>
-#include <QPoint>
-#include <QModelIndex>
-
-class QVLCTreeView : public QTreeView
+class QVLCFramelessButton : public QPushButton
 {
     Q_OBJECT;
 public:
-    QVLCTreeView( QWidget * parent ) : QTreeView( parent )
-    {
-    };
-    virtual ~QVLCTreeView()   {};
+    QVLCFramelessButton( QWidget *parent = NULL );
+    QSize sizeHint() const;
+protected:
+    virtual void paintEvent( QPaintEvent * event );
+};
+
+class SearchLineEdit : public QLineEdit
+{
+    Q_OBJECT
+public:
+    SearchLineEdit( QWidget *parent = NULL );
+
+private:
+    void resizeEvent ( QResizeEvent * event );
+    void focusInEvent( QFocusEvent *event );
+    void focusOutEvent( QFocusEvent *event );
+    void paintEvent( QPaintEvent *event );
+    void setMessageVisible( bool on );
+    QVLCFramelessButton   *clearButton;
+    bool message;
+    QLabel *msg;
+
+public slots:
+    void clear();
 
-    void mouseReleaseEvent(QMouseEvent* e )
-    {
-        if( e->button() & Qt::RightButton )
-        {
-            emit rightClicked( indexAt( QPoint( e->x(), e->y() ) ),
-                               QCursor::pos() );
-        }
-    }
-signals:
-    void rightClicked( QModelIndex, QPoint  );
+private slots:
+    void updateText( const QString& );
 };
 
+class QVLCElidingLabel : public QLabel
+{
+public:
+    QVLCElidingLabel( const QString &s = QString(),
+                      Qt::TextElideMode mode = Qt::ElideRight,
+                      QWidget * parent = NULL );
+    void setElideMode( Qt::TextElideMode );
+private:
+    void paintEvent( QPaintEvent * event );
+    Qt::TextElideMode elideMode;
+};
+
+/* VLC Key/Wheel hotkeys interactions */
+
 class QKeyEvent;
 class QWheelEvent;
+class QInputEvent;
+
 int qtKeyModifiersToVLC( QInputEvent* e );
 int qtEventToVLCKey( QKeyEvent *e );
 int qtWheelEventToVLCKey( QWheelEvent *e );
 QString VLCKeyToString( int val );
 
-#include "qt4.hpp"
-#include <vlc/vlc.h>
-class QComboBox;
-void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf,
-                        QComboBox *combo, QWidget *parent = 0 );
-
 #endif
+