Skip to content

Commit

Permalink
Editor Layout update
Browse files Browse the repository at this point in the history
  • Loading branch information
voylin committed Dec 12, 2023
1 parent 4184dc4 commit f96eb71
Show file tree
Hide file tree
Showing 14 changed files with 351 additions and 8 deletions.
Binary file added src/editor/assets/icons/icon_effect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions src/editor/assets/icons/icon_effect.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://u6wtl4hm6r3n"
path="res://.godot/imported/icon_effect.png-d36baad83040fef0ffaf7ea3e3572ec9.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/icons/icon_effect.png"
dest_files=["res://.godot/imported/icon_effect.png-d36baad83040fef0ffaf7ea3e3572ec9.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added src/editor/assets/icons/icon_folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions src/editor/assets/icons/icon_folder.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b7fpp8oqsuk05"
path="res://.godot/imported/icon_folder.png-a36b376b91be0c6f8cb80f19448e4886.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/icons/icon_folder.png"
dest_files=["res://.godot/imported/icon_folder.png-a36b376b91be0c6f8cb80f19448e4886.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added src/editor/assets/icons/icon_render.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions src/editor/assets/icons/icon_render.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dev7t2yjjkrwp"
path="res://.godot/imported/icon_render.png-7b8ea2343bf3b73b5f55c015fe0c58f7.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/icons/icon_render.png"
dest_files=["res://.godot/imported/icon_render.png-7b8ea2343bf3b73b5f55c015fe0c58f7.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added src/editor/assets/icons/icon_subtitles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions src/editor/assets/icons/icon_subtitles.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c75yufdvxenp7"
path="res://.godot/imported/icon_subtitles.png-37af62534d3530aafb28380b51ee47dd.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/icons/icon_subtitles.png"
dest_files=["res://.godot/imported/icon_subtitles.png-37af62534d3530aafb28380b51ee47dd.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
4 changes: 2 additions & 2 deletions src/editor/scripts/autoload/project_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ func set_size(new_resolution: Vector2i) -> void:
#region Framerate ############################################
###############################################################

func get_framerate() -> int:
func get_framerate() -> float:
return framerate


func set_framerate(new_framerate: int) -> void:
func set_framerate(new_framerate: float) -> void:
framerate = new_framerate
save_project()
_on_framerate_changed.emit(framerate)
Expand Down
2 changes: 1 addition & 1 deletion src/editor/scripts/autoload/settings_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func get_language_list() -> Dictionary:
return dic


func set_language(language_code: String, startup: bool = false) -> void:
func set_language(language_code: String) -> void:
TranslationServer.set_locale(language_code)
language = language_code
_on_language_changed.emit(language_code)
Expand Down
30 changes: 30 additions & 0 deletions src/editor/ui/editor_window/editor_layout.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
extends HBoxContainer

const PATH := "user://editor_layout.dat"


func _ready() -> void:
load_editor_layout()

###############################################################
#region Data handlers ########################################
###############################################################

func load_editor_layout() -> void:
if !FileAccess.file_exists(PATH):
save_editor_layout()
return
var data_file := FileAccess.open(PATH, FileAccess.READ)
var data: Dictionary = data_file.get_var()
%LayoutVSplit.split_offset = int(data.v_split_offset)
%LayoutHSplit.split_offset = int(data.h_split_offset)

func save_editor_layout() -> void:
var data_file := FileAccess.open(PATH, FileAccess.WRITE)
data_file.store_var({
"v_split_offset": %LayoutVSplit.split_offset,
"h_split_offset": %LayoutHSplit.split_offset,
})

#endregion
###############################################################
124 changes: 119 additions & 5 deletions src/editor/ui/editor_window/editor_window.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
[gd_scene load_steps=4 format=3 uid="uid://i0afdsn6mn8r"]
[gd_scene load_steps=14 format=3 uid="uid://i0afdsn6mn8r"]

[ext_resource type="Theme" uid="uid://cvv4mu4srdvdh" path="res://ui/editor_window/theme_module_buttons.tres" id="2_0bt5p"]
[ext_resource type="PackedScene" uid="uid://damrypkaih6ch" path="res://ui/editor_window/top_bar/top_bar.tscn" id="2_cfupl"]
[ext_resource type="Texture2D" uid="uid://b7fpp8oqsuk05" path="res://assets/icons/icon_folder.png" id="2_iyr7k"]
[ext_resource type="Script" path="res://ui/editor_window/editor_layout.gd" id="2_k5yiy"]
[ext_resource type="Texture2D" uid="uid://u6wtl4hm6r3n" path="res://assets/icons/icon_effect.png" id="3_sace5"]
[ext_resource type="Texture2D" uid="uid://c75yufdvxenp7" path="res://assets/icons/icon_subtitles.png" id="4_g3rrh"]
[ext_resource type="PackedScene" uid="uid://dw25wwbr77fyb" path="res://ui/editor_window/resize_handles/resize_handles.tscn" id="5_d82ab"]
[ext_resource type="Theme" uid="uid://bb6sp1l2go5b8" path="res://ui/editor_window/theme_layout_panels.tres" id="7_ch834"]
[ext_resource type="Texture2D" uid="uid://dev7t2yjjkrwp" path="res://assets/icons/icon_render.png" id="7_wksug"]
[ext_resource type="PackedScene" uid="uid://ceg34ei6bl8dy" path="res://ui/editor_window/status_bar/status_bar.tscn" id="20_ynsae"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kkw0i"]
content_margin_left = 5.0
content_margin_top = 10.0
content_margin_right = 5.0
content_margin_bottom = 10.0
bg_color = Color(0.207843, 0.207843, 0.207843, 1)

[sub_resource type="ButtonGroup" id="ButtonGroup_64ioo"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5muqw"]

[node name="EditorWindow" type="Control"]
layout_mode = 3
anchors_preset = 15
Expand All @@ -12,7 +30,7 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Layout" type="VBoxContainer" parent="."]
[node name="VBox" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
Expand All @@ -21,14 +39,110 @@ grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 0

[node name="TopBar" parent="Layout" instance=ExtResource("2_cfupl")]
[node name="TopBar" parent="VBox" instance=ExtResource("2_cfupl")]
layout_mode = 2

[node name="LayoutHBox" type="HBoxContainer" parent="VBox"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = -1
script = ExtResource("2_k5yiy")

[node name="ModuleBarPanel" type="PanelContainer" parent="VBox/LayoutHBox"]
custom_minimum_size = Vector2(58, 0)
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_kkw0i")

[node name="ModuleButtonsVBox" type="VBoxContainer" parent="VBox/LayoutHBox/ModuleBarPanel"]
layout_mode = 2
theme = ExtResource("2_0bt5p")
theme_override_constants/separation = 10

[node name="MediaPoolButton" type="Button" parent="VBox/LayoutHBox/ModuleBarPanel/ModuleButtonsVBox"]
custom_minimum_size = Vector2(48, 48)
layout_mode = 2
tooltip_text = "TOOLTIP_MEDIA_POOL_PANEL_BUTTON"
toggle_mode = true
button_pressed = true
button_group = SubResource("ButtonGroup_64ioo")
icon = ExtResource("2_iyr7k")
expand_icon = true

[node name="EffectsButton" type="Button" parent="VBox/LayoutHBox/ModuleBarPanel/ModuleButtonsVBox"]
custom_minimum_size = Vector2(48, 48)
layout_mode = 2
tooltip_text = "TOOLTIP_EFFECTS_PANEL_BUTTON"
toggle_mode = true
button_group = SubResource("ButtonGroup_64ioo")
icon = ExtResource("3_sace5")
expand_icon = true

[node name="SubtitlesButton" type="Button" parent="VBox/LayoutHBox/ModuleBarPanel/ModuleButtonsVBox"]
custom_minimum_size = Vector2(48, 48)
layout_mode = 2
tooltip_text = "TOOLTIP_SUBTITLES_PANEL_BUTTON"
toggle_mode = true
button_group = SubResource("ButtonGroup_64ioo")
icon = ExtResource("4_g3rrh")
expand_icon = true

[node name="HSeparator" type="HSeparator" parent="VBox/LayoutHBox/ModuleBarPanel/ModuleButtonsVBox"]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/separator = SubResource("StyleBoxEmpty_5muqw")

[node name="RenderButton" type="Button" parent="VBox/LayoutHBox/ModuleBarPanel/ModuleButtonsVBox"]
custom_minimum_size = Vector2(48, 48)
layout_mode = 2
tooltip_text = "TOOLTIP_RENDER_MENU_BUTTON"

[node name="TextureRect" type="TextureRect" parent="VBox/LayoutHBox/ModuleBarPanel/ModuleButtonsVBox/RenderButton"]
self_modulate = Color(1, 0.0196078, 0, 1)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("7_wksug")
expand_mode = 3
stretch_mode = 3

[node name="MarginContainer" type="MarginContainer" parent="VBox/LayoutHBox"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 7
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 7

[node name="LayoutVSplit" type="VSplitContainer" parent="VBox/LayoutHBox/MarginContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme = ExtResource("7_ch834")

[node name="LayoutHSplit" type="HSplitContainer" parent="VBox/LayoutHBox/MarginContainer/LayoutVSplit"]
layout_mode = 2
size_flags_vertical = 3

[node name="ModulePanel" type="PanelContainer" parent="VBox/LayoutHBox/MarginContainer/LayoutVSplit/LayoutHSplit"]
unique_name_in_owner = true
clip_children = 2
layout_mode = 2
size_flags_horizontal = 3

[node name="ProjectViewPanel" type="PanelContainer" parent="VBox/LayoutHBox/MarginContainer/LayoutVSplit/LayoutHSplit"]
clip_children = 2
layout_mode = 2
size_flags_horizontal = 3

[node name="Content" type="Control" parent="Layout"]
[node name="Timeline" type="PanelContainer" parent="VBox/LayoutHBox/MarginContainer/LayoutVSplit"]
clip_children = 2
layout_mode = 2
size_flags_vertical = 3

[node name="StatusBar" parent="Layout" instance=ExtResource("20_ynsae")]
[node name="StatusBar" parent="VBox" instance=ExtResource("20_ynsae")]
layout_mode = 2

[node name="ResizeHandles" parent="." instance=ExtResource("5_d82ab")]
11 changes: 11 additions & 0 deletions src/editor/ui/editor_window/theme_layout_panels.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_resource type="Theme" load_steps=2 format=3 uid="uid://bb6sp1l2go5b8"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6ukox"]
bg_color = Color(0.207843, 0.207843, 0.207843, 1)
corner_radius_top_left = 21
corner_radius_top_right = 21
corner_radius_bottom_right = 21
corner_radius_bottom_left = 21

[resource]
PanelContainer/styles/panel = SubResource("StyleBoxFlat_6ukox")
Loading

0 comments on commit f96eb71

Please sign in to comment.