679fc61feb
stop, next file, previous file buttons along with the added feasures the buttons represent. i've also added png versions of all of the icons just in case the svg versions are not practical to use. i also fully built out a tray icon functionality so the application can now minimize to system tray. also updated the app logo to a new flat icon type sinewave look. then finally, i've added the restore button to the tray icon so it will restore the window back in front from the tray.
71 lines
1.1 KiB
C++
71 lines
1.1 KiB
C++
#ifndef ICON_H
|
|
#define ICON_H
|
|
|
|
#include <QWidget>
|
|
#include <QToolButton>
|
|
#include <QMediaPlayer>
|
|
#include <QMouseEvent>
|
|
#include <QSvgRenderer>
|
|
#include <QPixmap>
|
|
#include <QPainter>
|
|
#include <QPaintEvent>
|
|
#include <QApplication>
|
|
#include <QRect>
|
|
#include <QDesktopWidget>
|
|
#include <QSlider>
|
|
|
|
class Icon : public QToolButton
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum IconType
|
|
{
|
|
PAUSE_PLAY,
|
|
MENU,
|
|
OPEN,
|
|
STOP,
|
|
PREV,
|
|
NEXT,
|
|
VOL_UP,
|
|
VOL_DOWN,
|
|
RESTORE
|
|
};
|
|
|
|
Icon(IconType t, QWidget *parent = 0);
|
|
|
|
void setSlider(QSlider *slider);
|
|
|
|
public slots:
|
|
|
|
void stateChanged(QMediaPlayer::State state);
|
|
|
|
private:
|
|
|
|
IconType type;
|
|
QMediaPlayer::State playerState;
|
|
QString svgFile;
|
|
QSlider *volSlider;
|
|
|
|
void paintEvent(QPaintEvent *);
|
|
void loadImg(const QString &path);
|
|
|
|
private slots:
|
|
|
|
void buttonClicked();
|
|
|
|
signals:
|
|
|
|
void pause();
|
|
void play();
|
|
void settings();
|
|
void open();
|
|
void next();
|
|
void prev();
|
|
void stop();
|
|
void restore();
|
|
};
|
|
|
|
#endif // ICON_H
|