|
@@ -778,10 +778,20 @@ Control *EditorProperty::make_custom_tooltip(const String &p_text) const {
|
|
|
help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel"));
|
|
|
help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE);
|
|
|
|
|
|
- String text = TTR("Property:") + " [u][b]" + p_text.get_slice("::", 0) + "[/b][/u]\n";
|
|
|
- text += p_text.get_slice("::", 1).strip_edges();
|
|
|
- help_bit->set_text(text);
|
|
|
- help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
|
|
|
+ Vector<String> slices = p_text.split("::", false);
|
|
|
+ if (!slices.empty()) {
|
|
|
+ String property_name = slices[0].strip_edges();
|
|
|
+ String text = TTR("Property:") + " [u][b]" + property_name + "[/b][/u]";
|
|
|
+
|
|
|
+ if (slices.size() > 1) {
|
|
|
+ String property_doc = slices[1].strip_edges();
|
|
|
+ if (property_name != property_doc) {
|
|
|
+ text += "\n" + property_doc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
|
|
|
+ }
|
|
|
+
|
|
|
return help_bit;
|
|
|
}
|
|
|
|
|
@@ -1005,10 +1015,20 @@ Control *EditorInspectorCategory::make_custom_tooltip(const String &p_text) cons
|
|
|
help_bit->add_style_override("panel", get_stylebox("panel", "TooltipPanel"));
|
|
|
help_bit->get_rich_text()->set_fixed_size_to_width(360 * EDSCALE);
|
|
|
|
|
|
- String text = "[u][b]" + p_text.get_slice("::", 0) + "[/b][/u]\n";
|
|
|
- text += p_text.get_slice("::", 1).strip_edges();
|
|
|
- help_bit->set_text(text);
|
|
|
- help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
|
|
|
+ Vector<String> slices = p_text.split("::", false);
|
|
|
+ if (!slices.empty()) {
|
|
|
+ String property_name = slices[0].strip_edges();
|
|
|
+ String text = "[u][b]" + property_name + "[/b][/u]";
|
|
|
+
|
|
|
+ if (slices.size() > 1) {
|
|
|
+ String property_doc = slices[1].strip_edges();
|
|
|
+ if (property_name != property_doc) {
|
|
|
+ text += "\n" + property_doc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ help_bit->call_deferred("set_text", text); //hack so it uses proper theme once inside scene
|
|
|
+ }
|
|
|
+
|
|
|
return help_bit;
|
|
|
}
|
|
|
|