[137] | 1 | /* smplayer, GUI front-end for mplayer.
|
---|
[188] | 2 | Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
[137] | 3 | umplayer, Copyright (C) 2010 Ori Rejwan
|
---|
| 4 |
|
---|
| 5 | This program is free software; you can redistribute it and/or modify
|
---|
| 6 | it under the terms of the GNU General Public License as published by
|
---|
| 7 | the Free Software Foundation; either version 2 of the License, or
|
---|
| 8 | (at your option) any later version.
|
---|
| 9 |
|
---|
| 10 | This program is distributed in the hope that it will be useful,
|
---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 13 | GNU General Public License for more details.
|
---|
| 14 |
|
---|
| 15 | You should have received a copy of the GNU General Public License
|
---|
| 16 | along with this program; if not, write to the Free Software
|
---|
| 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 18 | */
|
---|
| 19 |
|
---|
| 20 | #ifndef MYBUTTON_H
|
---|
| 21 | #define MYBUTTON_H
|
---|
| 22 |
|
---|
| 23 | #include <QAbstractButton>
|
---|
| 24 | #include "myicon.h"
|
---|
| 25 |
|
---|
| 26 | class MyAction;
|
---|
| 27 | class MyButton : public QAbstractButton
|
---|
| 28 | {
|
---|
| 29 | Q_OBJECT
|
---|
| 30 | public:
|
---|
| 31 | explicit MyButton(QWidget *parent = 0);
|
---|
| 32 | void setState(bool on) {state = on; }
|
---|
| 33 | void setMyIcon(MyIcon p_icon) { icon = p_icon; }
|
---|
| 34 | MyIcon myIcon() { return icon;}
|
---|
| 35 | void setAction(MyAction* pAction);
|
---|
| 36 | bool eventFilter(QObject *watched, QEvent *event);
|
---|
| 37 |
|
---|
| 38 | private:
|
---|
| 39 | MyIcon icon;
|
---|
| 40 | bool mouseHover;
|
---|
| 41 | bool state;
|
---|
| 42 | MyAction* action;
|
---|
| 43 |
|
---|
| 44 | protected:
|
---|
| 45 | virtual void paintEvent(QPaintEvent *e);
|
---|
| 46 | void enterEvent(QEvent *);
|
---|
| 47 | void leaveEvent(QEvent *);
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 | signals:
|
---|
| 51 |
|
---|
| 52 | public slots:
|
---|
| 53 | void toggleImage();
|
---|
| 54 |
|
---|
| 55 | };
|
---|
| 56 |
|
---|
| 57 | #endif // MYBUTTON_H
|
---|