mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-23 19:42:21 +08:00
31 lines
599 B
C++
31 lines
599 B
C++
#ifndef SPKICONBUTTON_H
|
|
#define SPKICONBUTTON_H
|
|
|
|
#include <QPushButton>
|
|
#include "spkui_general.h"
|
|
|
|
class SpkIconButton : public QPushButton
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SpkIconButton(QWidget *parent = nullptr);
|
|
~SpkIconButton() {};
|
|
|
|
void SetIcon(QIcon, QSize);
|
|
void SetIcon(QPixmap);
|
|
void SetIconSize(QSize);
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *) override;
|
|
|
|
private:
|
|
static enum { Dark, Light } sCurrentTheme;
|
|
QPixmap mPmapPaintedIcon;
|
|
QSize mPmapSize;
|
|
|
|
static constexpr int IconMargin = 8; // shall we make it changable?
|
|
};
|
|
|
|
#endif // SPKICONBUTTON_H
|