ColorEdit, ColorPicker: Manipulating options popup don't mark item as edited. (#6722)

This commit is contained in:
ocornut
2023-08-25 22:48:16 +02:00
parent f617fe7890
commit 33ea1e8b78
4 changed files with 10 additions and 0 deletions

View File

@ -5884,6 +5884,7 @@ void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags)
if ((!allow_opt_inputs && !allow_opt_datatype) || !BeginPopup("context"))
return;
ImGuiContext& g = *GImGui;
g.LockMarkEdited++;
ImGuiColorEditFlags opts = g.ColorEditOptions;
if (allow_opt_inputs)
{
@ -5926,6 +5927,7 @@ void ImGui::ColorEditOptionsPopup(const float* col, ImGuiColorEditFlags flags)
g.ColorEditOptions = opts;
EndPopup();
g.LockMarkEdited--;
}
void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags flags)
@ -5935,6 +5937,7 @@ void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags fl
if ((!allow_opt_picker && !allow_opt_alpha_bar) || !BeginPopup("context"))
return;
ImGuiContext& g = *GImGui;
g.LockMarkEdited++;
if (allow_opt_picker)
{
ImVec2 picker_size(g.FontSize * 8, ImMax(g.FontSize * 8 - (GetFrameHeight() + g.Style.ItemInnerSpacing.x), 1.0f)); // FIXME: Picker size copied from main picker function
@ -5964,6 +5967,7 @@ void ImGui::ColorPickerOptionsPopup(const float* ref_col, ImGuiColorEditFlags fl
CheckboxFlags("Alpha Bar", &g.ColorEditOptions, ImGuiColorEditFlags_AlphaBar);
}
EndPopup();
g.LockMarkEdited--;
}
//-------------------------------------------------------------------------