Plasma
toolbutton.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef TOOLBUTTON_H
00022 #define TOOLBUTTON_H
00023
00024 #include <QToolButton>
00025
00026 namespace Plasma
00027 {
00028 class FrameSvg;
00029 }
00030
00031 class ToolButton: public QToolButton
00032 {
00033 Q_OBJECT
00034
00035 public:
00036 ToolButton(QWidget *parent);
00037 void setAction(QAction *action);
00038
00039 protected:
00040 void paintEvent(QPaintEvent *event);
00041 void enterEvent(QEvent *event);
00042 void leaveEvent(QEvent *event);
00043
00044 protected slots:
00045 void actionDestroyed(QObject *);
00046 void syncToAction();
00047 void animationUpdate(qreal progress);
00048
00049 private:
00050 QAction *m_action;
00051 Plasma::FrameSvg *m_background;
00052 int m_animationId;
00053 qreal m_alpha;
00054 bool m_fadeIn;
00055 };
00056
00057 #endif
00058