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

A horizontal group sticks to the previous line if the first child is hidden #1999

Closed
v-ein opened this issue Jan 5, 2023 · 1 comment · Fixed by #2002
Closed

A horizontal group sticks to the previous line if the first child is hidden #1999

v-ein opened this issue Jan 5, 2023 · 1 comment · Fixed by #2002
Labels

Comments

@v-ein
Copy link
Contributor

v-ein commented Jan 5, 2023

Version of Dear PyGui

Version: 1.8.0
Operating System: Windows 10

My Issue/Question

When the first child in a group(horizontal=True) is hidden, the group continues the previous line of widgets instead of starting a new line, as it normally would.

Normally, the first child in the group starts a new line; however, when it's hidden, its draw() method does nothing, and a subsequent call to to ImGui::SameLine() places the rest of widgets on the previous line.

To Reproduce

Steps to reproduce the behavior:

  1. Create an arbitrary widget.
  2. Create a group with horizontal=True and fill it with children.
  3. Hide the first child.
  4. Check the group position on the screen.

Expected behavior

The group should always start a new line unless it itself has been placed into a horizontal group.

Screenshots/Video

Current behavior. There are three horizontal groups, each containing text '12' and text '34'. In the second group, '12' is hidden.

image

Expected behavior:
image

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title="Test", width=500, height=400)

dpg.setup_dearpygui()
dpg.show_viewport()

with dpg.window(pos=(100, 100), width=300, height=200, no_title_bar=True):
    with dpg.group(horizontal=True):
        dpg.add_text("12")
        dpg.add_text("34")
    with dpg.group(horizontal=True):
        dpg.add_text("12", show=False)
        dpg.add_text("34")
    with dpg.group(horizontal=True):
        dpg.add_text("12")
        dpg.add_text("34")

dpg.start_dearpygui()
dpg.destroy_context()
@v-ein v-ein added state: pending not addressed yet type: bug bug labels Jan 5, 2023
@v-ein
Copy link
Contributor Author

v-ein commented Jan 5, 2023

Got a fix for this, going to open a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants