MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / VariableColorButton

Method VariableColorButton

lib/variables/variable-color-button.cpp:10–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace advss {
9
10VariableColorButton::VariableColorButton(QWidget *parent,
11 const QString &selectText)
12 : QWidget(parent),
13 _colorSwatch(new QLabel()),
14 _selectColor(new QPushButton(selectText)),
15 _variable(new VariableSelection(this)),
16 _toggleType(new QPushButton())
17{
18 _toggleType->setCheckable(true);
19 _toggleType->setMaximumWidth(11);
20 SetButtonIcon(_toggleType, GetThemeTypeName() == "Light"
21 ? ":/res/images/dots-vert.svg"
22 : "theme:Dark/dots-vert.svg");
23
24 QWidget::connect(_selectColor, SIGNAL(clicked()), this,
25 SLOT(SelectColorClicked()));
26 QWidget::connect(_toggleType, SIGNAL(toggled(bool)), this,
27 SLOT(ToggleTypeClicked(bool)));
28 QWidget::connect(_variable, SIGNAL(SelectionChanged(const QString &)),
29 this, SLOT(VariableChanged(const QString &)));
30
31 auto layout = new QHBoxLayout();
32 layout->setContentsMargins(0, 0, 0, 0);
33 layout->addWidget(_colorSwatch);
34 layout->addWidget(_selectColor);
35 layout->addWidget(_variable);
36 layout->addWidget(_toggleType);
37 setLayout(layout);
38 SetVisibility();
39}
40
41void VariableColorButton::SetValue(const ColorVariable &color)
42{

Callers

nothing calls this directly

Calls 2

SetButtonIconFunction · 0.50
GetThemeTypeNameFunction · 0.50

Tested by

no test coverage detected