mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
InputFloat: When using ImGuiInputTextFlags_ReadOnly the step buttons are disabled. (#2257)
This commit is contained in:
parent
6b97ded438
commit
c738f9ef92
3 changed files with 7 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue