mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-16 18:24:49 +00:00
Windows: Child windows with only ImGuiChildFlags_AutoResizeY flag keep using the proportional default ItemWidth. (#9355)
+ Removed Tooltip flag check, it's from 8c4fcf1359 (!) where AlwaysAutoReszie was added after Tooltip. Nowadays Tooltips sets ImGuiChildFlags_AlwaysAutoResize.
This commit is contained in:
@@ -55,6 +55,8 @@ Other Changes:
|
|||||||
- Fixed a single-axis auto-resizing feedback loop issue with nested containers
|
- Fixed a single-axis auto-resizing feedback loop issue with nested containers
|
||||||
and varying scrollbar visibility. (#9352)
|
and varying scrollbar visibility. (#9352)
|
||||||
- Detect and report error when calling End() instead of EndPopup() on a popup. (#9351)
|
- Detect and report error when calling End() instead of EndPopup() on a popup. (#9351)
|
||||||
|
- Child windows with only ImGuiChildFlags_AutoResizeY flag keep using the proportional
|
||||||
|
default ItemWidth. (#9355)
|
||||||
- Fonts:
|
- Fonts:
|
||||||
- imgui_freetype: add FreeType headers & compiled version in 'About Dear ImGui' details.
|
- imgui_freetype: add FreeType headers & compiled version in 'About Dear ImGui' details.
|
||||||
- Clipper:
|
- Clipper:
|
||||||
|
|||||||
13
imgui.cpp
13
imgui.cpp
@@ -6436,7 +6436,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, I
|
|||||||
window_flags |= ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_NoTitleBar;
|
window_flags |= ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_NoTitleBar;
|
||||||
window_flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag
|
window_flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag
|
||||||
if (child_flags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize))
|
if (child_flags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize))
|
||||||
window_flags |= ImGuiWindowFlags_AlwaysAutoResize;
|
window_flags |= ImGuiWindowFlags_AlwaysAutoResize; // FIXME: Would be sane to not make single-axis flag set this. (#9355)
|
||||||
if ((child_flags & (ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY)) == 0)
|
if ((child_flags & (ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY)) == 0)
|
||||||
window_flags |= ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings;
|
window_flags |= ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings;
|
||||||
|
|
||||||
@@ -8035,9 +8035,14 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
window->DC.LayoutType = ImGuiLayoutType_Vertical;
|
window->DC.LayoutType = ImGuiLayoutType_Vertical;
|
||||||
window->DC.ParentLayoutType = parent_window ? parent_window->DC.LayoutType : ImGuiLayoutType_Vertical;
|
window->DC.ParentLayoutType = parent_window ? parent_window->DC.LayoutType : ImGuiLayoutType_Vertical;
|
||||||
|
|
||||||
// Default item width. Make it proportional to window size if window manually resizes
|
// Default item width. Make it proportional to window size if window can be manually resized.
|
||||||
const bool is_resizable_window = (window->Size.x > 0.0f && !(flags & ImGuiWindowFlags_Tooltip) && !(flags & ImGuiWindowFlags_AlwaysAutoResize));
|
// (we cannot use AutoFitFramesX/AutoFitFramesY which is a temporary state)
|
||||||
if (is_resizable_window)
|
bool is_resizable_width;
|
||||||
|
if (flags & ImGuiWindowFlags_ChildWindow)
|
||||||
|
is_resizable_width = (window->Size.x > 0.0f) && !(window->ChildFlags & (ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AlwaysAutoResize));
|
||||||
|
else
|
||||||
|
is_resizable_width = (window->Size.x > 0.0f) && !(flags & ImGuiWindowFlags_AlwaysAutoResize);
|
||||||
|
if (is_resizable_width)
|
||||||
window->DC.ItemWidthDefault = ImTrunc(window->Size.x * 0.65f);
|
window->DC.ItemWidthDefault = ImTrunc(window->Size.x * 0.65f);
|
||||||
else
|
else
|
||||||
window->DC.ItemWidthDefault = ImTrunc(g.FontSize * 16.0f);
|
window->DC.ItemWidthDefault = ImTrunc(g.FontSize * 16.0f);
|
||||||
|
|||||||
2
imgui.h
2
imgui.h
@@ -30,7 +30,7 @@
|
|||||||
// Library Version
|
// Library Version
|
||||||
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
|
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
|
||||||
#define IMGUI_VERSION "1.92.8 WIP"
|
#define IMGUI_VERSION "1.92.8 WIP"
|
||||||
#define IMGUI_VERSION_NUM 19271
|
#define IMGUI_VERSION_NUM 19272
|
||||||
#define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
|
#define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
|
||||||
#define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
|
#define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user