1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 01:29:49 +00:00

Use new window_title variable to change window's title

Will be used later to get the current window title. Godot doesn't seem to have a built-in way to get the window's title.
This commit is contained in:
OverloadedOrama 2020-02-22 17:21:52 +02:00
parent 52fa460876
commit eab3669eb2
3 changed files with 9 additions and 4 deletions

View file

@ -111,5 +111,5 @@ func _on_ImportSprites_files_selected(paths : PoolStringArray) -> void:
Global.canvas = Global.canvases[Global.canvases.size() - 1]
Global.canvas.visible = true
OS.set_window_title(first_path.get_file() + " (" + tr("imported") + ") - Pixelorama")
Global.window_title = first_path.get_file() + " (" + tr("imported") + ") - Pixelorama"

View file

@ -4,6 +4,7 @@ enum Pressure_Sensitivity {NONE, ALPHA, SIZE, ALPHA_AND_SIZE}
enum Brush_Types {PIXEL, CIRCLE, FILLED_CIRCLE, FILE, RANDOM_FILE, CUSTOM}
var root_directory := "."
var window_title := "" setget title_changed # Why doesn't Godot have get_window_title()?
var config_cache := ConfigFile.new()
# warning-ignore:unused_class_variable
var loaded_locales : Array
@ -471,6 +472,10 @@ func redo(_canvases : Array, layer_index : int = -1) -> void:
if control.redone:
notification_label("Redo: %s" % action_name)
func title_changed(value : String) -> void:
window_title = value
OS.set_window_title(value)
func frame_changed(value : int) -> void:
current_frame = value
current_frame_label.text = tr("Current frame:") + " %s/%s" % [str(current_frame + 1), canvases.size()]

View file

@ -161,7 +161,7 @@ func _ready() -> void:
else:
$ImportSprites._on_ImportSprites_files_selected([arg])
OS.set_window_title("(" + tr("untitled") + ") - Pixelorama")
Global.window_title = "(" + tr("untitled") + ") - Pixelorama"
Global.canvas.layers[0][2] = tr("Layer") + " 0"
Global.canvas.generate_layer_panels()
@ -484,7 +484,7 @@ func _on_OpenSprite_file_selected(path : String) -> void:
file_menu.set_item_text(2, tr("Save") + " %s" % path.get_file())
file_menu.set_item_text(5, tr("Export") + " %s" % $ExportSprites.current_path.get_file())
OS.set_window_title(path.get_file() + " - Pixelorama")
Global.window_title = path.get_file() + " - Pixelorama"
func _on_SaveSprite_file_selected(path : String) -> void:
@ -560,7 +560,7 @@ func clear_canvases() -> void:
$ExportSprites.current_export_path = ""
file_menu.set_item_text(2, "Save")
file_menu.set_item_text(5, "Export PNG...")
OS.set_window_title("(" + tr("untitled") + ") - Pixelorama")
Global.window_title = "(" + tr("untitled") + ") - Pixelorama"
Global.undo_redo.clear_history(false)
func _on_ImportSprites_popup_hide() -> void: