mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
BeginTooltip: Added 'bool' return value to BeginTooltip() for API consistency. Updated demo.
Add SetWindowHiddendAndSkipItemsForCurrentFrame().
This commit is contained in:
@ -211,9 +211,8 @@ static void ShowDemoWindowInputs();
|
||||
static void HelpMarker(const char* desc)
|
||||
{
|
||||
ImGui::TextDisabled("(?)");
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort))
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort) && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
|
||||
ImGui::TextUnformatted(desc);
|
||||
ImGui::PopTextWrapPos();
|
||||
@ -629,9 +628,8 @@ static void ShowDemoWindowWidgets()
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SmallButton("Fancy");
|
||||
if (ImGui::IsItemHovered())
|
||||
if (ImGui::IsItemHovered() && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text("I am a fancy tooltip");
|
||||
static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
|
||||
ImGui::PlotLines("Curve", arr, IM_ARRAYSIZE(arr));
|
||||
@ -1047,9 +1045,8 @@ static void ShowDemoWindowWidgets()
|
||||
ImVec4 tint_col = use_text_color_for_tint ? ImGui::GetStyleColorVec4(ImGuiCol_Text) : ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint
|
||||
ImVec4 border_col = ImGui::GetStyleColorVec4(ImGuiCol_Border);
|
||||
ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), uv_min, uv_max, tint_col, border_col);
|
||||
if (ImGui::IsItemHovered())
|
||||
if (ImGui::IsItemHovered() && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
float region_sz = 32.0f;
|
||||
float region_x = io.MousePos.x - pos.x - region_sz * 0.5f;
|
||||
float region_y = io.MousePos.y - pos.y - region_sz * 0.5f;
|
||||
@ -3722,9 +3719,8 @@ static void EditTableSizingFlags(ImGuiTableFlags* p_flags)
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled("(?)");
|
||||
if (ImGui::IsItemHovered())
|
||||
if (ImGui::IsItemHovered() && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 50.0f);
|
||||
for (int m = 0; m < IM_ARRAYSIZE(policies); m++)
|
||||
{
|
||||
@ -6318,10 +6314,11 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
|
||||
// When editing the "Circle Segment Max Error" value, draw a preview of its effect on auto-tessellated circles.
|
||||
ImGui::DragFloat("Circle Tessellation Max Error", &style.CircleTessellationMaxError , 0.005f, 0.10f, 5.0f, "%.2f", ImGuiSliderFlags_AlwaysClamp);
|
||||
if (ImGui::IsItemActive())
|
||||
{
|
||||
const bool show_samples = ImGui::IsItemActive();
|
||||
if (show_samples)
|
||||
ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos());
|
||||
ImGui::BeginTooltip();
|
||||
if (show_samples && ImGui::BeginTooltip())
|
||||
{
|
||||
ImGui::TextUnformatted("(R = radius, N = number of segments)");
|
||||
ImGui::Spacing();
|
||||
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||
|
Reference in New Issue
Block a user