Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree node indent issue #1604

Closed
gsal opened this issue Feb 15, 2022 · 3 comments
Closed

Tree node indent issue #1604

gsal opened this issue Feb 15, 2022 · 3 comments
Labels
priority: low low priority state: ready Fixed/Added and will be present in an upcoming release type: bug bug

Comments

@gsal
Copy link

gsal commented Feb 15, 2022

Version of Dear PyGui

Version: 1.3.1
Operating System: Windows 10

My Issue/Question

Given a tree_node with indentation, when it is collapsed, it introduces indentation to the widget below it.

To Reproduce

Steps to reproduce the behavior:

  1. In the minimal example provided below
  2. Click on 'Tree node 1'
  3. Observed how 'Tree node 2' and 'Header 2' get dragged up and to the right (increased indentation)
  4. Click on 'Tree node 2'
  5. Observed how 'Header 2' gets dragged even more up and to the right

Expected behavior

I expected widgets below the tree_node to keep their own indentation.

Screenshots/Video

Initial state:
image

State after collapsing 'Tree node 1':
image

State after collapsing 'Tree node 2':
image

Standalone, minimal, complete and verifiable example

# Here's some code anyone can copy and paste to reproduce your issue
import dearpygui.dearpygui as dpg

indent = 20

dpg.create_context()
dpg.create_viewport(title='INDENT TROUBLE', width=480, height=600)
dpg.setup_dearpygui()

with dpg.window(label="Main", width=440, height=500, tag='win'):
    with dpg.collapsing_header(label="Header 1", default_open=True):
        with dpg.tree_node(label="Tree node 1", default_open=True, indent=indent):
            str="Number"
            dpg.add_input_int(label=str, width=240, tag=str)
        with dpg.tree_node(label="Tree node 2", default_open=True, indent=indent):
            str="Numero"
            dpg.add_input_int(label=str, width=240, tag=str)
    with dpg.collapsing_header(label="Header 2", default_open=True):
        pass
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
@gsal gsal added state: pending not addressed yet type: bug bug labels Feb 15, 2022
@hoffstadt
Copy link
Owner

Fixed in next release with this commit.

@hoffstadt hoffstadt added priority: low low priority state: ready Fixed/Added and will be present in an upcoming release and removed state: pending not addressed yet labels Feb 16, 2022
@gsal
Copy link
Author

gsal commented Feb 16, 2022

Downloaded fix.
Built package
Tested...it works

Thanks!

@gsal gsal closed this as completed Feb 16, 2022
@hoffstadt
Copy link
Owner

Nice to know! Didn't know we had users building it! Hopefully we didn't break anything since last release (we need to do more testing before next release)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low low priority state: ready Fixed/Added and will be present in an upcoming release type: bug bug
Projects
None yet
Development

No branches or pull requests

2 participants