Skip to content

Commit 5652a2f

Browse files
authored
fix .gitignore (#87)
1 parent 818b594 commit 5652a2f

File tree

3 files changed

+158
-1
lines changed

3 files changed

+158
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ export_presets.cfg
1616

1717
# Mono-specific ignores
1818
.mono/
19-
data_*/
2019
.godot/
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@tool
2+
extends PanelContainer
3+
class_name DataTooltip
4+
5+
var gap: float = 15
6+
7+
@onready var x_lbl : Label = $PointData/x
8+
@onready var y_lbl : Label = $PointData/Value/y
9+
@onready var func_lbl : Label = $PointData/Value/Function
10+
@onready var color_rect: Panel = $PointData/Value/Color
11+
12+
func _ready():
13+
hide()
14+
update_size()
15+
16+
func update_position(position: Vector2) -> void:
17+
if (position.x + gap + size.x) > get_parent().size.x:
18+
self.position = position - Vector2(size.x + gap, (get_rect().size.y / 2))
19+
else:
20+
self.position = position + Vector2(15, - (get_rect().size.y / 2))
21+
22+
#func _process(delta):
23+
# if Engine.editor_hint:
24+
# return
25+
# rect_position = get_global_mouse_position() + Vector2(15, - (get_rect().size.y / 2))
26+
27+
func set_font(font: FontFile) -> void:
28+
theme.set("default_font", font)
29+
30+
func update_values(x: String, y: String, function_name: String, color: Color):
31+
x_lbl.set_text(x)
32+
y_lbl.set_text(y)
33+
func_lbl.set_text(function_name)
34+
color_rect.get("theme_override_styles/panel").set("bg_color", color)
35+
36+
func update_size():
37+
x_lbl.set_text("")
38+
y_lbl.set_text("")
39+
func_lbl.set_text("")
40+
size = Vector2.ZERO
41+
42+
func _on_DataTooltip_visibility_changed():
43+
if not visible:
44+
update_size()
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
[gd_scene load_steps=5 format=2]
2+
3+
[ext_resource path="res://addons/easy_charts/utilities/containers/data_tooltip/data_tooltip.gd" type="Script" id=1]
4+
5+
[sub_resource type="StyleBoxFlat" id=1]
6+
content_margin_left = 10.0
7+
content_margin_right = 10.0
8+
content_margin_top = 8.0
9+
content_margin_bottom = 8.0
10+
bg_color = Color( 0.101961, 0.101961, 0.101961, 0.784314 )
11+
border_color = Color( 1, 1, 1, 1 )
12+
corner_radius_top_left = 8
13+
corner_radius_top_right = 8
14+
corner_radius_bottom_right = 8
15+
corner_radius_bottom_left = 8
16+
corner_detail = 20
17+
anti_aliasing_size = 0.65
18+
19+
[sub_resource type="StyleBoxFlat" id=2]
20+
corner_radius_top_left = 5
21+
corner_radius_top_right = 5
22+
corner_radius_bottom_right = 5
23+
corner_radius_bottom_left = 5
24+
corner_detail = 20
25+
anti_aliasing_size = 0.7
26+
27+
[sub_resource type="StyleBoxEmpty" id=3]
28+
29+
[node name="DataTooltip" type="PanelContainer"]
30+
visible = false
31+
offset_right = 20.0
32+
offset_bottom = 16.0
33+
mouse_filter = 2
34+
theme_override_styles/panel = SubResource( 1 )
35+
script = ExtResource( 1 )
36+
37+
[node name="PointData" type="VBoxContainer" parent="."]
38+
offset_left = 10.0
39+
offset_top = 8.0
40+
offset_right = 37.0
41+
offset_bottom = 42.0
42+
grow_horizontal = 2
43+
size_flags_horizontal = 3
44+
theme_override_constants/separation = 1
45+
alignment = 1
46+
__meta__ = {
47+
"_edit_use_anchors_": false
48+
}
49+
50+
[node name="x" type="Label" parent="PointData"]
51+
offset_top = 2.0
52+
offset_bottom = 16.0
53+
size_flags_horizontal = 0
54+
theme_override_colors/font_color = Color( 1, 1, 1, 1 )
55+
valign = 1
56+
57+
[node name="Value" type="HBoxContainer" parent="PointData"]
58+
offset_top = 17.0
59+
offset_right = 27.0
60+
offset_bottom = 31.0
61+
grow_horizontal = 2
62+
size_flags_horizontal = 7
63+
theme_override_constants/separation = 1
64+
65+
[node name="Color" type="Panel" parent="PointData/Value"]
66+
offset_top = 2.0
67+
offset_right = 10.0
68+
offset_bottom = 12.0
69+
custom_minimum_size = Vector2( 10, 10 )
70+
size_flags_horizontal = 4
71+
size_flags_vertical = 4
72+
theme_override_styles/panel = SubResource( 2 )
73+
74+
[node name="VSeparator" type="VSeparator" parent="PointData/Value"]
75+
offset_left = 11.0
76+
offset_right = 15.0
77+
offset_bottom = 14.0
78+
theme_override_constants/separation = 4
79+
theme_override_styles/separator = SubResource( 3 )
80+
81+
[node name="Function" type="Label" parent="PointData/Value"]
82+
offset_left = 16.0
83+
offset_right = 16.0
84+
offset_bottom = 14.0
85+
size_flags_horizontal = 0
86+
size_flags_vertical = 5
87+
valign = 1
88+
89+
[node name="sep" type="Label" parent="PointData/Value"]
90+
offset_left = 17.0
91+
offset_right = 21.0
92+
offset_bottom = 14.0
93+
size_flags_horizontal = 0
94+
size_flags_vertical = 5
95+
text = ":"
96+
valign = 1
97+
98+
[node name="VSeparator2" type="VSeparator" parent="PointData/Value"]
99+
offset_left = 22.0
100+
offset_right = 26.0
101+
offset_bottom = 14.0
102+
theme_override_constants/separation = 4
103+
theme_override_styles/separator = SubResource( 3 )
104+
105+
[node name="y" type="Label" parent="PointData/Value"]
106+
offset_left = 27.0
107+
offset_right = 27.0
108+
offset_bottom = 14.0
109+
size_flags_horizontal = 0
110+
size_flags_vertical = 5
111+
theme_override_colors/font_color = Color( 1, 1, 1, 1 )
112+
valign = 1
113+
114+
[connection signal="visibility_changed" from="." to="." method="_on_DataTooltip_visibility_changed"]

0 commit comments

Comments
 (0)