Fix layer bar icon positioning.

This commit is contained in:
Relintai 2020-11-29 18:24:24 +01:00
parent f380b53c99
commit 68f877879f
3 changed files with 46 additions and 40 deletions

View File

@ -24,8 +24,6 @@
[ext_resource path="res://addons/draw_gd/assets/graphics/dark_themes/timeline/loop.png" type="Texture" id=31]
[ext_resource path="res://addons/draw_gd/src/UI/Timeline/FrameTagDialog.tscn" type="PackedScene" id=42]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.0627451, 0.0627451, 0.0627451, 1 )
expand_margin_top = 6.0
@ -992,6 +990,7 @@ mouse_filter = 2
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/LayerButtonPanelContainer/LayerButtons/AddLayer" to="." method="add_layer" binds= [ true ]]
[connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/LayerButtonPanelContainer/LayerButtons/RemoveLayer" to="." method="_on_RemoveLayer_pressed"]
[connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/LayerButtonPanelContainer/LayerButtons/MoveUpLayer" to="." method="change_layer_order" binds= [ 1 ]]

View File

@ -32,23 +32,19 @@ func init():
line_edit = DrawGD.find_node_by_name(self, "LineEdit")
if DrawGD.current_project.layers[i].visible:
DrawGD.change_button_texturerect(visibility_button.get_child(0), "layer_visible.png")
visibility_button.get_child(0).rect_size = Vector2(24, 14)
visibility_button.get_child(0).rect_position = Vector2(4, 9)
DrawGD.change_button_texturerect(visibility_button.get_child(0).get_child(0), "layer_visible.png")
else:
DrawGD.change_button_texturerect(visibility_button.get_child(0), "layer_invisible.png")
visibility_button.get_child(0).rect_size = Vector2(24, 8)
visibility_button.get_child(0).rect_position = Vector2(4, 12)
DrawGD.change_button_texturerect(visibility_button.get_child(0).get_child(0), "layer_invisible.png")
if DrawGD.current_project.layers[i].locked:
DrawGD.change_button_texturerect(lock_button.get_child(0), "lock.png")
DrawGD.change_button_texturerect(lock_button.get_child(0).get_child(0), "lock.png")
else:
DrawGD.change_button_texturerect(lock_button.get_child(0), "unlock.png")
DrawGD.change_button_texturerect(lock_button.get_child(0).get_child(0), "unlock.png")
if DrawGD.current_project.layers[i].new_cels_linked: # If new layers will be linked
DrawGD.change_button_texturerect(linked_button.get_child(0), "linked_layer.png")
DrawGD.change_button_texturerect(linked_button.get_child(0).get_child(0), "linked_layer.png")
else:
DrawGD.change_button_texturerect(linked_button.get_child(0), "unlinked_layer.png")
DrawGD.change_button_texturerect(linked_button.get_child(0).get_child(0), "unlinked_layer.png")
func _input(event : InputEvent) -> void:

View File

@ -5,7 +5,6 @@
[ext_resource path="res://addons/draw_gd/assets/graphics/dark_themes/layers/unlock.png" type="Texture" id=3]
[ext_resource path="res://addons/draw_gd/assets/graphics/dark_themes/layers/unlinked_layer.png" type="Texture" id=4]
[node name="LayerContainer" type="Button"]
margin_right = 210.0
margin_bottom = 36.0
@ -48,15 +47,19 @@ mouse_default_cursor_shape = 2
size_flags_horizontal = 0
size_flags_vertical = 4
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/VisibilityButton"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -12.0
margin_top = -7.0
margin_right = 12.0
margin_bottom = 7.0
[node name="CenterContainer" type="CenterContainer" parent="HBoxContainer/LayerButtons/VisibilityButton"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/VisibilityButton/CenterContainer"]
margin_left = 4.0
margin_top = 9.0
margin_right = 28.0
margin_bottom = 23.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 2 )
@ -78,15 +81,19 @@ mouse_default_cursor_shape = 2
size_flags_horizontal = 0
size_flags_vertical = 4
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/LockButton"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -10.0
margin_top = -12.0
margin_right = 10.0
margin_bottom = 12.0
[node name="CenterContainer" type="CenterContainer" parent="HBoxContainer/LayerButtons/LockButton"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/LockButton/CenterContainer"]
margin_left = 6.0
margin_top = 4.0
margin_right = 26.0
margin_bottom = 28.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 3 )
@ -110,15 +117,19 @@ mouse_default_cursor_shape = 2
size_flags_horizontal = 0
size_flags_vertical = 4
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/LinkButton"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -12.0
margin_top = -4.0
margin_right = 12.0
margin_bottom = 4.0
[node name="CenterContainer" type="CenterContainer" parent="HBoxContainer/LayerButtons/LinkButton"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/LinkButton/CenterContainer"]
margin_left = 4.0
margin_top = 12.0
margin_right = 28.0
margin_bottom = 20.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 4 )