#define _CUSTOMWIDGETS_H_
#include <QLineEdit>
+#include <QPushButton>
/**
This class provides a QLineEdit which contains a greyed-out hinting
bool mDrawClickMsg;
};
-class QToolButton;
-class SearchLineEdit : public QFrame
+class QVLCFramelessButton : public QPushButton
{
- Q_OBJECT
+ Q_OBJECT;
public:
- SearchLineEdit( QWidget *parent );
-
-private:
- ClickLineEdit *searchLine;
- QToolButton *clearButton;
-
-private slots:
- void updateText( const QString& );
-
-signals:
- void textChanged( const QString& );
+ 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;
-/**
- Special QTreeView that can emit rightClicked()
- */
-class QVLCTreeView : public QTreeView
+class SearchLineEdit : public QLineEdit
{
- Q_OBJECT;
+ Q_OBJECT
public:
- void mouseReleaseEvent( QMouseEvent* e )
- {
- if( e->button() & Qt::RightButton )
- return; /* Do NOT forward to QTreeView!! */
- QTreeView::mouseReleaseEvent( e );
- }
+ SearchLineEdit( QWidget *parent = NULL );
- void mousePressEvent( QMouseEvent* e )
- {
- if( e->button() & Qt::RightButton )
- {
- emit rightClicked( indexAt( QPoint( e->x(), e->y() ) ),
- QCursor::pos() );
- return;
- }
- if( e->button() & Qt::LeftButton )
- {
- if( !indexAt( QPoint( e->x(), e->y() ) ).isValid() )
- clearSelection();
- }
- QTreeView::mousePressEvent( e );
- }
+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();
-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 );