81 lines
1.8 KiB
C++
81 lines
1.8 KiB
C++
#ifndef QUARTSBUTTON_H
|
|
// #define QUARTSBUTTON_H
|
|
|
|
// #include <QObject>
|
|
|
|
// class QuartsButton : public QObject
|
|
// {
|
|
// Q_OBJECT
|
|
// public:
|
|
// explicit QuartsButton(QObject *parent = nullptr);
|
|
|
|
|
|
// signals:
|
|
// };
|
|
|
|
#ifndef QUARTSBUTTON_H
|
|
#define QUARTSBUTTON_H
|
|
|
|
#include <QObject>
|
|
#include "FigmaStyles.h"
|
|
#include <QQuickItem>
|
|
|
|
class QuartsButton : public QObject {
|
|
Q_OBJECT
|
|
public:
|
|
enum TypeFilled{
|
|
Filled, Border, None
|
|
} typeFilled = Filled;
|
|
explicit QuartsButton(QQuickItem * root);
|
|
|
|
void setElementName(const QString& name) {this->name = name; init();}
|
|
void setTextElementName(const QString& name) {this->textElementName = name;}
|
|
void setButtonText(const QString& text);
|
|
void setEnabled(bool value);
|
|
|
|
void setBaseColor(QColor color) {
|
|
baseColor = color;
|
|
}
|
|
|
|
void setFocusedColor(QColor color) {
|
|
focusedColor = color;
|
|
}
|
|
|
|
void setDisabledColor(QColor color) {
|
|
disabledColor = color;
|
|
}
|
|
|
|
void setVisible(bool value) {
|
|
element->setVisible(value);
|
|
}
|
|
|
|
signals:
|
|
void clicked();
|
|
|
|
|
|
private:
|
|
void init();
|
|
|
|
|
|
QColor baseColor = QML::CORLOR_BUTTON_BASE;
|
|
QColor focusedColor = QML::CORLOR_BUTTON_FOCUSED;
|
|
QColor disabledColor = QML::CORLOR_BUTTON_DISABLED;
|
|
QColor emptyColor = QML::CORLOR_BUTTON_BASE_EMPTY;
|
|
QColor textColorDisabled = QML::CORLOR_BUTTON_DISABLED_TEXT;
|
|
QColor textColorEnabledBase = QML::CORLOR_BUTTON_BASE_TEXT;
|
|
QColor textColorEnabledEmpty = QML::CORLOR_BUTTON_BASE_TEXT_EMPTY;
|
|
QColor textColorEnabledFocused = QML::CORLOR_BUTTON_TEXT_FOCUSED;
|
|
|
|
|
|
|
|
QString name = "";
|
|
QString textElementName = "";
|
|
QQuickItem * root = 0;
|
|
QQuickItem * element = 0;
|
|
QQuickItem * textElement = 0;
|
|
};
|
|
|
|
#endif // QUARTSBUTTON_H
|
|
|
|
#endif // QUARTSBUTTON_H
|