1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-03-13 06:45:17 +00:00

Minor code cleanup to reduce lines of code

This commit is contained in:
Emmanouil Papadeas 2022-08-21 00:18:33 +03:00
parent 70cb9b6b1b
commit 615491052a
2 changed files with 8 additions and 16 deletions

View file

@ -327,18 +327,12 @@ func get_assigned_color(button: int) -> Color:
func set_button_size(button_size: int) -> void: func set_button_size(button_size: int) -> void:
if button_size == Global.ButtonSize.SMALL: var size := Vector2(24, 24) if button_size == Global.ButtonSize.SMALL else Vector2(32, 32)
for t in _tool_buttons.get_children(): for t in _tool_buttons.get_children():
t.rect_min_size = Vector2(24, 24) t.rect_min_size = size
t.get_node("BackgroundLeft").rect_size.x = 12 t.get_node("BackgroundLeft").rect_size.x = size.x / 2
t.get_node("BackgroundRight").rect_size.x = 12 t.get_node("BackgroundRight").rect_size.x = size.x / 2
t.get_node("BackgroundRight").rect_position = Vector2(24, 24) t.get_node("BackgroundRight").rect_position = size
else:
for t in _tool_buttons.get_children():
t.rect_min_size = Vector2(32, 32)
t.get_node("BackgroundLeft").rect_size.x = 16
t.get_node("BackgroundRight").rect_size.x = 16
t.get_node("BackgroundRight").rect_position = Vector2(32, 32)
func update_tool_buttons() -> void: func update_tool_buttons() -> void:

View file

@ -89,10 +89,8 @@ func change_theme(id: int) -> void:
VisualServer.set_default_clear_color(clear_color) VisualServer.set_default_clear_color(clear_color)
# Temporary code # Temporary code
var layer_button_pcont: PanelContainer = Global.animation_timeline.find_node( var lbpc: PanelContainer = Global.animation_timeline.find_node("LayerButtonPanelContainer")
"LayerButtonPanelContainer" var lbpc_stylebox: StyleBoxFlat = lbpc.get_stylebox("panel", "PanelContainer")
)
var lbpc_stylebox: StyleBoxFlat = layer_button_pcont.get_stylebox("panel", "PanelContainer")
lbpc_stylebox.bg_color = clear_color lbpc_stylebox.bg_color = clear_color
change_icon_colors() change_icon_colors()