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

Add Combo flag to allow left alignment of arrow button #2328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hartcw
Copy link

@hartcw hartcw commented Jan 31, 2019

This is a minor feature for the ImGui::Combo() widget.

It adds a new ImGuiComboFlag, to control whether the arrow button is aligned to the left or the right side of the widget.

Also updated the demo window.

Attached screenshot from my app, showing it in action.

arrowalignleft

@ocornut
Copy link
Owner

ocornut commented Jan 31, 2019

Hello Francis,
Why did you feel the need to invert this order? Seeing in particular even the other UI of your app is using same order as default.

This feels like something which could be part of the style rather than being a flag passed on each instance of Combo box.

@hartcw
Copy link
Author

hartcw commented Feb 1, 2019

Why did you feel the need to invert this order? Seeing in particular even the other UI of your app is using same order as default.

In the imgui part of the app, I'm using a Combo() at the top of each "panel". This allows the user to switch what type of content that is displayed in that panel. Visually it looked better to left-align the arrow, because then its sits at the very top-left of each panel. I was planning to do it just for those particular combos, and use right-aligned arrows for other ones.

The app is still in development, so things may still change!

This feels like something which could be part of the style rather than being a flag passed on each instance of Combo box.

Yes sure, that would work too. I added it as a flag as this was the least amount of code to touch.

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 this pull request may close these issues.

2 participants