39 lines
917 B
C++
39 lines
917 B
C++
#include <gui/containers/ConfigItem.hpp>
|
|
|
|
#include "texts/TextKeysAndLanguages.hpp"
|
|
#include "touchgfx/Color.hpp"
|
|
|
|
ConfigItem::ConfigItem() : NamedField(paramFieldDescs) {}
|
|
|
|
void ConfigItem::initialize() { ConfigItemBase::initialize(); }
|
|
|
|
void ConfigItem::setSelected(int selected) {
|
|
uint8_t v = selected ? 0x44 : 0x00;
|
|
bg.setColor(touchgfx::Color::getColorFromRGB(v, v, v));
|
|
bg.invalidate();
|
|
}
|
|
|
|
void ConfigItem::typeUpdated() {
|
|
switch (desc->kind) {
|
|
case NamedFieldKind::Float:
|
|
case NamedFieldKind::Int:
|
|
value.setTypedText(T_NUMBERWILDCARD);
|
|
break;
|
|
case NamedFieldKind::Bool:
|
|
case NamedFieldKind::Text:
|
|
value.setTypedText(T_DEFAULTWILDCARD_CENTERED);
|
|
break;
|
|
}
|
|
value.invalidate();
|
|
}
|
|
|
|
void ConfigItem::titleBufferUpdated() {
|
|
title.setWildcard(titleBuffer);
|
|
title.invalidate();
|
|
}
|
|
|
|
void ConfigItem::valueBufferUpdated() {
|
|
value.setWildcard(valueBuffer);
|
|
value.invalidate();
|
|
}
|