2022-07-08 18:37:53 -04:00
|
|
|
#ifndef ICON_H
|
|
|
|
#define ICON_H
|
|
|
|
|
|
|
|
// This file is part of JustAudio.
|
|
|
|
|
|
|
|
// JustAudio is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// JustAudio is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with BashWire under the GPL.txt file. If not, see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QSvgRenderer>
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QPaintEvent>
|
|
|
|
#include <QToolButton>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QXmlStreamReader>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QAction>
|
|
|
|
|
|
|
|
class SVGIcon : public QToolButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void enabledChanged(bool state);
|
|
|
|
void clickedInternal();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
QByteArray localData;
|
|
|
|
|
|
|
|
void setInactiveAppearance();
|
|
|
|
void setActiveAppearance();
|
|
|
|
void loadSvgFile(const QString &path);
|
|
|
|
void paintEvent(QPaintEvent *);
|
|
|
|
void fileCopy(const QString &path);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
explicit SVGIcon(const QString &name, const QString &desc, bool toggle, QWidget *parent = 0);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ICON_H
|