You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a system in my editor that only saves values for my scene objects when the inputs are unfocused. Typically, I use ImGui::IsItemDeactivatedAfterEdit, which allows me to have live changes but not make too many file changes for the transient/active input states. This works well for normal inputs. However, color inputs also have a color picker popup that can be opened, which is something I really like but the behavior inside the popup is not desirable and not really consistent with the rest of my UI elements. When a color is picked inside the popup and the mouse click is released, Imgui sets the input as "deactivated after edit."
I am looking for a flag (e.g ImGuiColorEdit_FlagsNoDeactiveInsidePicker) or a way to determine if the picker is open and closed:
// store the value in temporary value firstImGui::ColorEdit4("Color", myColor);
if (isColorPickerOpen()) {
// do nothing if popup is open
} elseif (IsColorPickerIsClosedAfterBeingOpen() || ImGui::IsItemDeactivatedAfterEdit()) {
// check whether the popup is closed or the color input// was deactivated after typing directly to the main input// (not the one inside the picker)saveColor(myColor);
}
The text was updated successfully, but these errors were encountered:
Given how ColorEdit4("XXXX") does PushID("XXXX"); then BeginPopup("picker");
You should be able to call IsPopupOpen(GetID("XXXXpicker") from the same location as ColorEdit4().
but the behavior inside the popup is not desirable and not really consistent with the rest of my UI elements. When a color is picked inside the popup and the mouse click is released, Imgui sets the input as "deactivated after edit."
This happen with every widget, e.g. if you click and drag a slider/drag and release you'll get the "deactivated after edit" signal. So I believe it is consistent. You can see it in "Demo->Widgets>Querying Item Status".
This happen with every widget, e.g. if you click and drag a slider/drag and release you'll get the "deactivated after edit" signal. So I believe it is consistent. You can see it in "Demo->Widgets>Querying Item Status".
I meant it is consistent with Imgui behaviors but not with the behavior I am trying to achieve.
You should be able to call IsPopupOpen(GetID("XXXXpicker") from the same location as ColorEdit4().
Thank you for the tip, I'll play around with this and see how it works.
Version/Branch of Dear ImGui:
Version: docking
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: Custom + GLFW
Compiler: MSVC and LLVM
Operating System: Windows/macOS/Linux
My Issue/Question:
I have a system in my editor that only saves values for my scene objects when the inputs are unfocused. Typically, I use
ImGui::IsItemDeactivatedAfterEdit
, which allows me to have live changes but not make too many file changes for the transient/active input states. This works well for normal inputs. However, color inputs also have a color picker popup that can be opened, which is something I really like but the behavior inside the popup is not desirable and not really consistent with the rest of my UI elements. When a color is picked inside the popup and the mouse click is released, Imgui sets the input as "deactivated after edit."I am looking for a flag (e.g
ImGuiColorEdit_FlagsNoDeactiveInsidePicker
) or a way to determine if the picker is open and closed:The text was updated successfully, but these errors were encountered: