X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FFancyLineEdit.h;h=5a2a5428614537d9ae66bf0f75fd3da6483dd286;hb=b6eacd8d4f86734e8abef3335b190ce12a6a11b5;hp=cd3c6b5951c25208d9615ee43890b39b0e60a585;hpb=eab83ec6787ce859865037e0a38b53a4cb162907;p=lyx.git diff --git a/src/frontends/qt4/FancyLineEdit.h b/src/frontends/qt4/FancyLineEdit.h index cd3c6b5951..5a2a542861 100644 --- a/src/frontends/qt4/FancyLineEdit.h +++ b/src/frontends/qt4/FancyLineEdit.h @@ -29,20 +29,20 @@ class IconButton: public QAbstractButton Q_PROPERTY(bool autoHide READ hasAutoHide WRITE setAutoHide) Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap) public: - explicit IconButton(QWidget *parent = 0); - void paintEvent(QPaintEvent *event); - void setPixmap(const QPixmap &pixmap) { m_pixmap = pixmap; update(); } - QPixmap pixmap() const { return m_pixmap; } - float iconOpacity() { return m_iconOpacity; } - void setIconOpacity(float value) { m_iconOpacity = value; update(); } - void animateShow(bool visible); - - void setAutoHide(bool hide) { m_autoHide = hide; } - bool hasAutoHide() const { return m_autoHide; } + explicit IconButton(QWidget *parent = 0); + void paintEvent(QPaintEvent *event); + void setPixmap(const QPixmap &pixmap) { m_pixmap = pixmap; update(); } + QPixmap pixmap() const { return m_pixmap; } + float iconOpacity() { return m_iconOpacity; } + void setIconOpacity(float value) { m_iconOpacity = value; update(); } + void animateShow(bool visible); + + void setAutoHide(bool hide) { m_autoHide = hide; } + bool hasAutoHide() const { return m_autoHide; } private: - float m_iconOpacity; - bool m_autoHide; - QPixmap m_pixmap; + float m_iconOpacity; + bool m_autoHide; + QPixmap m_pixmap; }; /* A line edit with an embedded pixmap on one side that is connected to @@ -59,55 +59,55 @@ class FancyLineEdit : public QLineEdit Q_ENUMS(Side) public: - enum Side {Left = 0, Right = 1}; + enum Side {Left = 0, Right = 1}; Q_SIGNALS: - void buttonClicked(Side side); - void leftButtonClicked(); - void rightButtonClicked(); + void buttonClicked(Side side); + void leftButtonClicked(); + void rightButtonClicked(); void downPressed(); public: - explicit FancyLineEdit(QWidget *parent = 0); - ~FancyLineEdit(); + explicit FancyLineEdit(QWidget *parent = 0); + ~FancyLineEdit(); - QPixmap buttonPixmap(Side side) const; - void setButtonPixmap(Side side, const QPixmap &pixmap); + QPixmap buttonPixmap(Side side) const; + void setButtonPixmap(Side side, const QPixmap &pixmap); - QMenu *buttonMenu(Side side) const; - void setButtonMenu(Side side, QMenu *menu); + QMenu *buttonMenu(Side side) const; + void setButtonMenu(Side side, QMenu *menu); - void setButtonVisible(Side side, bool visible); - bool isButtonVisible(Side side) const; + void setButtonVisible(Side side, bool visible); + bool isButtonVisible(Side side) const; - void setButtonToolTip(Side side, const QString &); - void setButtonFocusPolicy(Side side, Qt::FocusPolicy policy); + void setButtonToolTip(Side side, const QString &); + void setButtonFocusPolicy(Side side, Qt::FocusPolicy policy); - // Set whether tabbing in will trigger the menu. - void setMenuTabFocusTrigger(Side side, bool v); - bool hasMenuTabFocusTrigger(Side side) const; + // Set whether tabbing in will trigger the menu. + void setMenuTabFocusTrigger(Side side, bool v); + bool hasMenuTabFocusTrigger(Side side) const; - // Set if icon should be hidden when text is empty - void setAutoHideButton(Side side, bool h); - bool hasAutoHideButton(Side side) const; + // Set if icon should be hidden when text is empty + void setAutoHideButton(Side side, bool h); + bool hasAutoHideButton(Side side) const; private Q_SLOTS: - void checkButtons(const QString &); - void iconClicked(); + void checkButtons(const QString &); + void iconClicked(); protected: - virtual void resizeEvent(QResizeEvent *e); + virtual void resizeEvent(QResizeEvent *e); virtual void keyPressEvent(QKeyEvent *e); private: - void updateMargins(); + void updateMargins(); void updateButtonPositions(); - FancyLineEditPrivate *m_d; - QString m_oldText; + FancyLineEditPrivate *m_d; + QString m_oldText; }; -} -} +} // namespace frontend +} // namespace lyx #endif // FANCYLINEEDIT_H