Update window title with current shader filename - implements #22
This commit is contained in:
parent
1aa217776c
commit
bbbd35f26d
2 changed files with 15 additions and 4 deletions
12
src/Main.gd
12
src/Main.gd
|
@ -1,13 +1,21 @@
|
|||
extends Node
|
||||
|
||||
@onready var editor_window = %EditorWindow
|
||||
@onready var app_name = ProjectSettings.get_setting("application/config/name")
|
||||
|
||||
func _ready():
|
||||
update_title()
|
||||
# position windows
|
||||
get_window().position = Vector2i(
|
||||
editor_window.position.x + editor_window.size.x + 50,
|
||||
editor_window.position.y)
|
||||
get_window().title = ProjectSettings.get_setting("application/config/name") + " - Viewer"
|
||||
get_window().min_size = Vector2i(400, 400)
|
||||
editor_window.title = ProjectSettings.get_setting("application/config/name") + " - Editor"
|
||||
editor_window.min_size = Vector2i(560, 400)
|
||||
|
||||
func update_title(current_file: String = ""):
|
||||
if current_file == "":
|
||||
get_window().title = app_name + " - Viewer"
|
||||
editor_window.title = app_name + " - Editor"
|
||||
else:
|
||||
get_window().title = current_file + " - " + app_name + " - Viewer"
|
||||
editor_window.title = current_file + " - " + app_name + " - Editor"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue