|
@@ -2113,6 +2113,8 @@ bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v
|
|
|
}
|
|
|
if (g.ActiveId != id)
|
|
|
return false;
|
|
|
+ if (g.CurrentWindow->DC.ItemFlags & ImGuiItemFlags_ReadOnly)
|
|
|
+ return false;
|
|
|
|
|
|
switch (data_type)
|
|
|
{
|
|
@@ -2558,6 +2560,10 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
|
|
|
// It would be possible to lift that limitation with some work but it doesn't seem to be worth it for sliders.
|
|
|
bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, void* p_v, const void* p_min, const void* p_max, const char* format, float power, ImGuiSliderFlags flags, ImRect* out_grab_bb)
|
|
|
{
|
|
|
+ ImGuiContext& g = *GImGui;
|
|
|
+ if (g.CurrentWindow->DC.ItemFlags & ImGuiItemFlags_ReadOnly)
|
|
|
+ return false;
|
|
|
+
|
|
|
switch (data_type)
|
|
|
{
|
|
|
case ImGuiDataType_S8: { ImS32 v32 = (ImS32)*(ImS8*)p_v; bool r = SliderBehaviorT<ImS32, ImS32, float>(bb, id, ImGuiDataType_S32, &v32, *(const ImS8*)p_min, *(const ImS8*)p_max, format, power, flags, out_grab_bb); if (r) *(ImS8*)p_v = (ImS8)v32; return r; }
|