mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
InputFloat: When using ImGuiInputTextFlags_ReadOnly the step buttons are disabled. (#2257)
This commit is contained in:
@ -2666,14 +2666,17 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* data_p
|
||||
PopItemWidth();
|
||||
|
||||
// Step buttons
|
||||
ImGuiButtonFlags button_flags = ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups;
|
||||
if (extra_flags & ImGuiInputTextFlags_ReadOnly)
|
||||
button_flags |= ImGuiButtonFlags_Disabled;
|
||||
SameLine(0, style.ItemInnerSpacing.x);
|
||||
if (ButtonEx("-", ImVec2(button_size, button_size), ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups))
|
||||
if (ButtonEx("-", ImVec2(button_size, button_size), button_flags))
|
||||
{
|
||||
DataTypeApplyOp(data_type, '-', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast ? step_fast : step);
|
||||
value_changed = true;
|
||||
}
|
||||
SameLine(0, style.ItemInnerSpacing.x);
|
||||
if (ButtonEx("+", ImVec2(button_size, button_size), ImGuiButtonFlags_Repeat | ImGuiButtonFlags_DontClosePopups))
|
||||
if (ButtonEx("+", ImVec2(button_size, button_size), button_flags))
|
||||
{
|
||||
DataTypeApplyOp(data_type, '+', data_ptr, data_ptr, g.IO.KeyCtrl && step_fast ? step_fast : step);
|
||||
value_changed = true;
|
||||
|
Reference in New Issue
Block a user