Fix color text's tooltip not being updated when the intensity is more than 0

Before, the tooltip would only change when pressing the "#" button in the editor, but it would never change at runtime or in the editor when changing the intensity
This commit is contained in:
GabCoolDude 2025-10-03 23:33:47 +02:00
parent 06827c91c6
commit f394656844

View file

@ -1425,12 +1425,14 @@ void ColorPicker::_update_text_value() {
text_type->set_disabled(!is_color_valid_hex(color));
hex_label->set_text(ETR("Expr"));
c_text->set_text(t);
c_text->set_tooltip_text(RTR("Execute an expression as a color."));
} else {
text_type->set_text("#");
text_type->set_button_icon(nullptr);
text_type->set_disabled(false);
hex_label->set_text(ETR("Hex"));
c_text->set_text(color.to_html(edit_alpha && color.a < 1));
c_text->set_tooltip_text(ETR("Enter a hex code (\"#ff0000\") or named color (\"red\")."));
}
}