Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set timeline layer and frame header to be fixed on top #1095

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/UI/Timeline/AnimationTimeline.gd
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var global_layer_expand := true
@onready var tag_spacer := %TagSpacer as Control
@onready var layer_settings_container := %LayerSettingsContainer as VBoxContainer
@onready var layer_container := %LayerContainer as VBoxContainer
@onready var layer_header_container := %LayerHeaderContainer as HBoxContainer
@onready var add_layer_list := %AddLayerList as MenuButton
@onready var remove_layer := %RemoveLayer as Button
@onready var move_up_layer := %MoveUpLayer as Button
Expand All @@ -43,6 +44,7 @@ var global_layer_expand := true
@onready var frame_scroll_bar := %FrameScrollBar as HScrollBar
@onready var tag_scroll_container := %TagScroll as ScrollContainer
@onready var layer_frame_h_split := %LayerFrameHSplit as HSplitContainer
@onready var layer_frame_header_h_split := %LayerFrameHeaderHSplit as HSplitContainer
@onready var delete_frame := %DeleteFrame as Button
@onready var move_frame_left := %MoveFrameLeft as Button
@onready var move_frame_right := %MoveFrameRight as Button
Expand All @@ -60,6 +62,7 @@ func _ready() -> void:
Global.control.find_child("LayerProperties").layer_property_changed.connect(_update_layer_ui)
min_cel_size = get_tree().current_scene.theme.default_font_size + 24
layer_container.custom_minimum_size.x = layer_settings_container.size.x + 12
layer_header_container.custom_minimum_size.x = layer_container.custom_minimum_size.x
cel_size = min_cel_size
cel_size_slider.min_value = min_cel_size
cel_size_slider.max_value = max_cel_size
Expand All @@ -71,6 +74,7 @@ func _ready() -> void:
_fill_blend_modes_option_button()
# Config loading
layer_frame_h_split.split_offset = Global.config_cache.get_value("timeline", "layer_size", 0)
layer_frame_header_h_split.split_offset = layer_frame_h_split.split_offset
cel_size = Global.config_cache.get_value("timeline", "cel_size", cel_size) # Call setter
var past_rate = Global.config_cache.get_value(
"timeline", "past_rate", Global.onion_skinning_past_rate
Expand Down Expand Up @@ -107,6 +111,7 @@ func _notification(what: int) -> void:
await get_tree().process_frame
if is_instance_valid(layer_settings_container):
layer_container.custom_minimum_size.x = layer_settings_container.size.x + 12
layer_header_container.custom_minimum_size.x = layer_container.custom_minimum_size.x


func _input(event: InputEvent) -> void:
Expand Down Expand Up @@ -1318,3 +1323,10 @@ func update_global_layer_buttons() -> void:
Global.change_button_texturerect(%GlobalExpandButton.get_child(0), "group_expanded.png")
else:
Global.change_button_texturerect(%GlobalExpandButton.get_child(0), "group_collapsed.png")


func _on_layer_frame_h_split_dragged(offset: int) -> void:
if layer_frame_header_h_split.split_offset != offset:
layer_frame_header_h_split.split_offset = offset
if layer_frame_h_split.split_offset != offset:
layer_frame_h_split.split_offset = offset
125 changes: 80 additions & 45 deletions src/UI/Timeline/AnimationTimeline.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -786,44 +786,40 @@ mouse_filter = 1
[node name="MainBodyVBoxContainer" type="VBoxContainer" parent="TimelineContainer/MainBodyPanel"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 0

[node name="TimelineScroll" type="ScrollContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer"]
layout_mode = 2
size_flags_vertical = 3

[node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll"]
[node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer"]
clip_contents = true
custom_minimum_size = Vector2(0, 38)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_bottom = 0

[node name="LayerFrameHSplit" type="HSplitContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer"]
[node name="LayerFrameHeaderHSplit" type="HSplitContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/separation = 0
theme_override_constants/separation = 6
theme_override_constants/minimum_grab_thickness = 12
theme_override_icons/grabber = SubResource("ImageTexture_ku1qg")

[node name="LayerContainer" type="VBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit"]
[node name="LayerHeaderContainer" type="HBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit"]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 1

[node name="HBoxContainer" type="HBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer"]
custom_minimum_size = Vector2(84, 0)
layout_mode = 2
size_flags_vertical = 0
theme_override_constants/separation = 0

[node name="GlobalVisibilityButton" type="Button" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer" groups=["UIButtons"]]
[node name="GlobalVisibilityButton" type="Button" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer" groups=["UIButtons"]]
unique_name_in_owner = true
custom_minimum_size = Vector2(28, 22)
layout_mode = 2
tooltip_text = "Toggle layer's visibility"
focus_mode = 0
mouse_default_cursor_shape = 2

[node name="TextureRect" type="TextureRect" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer/GlobalVisibilityButton"]
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/GlobalVisibilityButton"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
Expand All @@ -837,15 +833,15 @@ size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource("24_6ikqj")

[node name="GlobalLockButton" type="Button" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer" groups=["UIButtons"]]
[node name="GlobalLockButton" type="Button" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer" groups=["UIButtons"]]
unique_name_in_owner = true
custom_minimum_size = Vector2(28, 22)
layout_mode = 2
tooltip_text = "Lock/unlock layer"
focus_mode = 0
mouse_default_cursor_shape = 2

[node name="TextureRect" type="TextureRect" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer/GlobalLockButton"]
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/GlobalLockButton"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
Expand All @@ -859,15 +855,15 @@ size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource("25_7x5su")

[node name="GlobalExpandButton" type="Button" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer" groups=["UIButtons"]]
[node name="GlobalExpandButton" type="Button" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer" groups=["UIButtons"]]
unique_name_in_owner = true
custom_minimum_size = Vector2(28, 22)
layout_mode = 2
tooltip_text = "Expand/collapse group"
focus_mode = 0
mouse_default_cursor_shape = 2

[node name="TextureRect" type="TextureRect" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer/GlobalExpandButton"]
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/GlobalExpandButton"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
Expand All @@ -881,22 +877,72 @@ size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource("27_lrc8y")

[node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer"]
[node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/margin_left = 0
theme_override_constants/margin_top = 2
theme_override_constants/margin_right = 1
theme_override_constants/margin_bottom = 0

[node name="OpacitySlider" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer/MarginContainer" instance=ExtResource("9")]
[node name="OpacitySlider" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/MarginContainer" instance=ExtResource("9")]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 29)
layout_mode = 2
size_flags_vertical = 0
value = 100.0
prefix = "Opacity:"

[node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit"]
layout_mode = 2
theme_override_constants/margin_left = -2
theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0

[node name="FrameScrollHeaderContainer" type="Container" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/MarginContainer" node_paths=PackedStringArray("h_scroll_bar")]
clip_contents = true
layout_mode = 2
script = ExtResource("11")
h_scroll_bar = NodePath("../../../../FrameScrollBar")

[node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/MarginContainer/FrameScrollHeaderContainer"]
layout_mode = 2
theme_override_constants/margin_left = 1
theme_override_constants/margin_top = 2
theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0

[node name="FrameHBox" type="HBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/MarginContainer/FrameScrollHeaderContainer/MarginContainer"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
theme_override_constants/separation = 0

[node name="TimelineScroll" type="ScrollContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
vertical_scroll_mode = 2

[node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_right = 0

[node name="LayerFrameHSplit" type="HSplitContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/separation = 6
theme_override_constants/minimum_grab_thickness = 12
theme_override_icons/grabber = SubResource("ImageTexture_ku1qg")

[node name="LayerContainer" type="VBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit"]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 1

[node name="LayerVBox" type="VBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer"]
layout_mode = 2
size_flags_horizontal = 3
Expand All @@ -905,7 +951,7 @@ theme_override_constants/separation = 0
[node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit"]
layout_mode = 2
theme_override_constants/margin_left = -2
theme_override_constants/margin_top = 0
theme_override_constants/margin_top = -2
theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0

Expand All @@ -914,7 +960,7 @@ unique_name_in_owner = true
clip_contents = true
layout_mode = 2
script = ExtResource("11")
h_scroll_bar = NodePath("../../../../../BreakFreeFromContainer/FrameScrollBar")
h_scroll_bar = NodePath("../../../../../FrameScrollBar")

[node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/MarginContainer/FrameScrollContainer"]
layout_mode = 2
Expand All @@ -923,28 +969,14 @@ theme_override_constants/margin_top = 2
theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0

[node name="FrameAndCelBox" type="VBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/MarginContainer/FrameScrollContainer/MarginContainer"]
layout_mode = 2
theme_override_constants/separation = 0

[node name="FrameHBox" type="HBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/MarginContainer/FrameScrollContainer/MarginContainer/FrameAndCelBox"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
theme_override_constants/separation = 0

[node name="CelVBox" type="VBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/MarginContainer/FrameScrollContainer/MarginContainer/FrameAndCelBox"]
[node name="CelVBox" type="VBoxContainer" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/MarginContainer/FrameScrollContainer/MarginContainer"]
layout_mode = 2
theme_override_constants/separation = 0

[node name="BreakFreeFromContainer" type="Control" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer"]
layout_mode = 2

[node name="FrameScrollBar" type="HScrollBar" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/BreakFreeFromContainer"]
[node name="FrameScrollBar" type="HScrollBar" parent="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer"]
unique_name_in_owner = true
layout_mode = 0
anchor_right = 1.0
offset_left = 41.0
offset_top = -12.0
z_index = 2
layout_mode = 2
size_flags_horizontal = 3

[node name="AnimationTimer" type="Timer" parent="."]
Expand Down Expand Up @@ -1105,11 +1137,14 @@ color = Color(0, 0.741176, 1, 0.501961)
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/OnionSkinning" to="." method="_on_OnionSkinning_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/LoopAnim" to="." method="_on_LoopAnim_pressed"]
[connection signal="value_changed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/FPSValue" to="." method="_on_FPSValue_value_changed"]
[connection signal="dragged" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit" to="." method="_on_layer_frame_h_split_dragged"]
[connection signal="gui_input" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit" to="." method="_on_LayerFrameSplitContainer_gui_input"]
[connection signal="pressed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/GlobalVisibilityButton" to="." method="_on_global_visibility_button_pressed"]
[connection signal="pressed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/GlobalLockButton" to="." method="_on_global_lock_button_pressed"]
[connection signal="pressed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/GlobalExpandButton" to="." method="_on_global_expand_button_pressed"]
[connection signal="value_changed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/MarginContainer/OpacitySlider" to="." method="_on_opacity_slider_value_changed"]
[connection signal="dragged" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit" to="." method="_on_layer_frame_h_split_dragged"]
[connection signal="gui_input" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit" to="." method="_on_LayerFrameSplitContainer_gui_input"]
[connection signal="pressed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer/GlobalVisibilityButton" to="." method="_on_global_visibility_button_pressed"]
[connection signal="pressed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer/GlobalLockButton" to="." method="_on_global_lock_button_pressed"]
[connection signal="pressed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer/GlobalExpandButton" to="." method="_on_global_expand_button_pressed"]
[connection signal="value_changed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/HBoxContainer/MarginContainer/OpacitySlider" to="." method="_on_opacity_slider_value_changed"]
[connection signal="resized" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/LayerVBox" to="." method="_on_LayerVBox_resized"]
[connection signal="timeout" from="AnimationTimer" to="." method="_on_AnimationTimer_timeout"]
[connection signal="close_requested" from="TimelineSettings" to="." method="_on_timeline_settings_close_requested"]
Expand Down