Changeset View
Changeset View
Standalone View
Standalone View
kdecoration/breezebutton.h
Show All 20 Lines | |||||
21 | * You should have received a copy of the GNU General Public License | 21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
23 | */ | 23 | */ | ||
24 | #include <KDecoration2/DecorationButton> | 24 | #include <KDecoration2/DecorationButton> | ||
25 | #include "breezedecoration.h" | 25 | #include "breezedecoration.h" | ||
26 | 26 | | |||
27 | #include <QHash> | 27 | #include <QHash> | ||
28 | #include <QImage> | 28 | #include <QImage> | ||
29 | #include <QPropertyAnimation> | 29 | | ||
30 | class QVariantAnimation; | ||||
30 | 31 | | |||
31 | namespace Breeze | 32 | namespace Breeze | ||
32 | { | 33 | { | ||
33 | 34 | | |||
34 | class Button : public KDecoration2::DecorationButton | 35 | class Button : public KDecoration2::DecorationButton | ||
35 | { | 36 | { | ||
36 | Q_OBJECT | 37 | Q_OBJECT | ||
37 | 38 | | |||
38 | //* declare active state opacity | | |||
39 | Q_PROPERTY( qreal opacity READ opacity WRITE setOpacity ) | | |||
40 | | ||||
41 | public: | 39 | public: | ||
42 | 40 | | |||
43 | //* constructor | 41 | //* constructor | ||
44 | explicit Button(QObject *parent, const QVariantList &args); | 42 | explicit Button(QObject *parent, const QVariantList &args); | ||
45 | 43 | | |||
46 | //* destructor | 44 | //* destructor | ||
47 | virtual ~Button() = default; | 45 | virtual ~Button() = default; | ||
48 | 46 | | |||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
118 | //@{ | 116 | //@{ | ||
119 | QColor foregroundColor() const; | 117 | QColor foregroundColor() const; | ||
120 | QColor backgroundColor() const; | 118 | QColor backgroundColor() const; | ||
121 | //@} | 119 | //@} | ||
122 | 120 | | |||
123 | Flag m_flag = FlagNone; | 121 | Flag m_flag = FlagNone; | ||
124 | 122 | | |||
125 | //* active state change animation | 123 | //* active state change animation | ||
126 | QPropertyAnimation *m_animation; | 124 | QVariantAnimation *m_animation; | ||
127 | 125 | | |||
128 | //* vertical offset (for rendering) | 126 | //* vertical offset (for rendering) | ||
129 | QPointF m_offset; | 127 | QPointF m_offset; | ||
130 | 128 | | |||
131 | //* icon size | 129 | //* icon size | ||
132 | QSize m_iconSize; | 130 | QSize m_iconSize; | ||
133 | 131 | | |||
134 | //* active state change opacity | 132 | //* active state change opacity | ||
135 | qreal m_opacity = 0; | 133 | qreal m_opacity = 0; | ||
136 | }; | 134 | }; | ||
137 | 135 | | |||
138 | } // namespace | 136 | } // namespace | ||
139 | 137 | | |||
140 | #endif | 138 | #endif |