1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 09:09:47 +00:00

Make panel tabs always visible if there are 2 or more tabs in a single panel

This commit is contained in:
Manolis Papadeas 2022-03-12 20:46:17 +02:00
parent 6d641259d5
commit 5d3963d495
3 changed files with 12 additions and 2 deletions

View file

@ -12,5 +12,5 @@ Files extracted from source:
## godot-dockable-container
- Upstream: https://github.com/gilzoide/godot-dockable-container
- Version: git (c0c631d27178923d28d8631b0116f4efad2cb360, 2022)
- Version: custom
- License: [CC0-1.0](https://github.com/gilzoide/godot-dockable-container/blob/main/LICENSE)

View file

@ -178,7 +178,11 @@ func set_tabs_visible(value: bool) -> void:
_tabs_visible = value
for i in range(1, _panel_container.get_child_count()):
var panel = _panel_container.get_child(i)
panel.tabs_visible = value
if panel.get_tab_count() >= 2:
panel.tabs_visible = true
else:
panel.tabs_visible = value
queue_sort()
func get_tabs_visible() -> bool:

View file

@ -522,6 +522,12 @@ func set_layout(id: int) -> void:
zen_mode = false
window_menu.set_item_checked(WindowMenuId.ZEN_MODE, false)
# Hacky but without 2 idle frames it doesn't work properly. Should be replaced eventually
yield(get_tree(), "idle_frame")
yield(get_tree(), "idle_frame")
# Call set_tabs_visible to keep tabs visible if there are 2 or more in the same panel
ui.tabs_visible = ui.tabs_visible
func _toggle_greyscale_view() -> void:
Global.greyscale_view = !Global.greyscale_view