-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Adding button in tab bars #3291
Comments
Hello Richard, I thought we could modify I think instead we should add specific
This would allow implementing this behavior using a tab (and you can alter tab colors in the style if you want it to be red, etc). |
Hi Omar, thanks for the quick response. By the way, I had originally tried having a "+" tab after all the others. |
I've managed to devise a workaround for this: If I sort my tabs vector to be in the same order as the ImGui tabs display then the "+" button stays at the end after the last tabItem I call. I did the sorting by getting the tabbar tab offsets and names and copying the offset into my tab class. Obviously I'm having to access ImGui internals for this which is not ideal. Also I'm having to sort on every cycle as I don't know when the ordering is changed But for now its working OK for me. |
Hello Richard, |
Fantastic! |
You should not need to get a notification of change of ordering.
I'd rather work on allowing to preserve that order.
…On Tue, Jun 16, 2020 at 2:28 PM Richard Jackson ***@***.***> wrote:
Fantastic!
It would be great if you could also include some method of notifying a
change of ordering and getting the results
Thanks
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3291 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6YCIJBD2I6MKXSLFAY3KDRW5QQTANCNFSM4NYMHCWA>
.
|
Could it be preserved between app invocations? |
Well yes that's what we should aim for, but notice it is awkward to
preserve order without preserving visibility, and visibility is tied to
your code flow, so it's not easy to make something useful out of only
preserving order. Anyway this is another topic. If you want to manually
save order you can currently query structures in imgui_internal.h, but we
won't attempt to provide mid-way public API for this.
…On Tue, Jun 16, 2020 at 2:34 PM Richard Jackson ***@***.***> wrote:
Could it be preserved between app invocations?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3291 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6YCIME4LWOJZLKWSCEHL3RW5RGTANCNFSM4NYMHCWA>
.
|
OK, I understand, thanks for all the great stuff you do. |
Would it be possible to add a favicon to tab - maybe as a optional parameter to BeginTabItem? |
Use fonts icons as described in the docs. Let’s focus on one issue if you have more questions about this please ask on Discord or open a separate issue, thank you! |
…won't lag by an extra frame. Vaguely relate to underlying (uncommited) work for #3291
…emFlags_Trailing + demo. (#3291) (squashed various commits by 2 authors)
…s. + warning fixes + bunch of renaming. (#3291) Demo tweaks.
…h in TabBarLayout(). Misc amends, shortening. (#3291)
… shrinkable (unused yet) + don't unnecessarily move data within ShrinkWidthBuffer. (#3291)
This now has been implemented (it was surprisingly lots of work to get it right, done mostly by @Xipiryon, lots of corner cases, resizing/scrolling policy issues) You can now use Regular tabs can also be trailing/leading. The next thing in line is to allow to appends tab using multiple |
Appending to tab bar has been added a bit ago by the way, so closing this as all done. |
I am using a "+" button after a reorderable tab bar to add a new tab.
![image](https://user-images.githubusercontent.com/24891831/84030419-effb6600-a98b-11ea-896c-24bf7bb6001e.png)
if I move the last tab the button's position moves to after the moved tab instead of after the tab bar
![image](https://user-images.githubusercontent.com/24891831/84030575-33ee6b00-a98c-11ea-9f04-8a81c16ff0f7.png)
I'm using ImGui 1.75 included with https://github.com/jvcleave/ofxImGui
Here's the code outline - a tab is class which has a name variable and I keep the tabs in a C++ vector
`
`
The text was updated successfully, but these errors were encountered: