#define _CUSTOMWIDGETS_H_
#include <QLineEdit>
+#include <QPushButton>
/**
This class provides a QLineEdit which contains a greyed-out hinting
bool mDrawClickMsg;
};
+class QVLCFramelessButton : public QPushButton
+{
+ Q_OBJECT;
+public:
+ QVLCFramelessButton( QWidget *parent = NULL );
+ QSize sizeHint() const;
+protected:
+ virtual void paintEvent( QPaintEvent * event );
+};
-/*****************************************************************
- * Custom views
- *****************************************************************/
-#include <QMouseEvent>
-#include <QTreeView>
-#include <QCursor>
-#include <QPoint>
-#include <QModelIndex>
+class QLabel;
-class QVLCTreeView : public QTreeView
+class SearchLineEdit : public QLineEdit
{
- Q_OBJECT;
+ Q_OBJECT
public:
- QVLCTreeView( QWidget * parent ) : QTreeView( parent )
- {
- };
- virtual ~QVLCTreeView() {};
+ 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;
- void mouseReleaseEvent( QMouseEvent* e )
- {
- if( e->button() & Qt::RightButton )
- {
- emit rightClicked( indexAt( QPoint( e->x(), e->y() ) ),
- QCursor::pos() );
- }
- QTreeView::mouseReleaseEvent( e );
- }
+public slots:
+ void clear();
- void mousePressEvent( QMouseEvent* e )
- {
- if( e->button() & Qt::LeftButton )
- {
- if( !indexAt( QPoint( e->x(), e->y() ) ).isValid() )
- clearSelection();
- }
- QTreeView::mousePressEvent( e );
- }
-signals:
- void rightClicked( QModelIndex, QPoint );
+private slots:
+ void updateText( const QString& );
};
+/* 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 );
#endif
+