-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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 ImGuiTabItemFlags that is like ImGuiTabItemFlags_UnsavedDocument but not exactly the same #7084
Comments
EDITS: update from ImGuiWindowFlags to ImGuiTabItemFlags |
You can already detect closure on TabItem() return and decide to not close the tab and show a modal. |
I am sorry, I should have said that I am using imgui public API (i.e. |
TabItem() is called by |
sorry in advance for the c# code. yes, you are right I can do that (as shown in the code below)
However, (1) Once I check this happens because by default in the TAB API "closure is assumed" (as mentioned in the imgui docs as well) if I use the following code, tab doesn't move to the end of the tab bar because closure isn't assumed.
==Screenshots For Proof of (1)== starting tab position pressing X on tab2 tab2 is now on the far right. |
hence the |
My bad, I thought there was a call to mark the tab as reopened but it's not possible presently. I think you are right and maybe the best solution is to introduce a flag. |
I have added the |
Thank you, i will test it once there is a release. I don’t think so cherrypick is required, that info in the first post might be wrong. |
EDIT: ignore my last comment, I want this in docking but not immediately (when new release is out). :) |
Thank you. I fixed it and amended the release Changelog with that missing bit indeed! |
Version/Branch of Dear ImGui:
Version: v1.90
Branch: docking
My Issue/Question:
Currently ImGuiTabItemFlags_UnsavedDocument is doing 2 things
1: assuming document isn't saved and displaying dot next to the title.
2: tab is selected when clicking the X and closure is not assumed
while this is a perfectly fine usecase for unsaved documents.
my use-case is a bit different, I basically want to ask the user if they really want to close the tab or not
for this use-case (1) isn't necessary i.e. no need to always display a dot on the tab
Following are the screenshot of my usecase
here is me allowing users to add/remove a tab by pressing X (or + sign). You can see all tabs have dot, which isn't required
here is me asking the user (via popup) do you really wanna close the tab after user press X. (to mitigate accidents)
so TLDR: Would be nice if we keep
ImGuiTabItemFlags_UnsavedDocument
as is however introduces a new flag (e.g.ImGuiTabItemFlags_DoNotAssumeClosure
) so folks who want to use just (2) can do that.Thank you for the amazing lib,
Cheers!
The text was updated successfully, but these errors were encountered: