4 # Dialogic Editor toolbar. Works together with editors_mangager.
6 ################################################################################
7 ## EDITOR BUTTONS/LABELS
8 ################################################################################
10 if owner.get_parent() is SubViewport:
12 %CustomButtons.custom_minimum_size.y = 33 * DialogicUtil.get_editor_scale()
14 for child in get_children():
19 func add_icon_button(icon: Texture, tooltip: String) -> Button:
20 var button := Button.new()
22 button.tooltip_text = tooltip
24 button.size_flags_vertical = Control.SIZE_SHRINK_BEGIN
25 button.add_theme_color_override('icon_hover_color', get_theme_color('warning_color', 'Editor'))
26 button.add_theme_stylebox_override('focus', StyleBoxEmpty.new())
28 move_child(button, -2)
32 func add_custom_button(label:String, icon:Texture) -> Button:
33 var button := Button.new()
38 button.size_flags_vertical = Control.SIZE_SHRINK_BEGIN
39 %CustomButtons.add_child(button)
40 # custom_minimum_size.y = button.size.y
44 func hide_all_custom_buttons() -> void:
45 for button in %CustomButtons.get_children():