Browse Source

Demo: fixed layout issue in "Layout & Scrolling -> Scrolling" section.

ocornut 1 week ago
parent
commit
ee3d16f150
2 changed files with 16 additions and 12 deletions
  1. 7 6
      docs/CHANGELOG.txt
  2. 9 6
      imgui_demo.cpp

+ 7 - 6
docs/CHANGELOG.txt

@@ -68,9 +68,6 @@ Other Changes:
   using ImGuiWindowFlags_UnsavedDocument/ImGuiTabItemFlags_UnsavedDocument. (#8983)
 - IO: added ImGuiPlatformIO::ClearPlatformHandlers(), ClearRendererHandlers()
   helpers to null all handlers. (#8945, #2769)
-- Misc: Debuggers: added type formatters for the LLDB debuggers (e.g. Xcode,
-  Android Studio & more) to provide nicer display for ImVec2, ImVec4, ImVector etc.
-  See misc/debuggers/ for details. (#8950) [@mentlerd]
 - Textures: fixed a crash if texture status is set to _WantDestroy by a backend after
   it had already been destroyed. This would typically happen when calling backend's
   ImGui_ImplXXXX_InvalidateDeviceObjects() helpers twice in a row. (#8977, #8811)
@@ -83,12 +80,16 @@ Other Changes:
 - Textures: fixed not updating ImTextureData's RefCount when destroying a context
   using a shared ImFontAtlas, leading standard backends to not properly free
   texture resources. (#8975) [@icrashstuff]
-- CI: Updates Windows CI scripts to generate/use VulkanSDK. (#8925, #8778) [@yaz0r]
+- Demo: fixed layout issue in "Layout & Scrolling -> Scrolling" section.
+- Misc: Debuggers: added type formatters for the LLDB debuggers (e.g. Xcode,
+  Android Studio & more) to provide nicer display for ImVec2, ImVec4, ImVector etc.
+  See misc/debuggers/ for details. (#8950) [@mentlerd]
+- CI: updated Windows CI scripts to generate/use VulkanSDK. (#8925, #8778) [@yaz0r]
+- Docs: updated FAQ with new "What is the difference between Dear ImGui and
+  traditional UI toolkits?" entry. (#8862)
 - Backends: all backends call ImGuiPlatformIO::ClearPlatformHandlers() and
   ClearRendererHandlers() on shutdown, so as not to leave function pointers
   which may be dangling when using backend in e.g. DLL. (#8945, #2769)
-- Docs: updated FAQ with new "What is the difference between Dear ImGui and
-  traditional UI toolkits?" entry. (#8862)
 - Backends: DirectX12: reuse a command list and allocator for texture uploads instead
   of recreating them each time. (#8963, #8465) [@RT2Code]
 - Backends: DirectX12: Rework synchronization logic. (#8961) [@RT2Code]

+ 9 - 6
imgui_demo.cpp

@@ -4795,15 +4795,18 @@ static void DemoWindowLayout()
 
         ImGui::Checkbox("Decoration", &enable_extra_decorations);
 
+        ImGui::PushItemWidth(ImGui::GetFontSize() * 10);
+        enable_track |= ImGui::DragInt("##item", &track_item, 0.25f, 0, 99, "Item = %d");
+        ImGui::SameLine();
         ImGui::Checkbox("Track", &enable_track);
-        ImGui::PushItemWidth(100);
-        ImGui::SameLine(140); enable_track |= ImGui::DragInt("##item", &track_item, 0.25f, 0, 99, "Item = %d");
 
-        bool scroll_to_off = ImGui::Button("Scroll Offset");
-        ImGui::SameLine(140); scroll_to_off |= ImGui::DragFloat("##off", &scroll_to_off_px, 1.00f, 0, FLT_MAX, "+%.0f px");
+        bool scroll_to_off = ImGui::DragFloat("##off", &scroll_to_off_px, 1.00f, 0, FLT_MAX, "+%.0f px");
+        ImGui::SameLine();
+        scroll_to_off |= ImGui::Button("Scroll Offset");
 
-        bool scroll_to_pos = ImGui::Button("Scroll To Pos");
-        ImGui::SameLine(140); scroll_to_pos |= ImGui::DragFloat("##pos", &scroll_to_pos_px, 1.00f, -10, FLT_MAX, "X/Y = %.0f px");
+        bool scroll_to_pos = ImGui::DragFloat("##pos", &scroll_to_pos_px, 1.00f, -10, FLT_MAX, "X/Y = %.0f px");;
+        ImGui::SameLine();
+        scroll_to_pos |= ImGui::Button("Scroll To Pos");
         ImGui::PopItemWidth();
 
         if (scroll_to_off || scroll_to_pos)