SceneSwitcher/lib/variables/variable-color-button.hpp
WarmUpTill 0a2e2cd771 Add VariableColorButton
Used for color selection which also support variables
2026-06-30 20:30:50 +02:00

38 lines
806 B
C++

#pragma once
#include "export-symbol-helper.hpp"
#include "variable-color.hpp"
#include <QLabel>
#include <QPushButton>
#include <QWidget>
namespace advss {
class ADVSS_EXPORT VariableColorButton : public QWidget {
Q_OBJECT
public:
VariableColorButton(QWidget *parent, const QString &selectText);
void SetValue(const ColorVariable &);
ColorVariable Value() const { return _color; }
public slots:
void SelectColorClicked();
void VariableChanged(const QString &);
void ToggleTypeClicked(bool useVariable);
signals:
void ColorVariableChanged(const ColorVariable &);
private:
void SetupColorLabel(const QColor &);
void SetVisibility();
ColorVariable _color;
QLabel *_colorSwatch;
QPushButton *_selectColor;
VariableSelection *_variable;
QPushButton *_toggleType;
};
} // namespace advss