-
-
Notifications
You must be signed in to change notification settings - Fork 557
/
Copy pathstyledtoolbutton.h
42 lines (31 loc) · 903 Bytes
/
styledtoolbutton.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich
#ifndef STYLEDTOOLBUTTON_H
#define STYLEDTOOLBUTTON_H
#include <QWidget>
#include <QAbstractButton>
#include <QPainter>
#include <QStyle>
#include <QStyleOptionFrame>
class StyledToolButton : public QAbstractButton
{
public:
explicit StyledToolButton(QWidget *parent = 0);
bool isHover();
QColor backColor() const;
void setBackColor(const QColor &backColor);
QColor foreColor() const;
void setForeColor(const QColor &foreColor);
QColor highlightColor() const;
void setHighlightColor(const QColor &highlightColor);
protected:
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
private:
void paintEvent(QPaintEvent *e);
bool m_hovered;
QColor m_backColor;
QColor m_foreColor;
QColor m_highlightColor;
};
#endif // STYLEDTOOLBUTTON_H