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:
parent
70cb9b6b1b
commit
615491052a
2 changed files with 8 additions and 16 deletions
|
@ -327,18 +327,12 @@ func get_assigned_color(button: int) -> Color:
|
|||
|
||||
|
||||
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():
|
||||
t.rect_min_size = Vector2(24, 24)
|
||||
t.get_node("BackgroundLeft").rect_size.x = 12
|
||||
t.get_node("BackgroundRight").rect_size.x = 12
|
||||
t.get_node("BackgroundRight").rect_position = Vector2(24, 24)
|
||||
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)
|
||||
t.rect_min_size = size
|
||||
t.get_node("BackgroundLeft").rect_size.x = size.x / 2
|
||||
t.get_node("BackgroundRight").rect_size.x = size.x / 2
|
||||
t.get_node("BackgroundRight").rect_position = size
|
||||
|
||||
|
||||
func update_tool_buttons() -> void:
|
||||
|
|
|
@ -89,10 +89,8 @@ func change_theme(id: int) -> void:
|
|||
VisualServer.set_default_clear_color(clear_color)
|
||||
|
||||
# Temporary code
|
||||
var layer_button_pcont: PanelContainer = Global.animation_timeline.find_node(
|
||||
"LayerButtonPanelContainer"
|
||||
)
|
||||
var lbpc_stylebox: StyleBoxFlat = layer_button_pcont.get_stylebox("panel", "PanelContainer")
|
||||
var lbpc: PanelContainer = Global.animation_timeline.find_node("LayerButtonPanelContainer")
|
||||
var lbpc_stylebox: StyleBoxFlat = lbpc.get_stylebox("panel", "PanelContainer")
|
||||
lbpc_stylebox.bg_color = clear_color
|
||||
|
||||
change_icon_colors()
|
||||
|
|
Loading…
Add table
Reference in a new issue