Drag, Sliders: if the format string doesn't contain any %, when using CTRL+Click to input we use a default format. (#6405)

This commit is contained in:
ocornut
2023-05-09 12:04:04 +02:00
parent 70cca1eac0
commit 6cdedf5834
4 changed files with 16 additions and 7 deletions

View File

@ -631,7 +631,7 @@ static void ShowDemoWindowWidgets()
ImGui::Text("Tooltips:");
ImGui::SameLine();
ImGui::SmallButton("Button");
ImGui::SmallButton("Basic");
if (ImGui::IsItemHovered())
ImGui::SetTooltip("I am a tooltip");
@ -744,7 +744,7 @@ static void ShowDemoWindowWidgets()
static int elem = Element_Fire;
const char* elems_names[Element_COUNT] = { "Fire", "Earth", "Air", "Water" };
const char* elem_name = (elem >= 0 && elem < Element_COUNT) ? elems_names[elem] : "Unknown";
ImGui::SliderInt("slider enum", &elem, 0, Element_COUNT - 1, elem_name);
ImGui::SliderInt("slider enum", &elem, 0, Element_COUNT - 1, elem_name); // Use ImGuiSliderFlags_NoInput flag to disable CTRL+Click here.
ImGui::SameLine(); HelpMarker("Using the format string parameter to display a name instead of the underlying integer.");
}