mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-17 21:56:36 +00:00
ColorPicker: Renamed _NoSliders to _NoInputs (#346)
This commit is contained in:
parent
eba33deaf3
commit
dd9c2f97a8
10
imgui.cpp
10
imgui.cpp
@ -9048,7 +9048,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
|
||||
flags |= ImGuiColorEditFlags_RGB;
|
||||
|
||||
// If we're not showing any slider there's no point in querying color mode, nor showing the options menu, nor doing any HSV conversions
|
||||
if (flags & ImGuiColorEditFlags_NoSliders)
|
||||
if (flags & ImGuiColorEditFlags_NoInputs)
|
||||
flags = (flags & (~ImGuiColorEditFlags_ModeMask_)) | ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_NoOptions;
|
||||
|
||||
// Read back edit mode from persistent storage
|
||||
@ -9071,7 +9071,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
|
||||
BeginGroup();
|
||||
PushID(label);
|
||||
|
||||
if ((flags & (ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_HSV)) != 0 && (flags & ImGuiColorEditFlags_NoSliders) == 0)
|
||||
if ((flags & (ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_HSV)) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0)
|
||||
{
|
||||
// RGB/HSV 0..255 Sliders
|
||||
const float w_items_all = w_full - square_sz_with_spacing;
|
||||
@ -9100,7 +9100,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
|
||||
PopItemWidth();
|
||||
PopItemWidth();
|
||||
}
|
||||
else if ((flags & ImGuiColorEditFlags_HEX) != 0 && (flags & ImGuiColorEditFlags_NoSliders) == 0)
|
||||
else if ((flags & ImGuiColorEditFlags_HEX) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0)
|
||||
{
|
||||
// RGB Hexadecimal Input
|
||||
const float w_slider_all = w_full - square_sz_with_spacing;
|
||||
@ -9130,7 +9130,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
|
||||
bool picker_active = false;
|
||||
if (!(flags & ImGuiColorEditFlags_NoColorSquare))
|
||||
{
|
||||
if (!(flags & ImGuiColorEditFlags_NoSliders))
|
||||
if (!(flags & ImGuiColorEditFlags_NoInputs))
|
||||
SameLine(0, style.ItemInnerSpacing.x);
|
||||
|
||||
const ImVec4 col_display(col[0], col[1], col[2], 1.0f);
|
||||
@ -9282,7 +9282,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
|
||||
ColorConvertHSVtoRGB(H >= 1.0f ? H - 10 * 1e-6f : H, S > 0.0f ? S : 10*1e-6f, V > 0.0f ? V : 1e-6f, col[0], col[1], col[2]);
|
||||
|
||||
// R,G,B and H,S,V slider color editor
|
||||
if (!(flags & ImGuiColorEditFlags_NoSliders))
|
||||
if (!(flags & ImGuiColorEditFlags_NoInputs))
|
||||
{
|
||||
if ((flags & ImGuiColorEditFlags_ModeMask_) == 0)
|
||||
ImGuiColorEditFlags sub_flags = (alpha ? ImGuiColorEditFlags_Alpha : 0) | ImGuiColorEditFlags_NoPicker | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_NoColorSquare;
|
||||
|
2
imgui.h
2
imgui.h
@ -670,7 +670,7 @@ enum ImGuiColorEditFlags_
|
||||
ImGuiColorEditFlags_NoPicker = 1 << 4, // ColorEdit: Disable picker when clicking on colored square
|
||||
ImGuiColorEditFlags_NoOptions = 1 << 5, // ColorEdit: Disable toggling options menu when right-clicking colored square
|
||||
ImGuiColorEditFlags_NoColorSquare = 1 << 6, // ColorEdit: Disable colored square
|
||||
ImGuiColorEditFlags_NoSliders = 1 << 7, // ColorEdit: Disable sliders, show only a button. ColorPicker: Disable all RGB/HSV/HEX sliders.
|
||||
ImGuiColorEditFlags_NoInputs = 1 << 7, // ColorEdit: Disable inputs sliders/text edit, show only a button. ColorPicker: Disable all RGB/HSV/HEX sliders.
|
||||
ImGuiColorEditFlags_ModeMask_ = ImGuiColorEditFlags_RGB|ImGuiColorEditFlags_HSV|ImGuiColorEditFlags_HEX
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user