From 69b3569e18e533d3a26692bf87079528669721de Mon Sep 17 00:00:00 2001 From: Iceflower Date: Mon, 25 Sep 2023 15:34:19 +0200 Subject: [PATCH] [plugin|licenses] No tooltip on multiline string if empty --- addons/licenses/internal/handler/string_multiline.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/licenses/internal/handler/string_multiline.gd b/addons/licenses/internal/handler/string_multiline.gd index 44d9995..b5505ea 100644 --- a/addons/licenses/internal/handler/string_multiline.gd +++ b/addons/licenses/internal/handler/string_multiline.gd @@ -6,7 +6,10 @@ func _init(tree_: ComponentDetailTree, item_: TreeItem, value_: Variant, propert super._init(tree_, item_, value_, property_) self.item.set_text(0, self.property["name"].capitalize()) self.item.set_text(1, self.value) - self.item.set_tooltip_text(1, self.value.substr(0, mini(self.value.length(), 512)) + "...") + var tooltip_text: String = self.value.substr(0, mini(self.value.length(), 512)) + if self.value.length() > 512: + tooltip_text += "..." + self.item.set_tooltip_text(1, tooltip_text) self._update_reset_button() self.item.add_button(1, self.tree.get_theme_icon("DistractionFree", "EditorIcons"), 1)