Giter Site home page Giter Site logo

gilzoide / godot-dockable-container Goto Github PK

View Code? Open in Web Editor NEW
168.0 9.0 16.0 15.93 MB

Dockable/tiling UI panels Container addon for Godot

License: Creative Commons Zero v1.0 Universal

GDScript 100.00%
godot godot-addon docking-layout gui tiling-layout tiling

godot-dockable-container's Introduction

Dockable Container

Warning

This branch is only usable with Godot 4.X. For Godot 3.X support, check out the godot-3 branch.

Docking/tiling UI panels Container addon for Godot.

It is composed of a Container script and layout Resources in a binary tree structure that store panels division direction and size as well as tab names and what tab index is currently selected. As layout information are Resources, it's easy to save/load them.

Child Controls are only moved visually and have their NodePaths and position in parent maintained.

Available at the Asset Library.

Live preview a sample scene here.

Plugin

Enable Dockable Container plugin at Project -> Project Settings -> Plugin to edit the layout directly in the inspector! It also registers the DockableContainer node type.

Theming

Panels are actual TabContainer instances, split handles use VSplitContainer and HSplitContainer theme configurations, drop preview uses TooltipPanel/panel StyleBox. Tabs alignment and rearrange group are exported in DockableContainer.

TODO

  • Add way to specify icon and custom name for tabs, based on a property or method on children
  • Document better how to use

Credits

Node icon made by Nif-kun. Licensed under CC0.

godot-dockable-container's People

Contributors

gil-reis-supercompany avatar gilzoide avatar mrtripie avatar nif-kun avatar overloadedorama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godot-dockable-container's Issues

Dockable container is blocking mouse input to area nodes in a child viewport

I'm using this plugin for some of my UI layout, and some of my panels have 3D viewports in them. In the 3D scene, I have Area nodes that have mouse_entered and mouse_exited signals on them. When I nest these viewports in a DockableContainer, the areas do not trigger the signal, even when the DockableContainer mouse filter is set to "Ignore". My hunch is that this is because the dockable container uses some tab and split containers, and when the dockable containers mouse ignore setting is changed, it is not propagating to the sub-containers.

Steps to reproduce:

  1. Create a viewport container, with a viewport. In the viewport you need a 3D scene, with Areas and Colliders.
  2. Nest the viewport container in something like a margin container.
  3. Set margin container and viewport container mouse filters to "Ignore"
  4. Set the viewport "object picking" to on.
  5. Connect the mouse_entered and mouse_exited signals from the Area to a script in the Margin Container.
  6. Preview the scene, hovering the mouse over the collider will trigger whatever you put in the connected function...
  7. Create a new margin container with dockable container child, put this at the top of the scene tree. Nest the original margin container with viewport onto the dockable container node.
  8. Set the new margin container and dockable container mouse filter mode to "ignore"
  9. Preview the scene. The signals will no longer trigger when mouse hovers over the area.

Multiple dockable containers

Can you add support for multiple containers ?
This will be useful for creating layouts where some parts are dockable and can be moved around and some parts are static. Ability to move panels from one container to another will be great!

Child Reposition Issue

Issue

Example

Conditions to occur

  1. Place three (3) nodes of control type inside DockerContainer.
  2. Follow the layout (make sure the node on the bottom-right side is at the very edge):
    example2
  3. Bottom-right node must have a minimum width, I've set mine to 275.
  4. Turn off Tab Visible of DockerContainer.
  5. Change the theme and replace the TabContainer panel style to either StyleBoxEmpty, StyleBoxFlat, or StyleBoxTexture.
  6. Run and try to resize the window.

Note

  • If the bottom-right node does not have a minimum size, the issue does not occur.
  • If the bottom-right node's layout has the exact(?) or larger size than it's minimum size, the issue does not occur.
  • If the Tab Visible is turned on, the issue does not occur; Regardless of minimum size, layout, or TabContainer panel style.
  • If the TabContainer panel style is a StyleBoxLine, the issue does not occur. However, it will occur if the StyleBoxLine's thickness is below one(1). This is my current solution to the problem.
  • Resizing the window vertically fixes the reposition issue.

Error occurs when exiting the scene

Take the TestScene.tscn in samples folder for example, run the scene in godot and everything works fine, but after click the close button, Godot console prints below message:
bug
Thanks for any help.

Container resizing Issues

Resizing containers in a column or row is not intuitive/straightforward.

2022-07-30.22-54-40.mp4

As you can see from this, trying to resize one container leads to size change in some other container.
This is probably because of the tree-type nature of organizing containers. Can this be changed so that other containers are not affected when resizing ?

Move to new Window

Could you add the function that you can move the containers to new windows with the size that the container had before (and back again)?

Multible Windows come in Godot 4.0 or 4.1.

"Dockable Container Layout" resource type is available in all "new resource" dropdown menus

Fantastic plugin! Not urgent bug at all.

Now that I've added dockable containers to my project, every single menu where I can select a resource, "dockable container layouts" appears as one of the options, even when it would clearly break the object.

Here it is as an option for MeshInstance:
godot windows tools 64glTFImportBuild_Us9HVLfD2O

I don't think this needs a workaround or anything, it just looks like it may be a simple fix, so I brought it to your attention.
Thank you for the great tool!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.