Updated a few methods.

This commit is contained in:
Relintai 2022-12-02 18:42:16 +01:00
parent 03a78b215a
commit 52a264d7f6
4 changed files with 14 additions and 14 deletions

View File

@ -8,9 +8,9 @@ var pids = []
func _enter_tree():
var editor_node = get_tree().get_root().get_child(0)
var gui_base = editor_node.get_gui_base()
var icon_transition = gui_base.get_icon("TransitionSync", "EditorIcons") #ToolConnect
var icon_transition_auto = gui_base.get_icon("TransitionSyncAuto", "EditorIcons")
var icon_load = gui_base.get_icon("Load", "EditorIcons")
var icon_transition = gui_base.get_theme_icon("TransitionSync", "EditorIcons") #ToolConnect
var icon_transition_auto = gui_base.get_theme_icon("TransitionSyncAuto", "EditorIcons")
var icon_load = gui_base.get_theme_icon("Load", "EditorIcons")
panel2 = _add_tooblar_button("_loaddir_pressed", icon_load, icon_load)
panel1 = _add_tooblar_button("_multirun_pressed", icon_transition, icon_transition_auto)

View File

@ -44,10 +44,10 @@ func apply_zoom() -> void:
var p : MarginContainer = get_parent() as MarginContainer
p.add_constant_override("margin_left", min(rect.size.x / 4.0, 50 * _rect_scale))
p.add_constant_override("margin_right", min(rect.size.x / 4.0, 50 * _rect_scale))
p.add_constant_override("margin_top", min(rect.size.y / 4.0, 50 * _rect_scale))
p.add_constant_override("margin_bottom", min(rect.size.y / 4.0, 50 * _rect_scale))
p.add_theme_constant_override("margin_left", min(rect.size.x / 4.0, 50 * _rect_scale))
p.add_theme_constant_override("margin_right", min(rect.size.x / 4.0, 50 * _rect_scale))
p.add_theme_constant_override("margin_top", min(rect.size.y / 4.0, 50 * _rect_scale))
p.add_theme_constant_override("margin_bottom", min(rect.size.y / 4.0, 50 * _rect_scale))
for c in get_children():
c.set_editor_rect_scale(_rect_scale)

View File

@ -38,7 +38,7 @@ func _draw():
draw_rect(Rect2(Vector2(), get_size()), _edited_resource_rect_color)
draw_rect(Rect2(Vector2(), get_size()), _edited_resource_rect_border_color, false, _editor_rect_border_size)
var font : Font = get_font("font")
var font : Font = get_theme_font("font")
var res_name : String = "NULL"

View File

@ -49,9 +49,9 @@ func _init() -> void:
zoom_reset = Button.new()
zoom_reset.set_flat(true)
add_child(zoom_reset)
zoom_reset.add_constant_override("outline_size", 1)
zoom_reset.add_color_override("font_outline_color", Color(0, 0, 0))
zoom_reset.add_color_override("font_color", Color(1, 1, 1))
zoom_reset.add_theme_constant_override("outline_size", 1)
zoom_reset.add_theme_color_override("font_outline_color", Color(0, 0, 0))
zoom_reset.add_theme_color_override("font_color", Color(1, 1, 1))
zoom_reset.connect("pressed", self, "_button_zoom_reset")
zoom_reset.set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", tr("Zoom Reset"), KEY_MASK_CMD | KEY_0))
zoom_reset.set_focus_mode(FOCUS_NONE)
@ -67,7 +67,7 @@ func _init() -> void:
_update_zoom_label()
add_constant_override("separation", round(-8))
add_theme_constant_override("separation", round(-8))
func get_zoom() -> float:
return zoom
@ -173,8 +173,8 @@ func _button_zoom_plus() -> void:
func _notification(p_what : int) -> void:
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED):
zoom_minus.icon = get_icon("ZoomLess", "EditorIcons")
zoom_plus.icon = get_icon("ZoomMore", "EditorIcons")
zoom_minus.icon = get_theme_icon("ZoomLess", "EditorIcons")
zoom_plus.icon = get_theme_icon("ZoomMore", "EditorIcons")
#from godot editor/editor_Settings.cpp
func ED_SHORTCUT(p_path : String, p_name : String, p_keycode : int, editor_settings : EditorSettings = null) -> ShortCut: