mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-30 22:05:46 +08:00
Merge branch 'master' into docking
This commit is contained in:
@@ -293,6 +293,8 @@ Other changes:
|
|||||||
to be a valid low-level texture identifier.
|
to be a valid low-level texture identifier.
|
||||||
- Debug Tools: Fonts section: add font preview, add "Remove" button, add "Load all glyphs"
|
- Debug Tools: Fonts section: add font preview, add "Remove" button, add "Load all glyphs"
|
||||||
button, add selection to change font backend when both are compiled in.
|
button, add selection to change font backend when both are compiled in.
|
||||||
|
- Special thanks for fonts/texture related feedback to: @thedmd, @ShironekoBen, @rodrigorc,
|
||||||
|
@pathogendavid, @itamago, @rokups, @DucaRii, @Aarkham, @cyfewlp.
|
||||||
|
|
||||||
- IO: variations in analog-only components of gamepad events do not interfere
|
- IO: variations in analog-only components of gamepad events do not interfere
|
||||||
with trickling of mouse position events (#4921, #8508)
|
with trickling of mouse position events (#4921, #8508)
|
||||||
|
|||||||
@@ -510,7 +510,6 @@ CODE
|
|||||||
- Prefer adding a font source (ImFontConfig) using a custom/procedural loader.
|
- Prefer adding a font source (ImFontConfig) using a custom/procedural loader.
|
||||||
- DrawList: Renamed ImDrawList::PushTextureID()/PopTextureID() to PushTexture()/PopTexture().
|
- DrawList: Renamed ImDrawList::PushTextureID()/PopTextureID() to PushTexture()/PopTexture().
|
||||||
- Backends: removed ImGui_ImplXXXX_CreateFontsTexture()/ImGui_ImplXXXX_DestroyFontsTexture() for all backends that had them. They should not be necessary any more.
|
- Backends: removed ImGui_ImplXXXX_CreateFontsTexture()/ImGui_ImplXXXX_DestroyFontsTexture() for all backends that had them. They should not be necessary any more.
|
||||||
>>>>>>> master
|
|
||||||
- 2025/05/23 (1.92.0) - Fonts: changed ImFont::CalcWordWrapPositionA() to ImFont::CalcWordWrapPosition()
|
- 2025/05/23 (1.92.0) - Fonts: changed ImFont::CalcWordWrapPositionA() to ImFont::CalcWordWrapPosition()
|
||||||
- old: const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, ....);
|
- old: const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, ....);
|
||||||
- new: const char* ImFont::CalcWordWrapPosition (float size, const char* text, ....);
|
- new: const char* ImFont::CalcWordWrapPosition (float size, const char* text, ....);
|
||||||
@@ -21584,7 +21583,7 @@ void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
|
|||||||
if (loader_current == loader_freetype)
|
if (loader_current == loader_freetype)
|
||||||
{
|
{
|
||||||
unsigned int loader_flags = atlas->FontLoaderFlags;
|
unsigned int loader_flags = atlas->FontLoaderFlags;
|
||||||
Text("Shared FreeType Loader Flags: 0x%08", loader_flags);
|
Text("Shared FreeType Loader Flags: 0x%08X", loader_flags);
|
||||||
if (ImGuiFreeType::DebugEditFontLoaderFlags(&loader_flags))
|
if (ImGuiFreeType::DebugEditFontLoaderFlags(&loader_flags))
|
||||||
{
|
{
|
||||||
for (ImFont* font : atlas->Fonts)
|
for (ImFont* font : atlas->Fonts)
|
||||||
@@ -23602,6 +23601,40 @@ void ImGui::DebugHookIdInfo(ImGuiID, ImGuiDataType, const void*, const void*) {}
|
|||||||
|
|
||||||
#endif // #ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
#endif // #ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||||
|
|
||||||
|
#if !defined(IMGUI_DISABLE_DEMO_WINDOWS) || !defined(IMGUI_DISABLE_DEBUG_TOOLS)
|
||||||
|
// Demo helper function to select among loaded fonts.
|
||||||
|
// Here we use the regular BeginCombo()/EndCombo() api which is the more flexible one.
|
||||||
|
void ImGui::ShowFontSelector(const char* label)
|
||||||
|
{
|
||||||
|
ImGuiIO& io = GetIO();
|
||||||
|
ImFont* font_current = GetFont();
|
||||||
|
if (BeginCombo(label, font_current->GetDebugName()))
|
||||||
|
{
|
||||||
|
for (ImFont* font : io.Fonts->Fonts)
|
||||||
|
{
|
||||||
|
PushID((void*)font);
|
||||||
|
if (Selectable(font->GetDebugName(), font == font_current))
|
||||||
|
io.FontDefault = font;
|
||||||
|
if (font == font_current)
|
||||||
|
SetItemDefaultFocus();
|
||||||
|
PopID();
|
||||||
|
}
|
||||||
|
EndCombo();
|
||||||
|
}
|
||||||
|
SameLine();
|
||||||
|
if (io.BackendFlags & ImGuiBackendFlags_RendererHasTextures)
|
||||||
|
MetricsHelpMarker(
|
||||||
|
"- Load additional fonts with io.Fonts->AddFontXXX() functions.\n"
|
||||||
|
"- Read FAQ and docs/FONTS.md for more details.");
|
||||||
|
else
|
||||||
|
MetricsHelpMarker(
|
||||||
|
"- Load additional fonts with io.Fonts->AddFontXXX() functions.\n"
|
||||||
|
"- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n"
|
||||||
|
"- Read FAQ and docs/FONTS.md for more details.\n"
|
||||||
|
"- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame().");
|
||||||
|
}
|
||||||
|
#endif // #if !defined(IMGUI_DISABLE_DEMO_WINDOWS) || !defined(IMGUI_DISABLE_DEBUG_TOOLS)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Include imgui_user.inl at the end of imgui.cpp to access private data/functions that aren't exposed.
|
// Include imgui_user.inl at the end of imgui.cpp to access private data/functions that aren't exposed.
|
||||||
|
|||||||
+3
-36
@@ -8273,43 +8273,10 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// [SECTION] Style Editor / ShowStyleEditor()
|
// [SECTION] Style Editor / ShowStyleEditor()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// - ShowFontSelector()
|
|
||||||
// - ShowStyleSelector()
|
// - ShowStyleSelector()
|
||||||
// - ShowStyleEditor()
|
// - ShowStyleEditor()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Demo helper function to select among loaded fonts.
|
|
||||||
// Here we use the regular BeginCombo()/EndCombo() api which is the more flexible one.
|
|
||||||
void ImGui::ShowFontSelector(const char* label)
|
|
||||||
{
|
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
|
||||||
ImFont* font_current = ImGui::GetFont();
|
|
||||||
if (ImGui::BeginCombo(label, font_current->GetDebugName()))
|
|
||||||
{
|
|
||||||
for (ImFont* font : io.Fonts->Fonts)
|
|
||||||
{
|
|
||||||
ImGui::PushID((void*)font);
|
|
||||||
if (ImGui::Selectable(font->GetDebugName(), font == font_current))
|
|
||||||
io.FontDefault = font;
|
|
||||||
if (font == font_current)
|
|
||||||
ImGui::SetItemDefaultFocus();
|
|
||||||
ImGui::PopID();
|
|
||||||
}
|
|
||||||
ImGui::EndCombo();
|
|
||||||
}
|
|
||||||
ImGui::SameLine();
|
|
||||||
if (io.BackendFlags & ImGuiBackendFlags_RendererHasTextures)
|
|
||||||
HelpMarker(
|
|
||||||
"- Load additional fonts with io.Fonts->AddFontXXX() functions.\n"
|
|
||||||
"- Read FAQ and docs/FONTS.md for more details.");
|
|
||||||
else
|
|
||||||
HelpMarker(
|
|
||||||
"- Load additional fonts with io.Fonts->AddFontXXX() functions.\n"
|
|
||||||
"- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n"
|
|
||||||
"- Read FAQ and docs/FONTS.md for more details.\n"
|
|
||||||
"- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame().");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Demo helper function to select among default colors. See ShowStyleEditor() for more advanced options.
|
// Demo helper function to select among default colors. See ShowStyleEditor() for more advanced options.
|
||||||
// Here we use the simplified Combo() api that packs items into a single literal string.
|
// Here we use the simplified Combo() api that packs items into a single literal string.
|
||||||
// Useful for quick combo boxes where the choices are known locally.
|
// Useful for quick combo boxes where the choices are known locally.
|
||||||
@@ -11112,9 +11079,9 @@ void ImGui::ShowAboutWindow(bool*) {}
|
|||||||
void ImGui::ShowDemoWindow(bool*) {}
|
void ImGui::ShowDemoWindow(bool*) {}
|
||||||
void ImGui::ShowUserGuide() {}
|
void ImGui::ShowUserGuide() {}
|
||||||
void ImGui::ShowStyleEditor(ImGuiStyle*) {}
|
void ImGui::ShowStyleEditor(ImGuiStyle*) {}
|
||||||
bool ImGui::ShowStyleSelector(const char* label) { return false; }
|
bool ImGui::ShowStyleSelector(const char*) { return false; }
|
||||||
void ImGui::ShowFontSelector(const char* label) {}
|
void ImGui::ShowFontSelector(const char*) {}
|
||||||
|
|
||||||
#endif
|
#endif // #ifndef IMGUI_DISABLE_DEMO_WINDOWS
|
||||||
|
|
||||||
#endif // #ifndef IMGUI_DISABLE
|
#endif // #ifndef IMGUI_DISABLE
|
||||||
|
|||||||
+1
-1
@@ -6920,7 +6920,7 @@ void ImGui::TreeNodeDrawLineToChildNode(const ImVec2& target_pos)
|
|||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
ImGuiWindow* window = g.CurrentWindow;
|
ImGuiWindow* window = g.CurrentWindow;
|
||||||
if ((window->DC.TreeHasStackDataDepthMask & (1 << (window->DC.TreeDepth - 1))) == 0)
|
if (window->DC.TreeDepth == 0 || (window->DC.TreeHasStackDataDepthMask & (1 << (window->DC.TreeDepth - 1))) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImGuiTreeNodeStackData* parent_data = &g.TreeNodeStack.Data[g.TreeNodeStack.Size - 1];
|
ImGuiTreeNodeStackData* parent_data = &g.TreeNodeStack.Data[g.TreeNodeStack.Size - 1];
|
||||||
|
|||||||
Reference in New Issue
Block a user