Add the double hseparators under the class name only when needed.

This commit is contained in:
Relintai 2022-04-27 15:09:17 +02:00
parent 0344192367
commit 843ece8db8
2 changed files with 8 additions and 11 deletions

View File

@ -1,5 +1,7 @@
extends PanelContainer
var _item_added : bool = false
func set_class_name(n):
$VBoxContainer/HBoxContainer/ClassName.text = n
@ -9,6 +11,11 @@ func add_h_separator():
$VBoxContainer.add_child(hsep)
func add_line(line : String):
if !_item_added:
_item_added = true
add_h_separator()
add_h_separator()
var l : Label = Label.new()
l.text = line
$VBoxContainer.add_child(l)

View File

@ -11,7 +11,7 @@ script = ExtResource( 1 )
margin_left = 7.0
margin_top = 7.0
margin_right = 41.0
margin_bottom = 37.0
margin_bottom = 23.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 34.0
@ -24,13 +24,3 @@ margin_bottom = 14.0
text = "Node"
align = 1
valign = 1
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
margin_top = 18.0
margin_right = 34.0
margin_bottom = 22.0
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"]
margin_top = 26.0
margin_right = 34.0
margin_bottom = 30.0