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

Remove unneeded layout code from TopMenuContainer

This commit is contained in:
Emmanouil Papadeas 2024-02-01 21:41:32 +02:00
parent 276a872f73
commit 606ce965f6

View file

@ -555,15 +555,9 @@ func _snap_to_submenu_id_pressed(id: int) -> void:
func _panels_submenu_id_pressed(id: int) -> void: func _panels_submenu_id_pressed(id: int) -> void:
if zen_mode: if zen_mode:
return return
var element_visible := panels_submenu.is_item_checked(id) var element_visible := panels_submenu.is_item_checked(id)
main_ui.set_control_hidden(ui_elements[id], element_visible) main_ui.set_control_hidden(ui_elements[id], element_visible)
panels_submenu.set_item_checked(id, !element_visible) panels_submenu.set_item_checked(id, !element_visible)
if main_ui.tabs_visible == false:
main_ui.tabs_visible = true
await get_tree().process_frame
await get_tree().process_frame
main_ui.tabs_visible = false
func _layouts_submenu_id_pressed(id: int) -> void: func _layouts_submenu_id_pressed(id: int) -> void:
@ -591,12 +585,6 @@ func set_layout(id: int) -> void:
zen_mode = false zen_mode = false
window_menu.set_item_checked(Global.WindowMenu.ZEN_MODE, false) window_menu.set_item_checked(Global.WindowMenu.ZEN_MODE, false)
# Hacky but without 2 idle frames it doesn't work properly. Should be replaced eventually
await get_tree().process_frame
await get_tree().process_frame
# Call set_tabs_visible to keep tabs visible if there are 2 or more in the same panel
main_ui.tabs_visible = main_ui.tabs_visible
func _toggle_greyscale_view() -> void: func _toggle_greyscale_view() -> void:
Global.greyscale_view = !Global.greyscale_view Global.greyscale_view = !Global.greyscale_view