add 'text-color' textbox property

This commit is contained in:
MihailRis
2024-11-18 14:03:30 +03:00
parent d660880365
commit 801650824e
6 changed files with 33 additions and 1 deletions
+10 -1
View File
@@ -126,7 +126,7 @@ void TextBox::drawBackground(const DrawContext* pctx, Assets*) {
}
void TextBox::refreshLabel() {
label->setColor(glm::vec4(input.empty() ? 0.5f : 1.0f));
label->setColor(textColor * glm::vec4(input.empty() ? 0.5f : 1.0f));
label->setText(input.empty() && !hint.empty() ? hint : getText());
if (autoresize && font) {
@@ -619,6 +619,15 @@ glm::vec4 TextBox::getFocusedColor() const {
return focusedColor;
}
void TextBox::setTextColor(glm::vec4 color) {
this->textColor = color;
}
glm::vec4 TextBox::getTextColor() const {
return textColor;
}
void TextBox::setErrorColor(glm::vec4 color) {
this->invalidColor = color;
}