X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Futil%2Fcustomwidgets.hpp;h=266d954493855a0864b83517d4c7baad0ab21b14;hb=05d736eac9cb11e55fca0552ff4150cb48004ed8;hp=132c5fc30b45c4c4d9291e77c9cc23d84b22724a;hpb=c24f5b99ca237526dc742734ad9e6e11a4c28cfa;p=vlc diff --git a/modules/gui/qt4/util/customwidgets.hpp b/modules/gui/qt4/util/customwidgets.hpp index 132c5fc30b..266d954493 100644 --- a/modules/gui/qt4/util/customwidgets.hpp +++ b/modules/gui/qt4/util/customwidgets.hpp @@ -28,8 +28,8 @@ #define _CUSTOMWIDGETS_H_ #include +#include #include -#include /** This class provides a QLineEdit which contains a greyed-out hinting @@ -58,41 +58,49 @@ private: bool mDrawClickMsg; }; -class QToolButton; -class SearchLineEdit : public QFrame +class QVLCFramelessButton : public QPushButton +{ + Q_OBJECT; +public: + QVLCFramelessButton( QWidget *parent = NULL ); + QSize sizeHint() const; +protected: + virtual void paintEvent( QPaintEvent * event ); +}; + +class SearchLineEdit : public QLineEdit { Q_OBJECT public: - SearchLineEdit( QWidget *parent ); + SearchLineEdit( QWidget *parent = NULL ); private: - ClickLineEdit *searchLine; - QToolButton *clearButton; + 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(); private slots: void updateText( const QString& ); - -signals: - void textChanged( const QString& ); }; -class QVLCIconLabel : public QLabel +class QVLCElidingLabel : public QLabel { - Q_OBJECT public: - QVLCIconLabel( const QIcon&, QWidget *parent = 0 ); - void setIcon( const QIcon& ); -signals: - void clicked(); -protected: - virtual void enterEvent( QEvent * ); - virtual void leaveEvent( QEvent * ); - virtual void mouseReleaseEvent( QMouseEvent * ); - virtual void resizeEvent( QResizeEvent * ); + QVLCElidingLabel( const QString &s = QString(), + Qt::TextElideMode mode = Qt::ElideRight, + QWidget * parent = NULL ); + void setElideMode( Qt::TextElideMode ); private: - inline void updatePixmap( ); - QIcon icon; - QIcon::Mode iconMode; + void paintEvent( QPaintEvent * event ); + Qt::TextElideMode elideMode; }; /* VLC Key/Wheel hotkeys interactions */