diff --git a/addons/README.md b/addons/README.md index 072bbb54f..199147be3 100644 --- a/addons/README.md +++ b/addons/README.md @@ -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) diff --git a/addons/dockable_container/dockable_container.gd b/addons/dockable_container/dockable_container.gd index a3edf2983..fdeaacb1e 100644 --- a/addons/dockable_container/dockable_container.gd +++ b/addons/dockable_container/dockable_container.gd @@ -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: diff --git a/src/UI/TopMenuContainer.gd b/src/UI/TopMenuContainer.gd index 50375d509..571c834f8 100644 --- a/src/UI/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer.gd @@ -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