From 369071ed5094705b17e259100f863ba681b1cd8d Mon Sep 17 00:00:00 2001 From: cfillion Date: Wed, 3 Jul 2024 16:05:37 -0400 Subject: [PATCH] update to dear imgui 1.90.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Add Col_Tab{SelectedOverline,DimmedSelectedOverline} and TabBarFlags_DrawSelectedOverline • Add ConfigFlags_NoKeyboard • Add SliderFlags_WrapAround • Add TableGetHoveredColumn • Rename Col_TabActive to _TabSelected, _TabUnfocused to _TabDimmed and TabUnfocusedActive to _TabDimmedSelected • Rename DragDropFlags_SourceAutoExpirePayload to _PayloadAutoExpire • Replace WindowFlags_NavFlattened with ChildFlags_NavFlattened --- api/context.cpp | 5 +++- api/dragndrop.cpp | 2 +- api/drawlist.hpp | 8 ++++--- api/item.cpp | 5 ++++ api/slider.cpp | 3 +++ api/style.cpp | 17 ++++++++++---- api/tabbar.cpp | 2 ++ api/table.cpp | 14 +++++++++-- api/window.cpp | 12 +++++----- examples/demo.lua | 51 ++++++++++++++++++++++++++--------------- shims/0.9.2.cpp | 13 ++++++++++- src/context.cpp | 11 ++++----- subprojects/imgui/imgui | 2 +- tools/coverage.rb | 4 +++- 14 files changed, 103 insertions(+), 46 deletions(-) diff --git a/api/context.cpp b/api/context.cpp index 3619635a..c2f68290 100644 --- a/api/context.cpp +++ b/api/context.cpp @@ -289,10 +289,13 @@ API_ENUM(0_8, ImGui, ConfigFlags_NavNoCaptureKeyboard, R"(Instruct navigation to not capture global keyboard input when ConfigFlags_NavEnableKeyboard is set (see SetNextFrameWantCaptureKeyboard).)"); API_ENUM(0_1, ImGui, ConfigFlags_NoMouse, - "Instruct imgui to ignore mouse position/buttons."); + "Instruct dear imgui to disable mouse inputs and interactions"); API_ENUM(0_1, ImGui, ConfigFlags_NoMouseCursorChange, "Instruct backend to not alter mouse cursor shape and visibility."); API_ENUM(0_5, ImGui, ConfigFlags_DockingEnable, "Enable docking functionality."); +API_ENUM(0_9_2, ImGui, ConfigFlags_NoKeyboard, +R"(Instruct dear imgui to disable keyboard inputs and interactions. +This is done by ignoring keyboard events and clearing existing states.)"); API_ENUM(0_4, ReaImGui, ConfigFlags_NoSavedSettings, "Disable state restoration and persistence for the whole context."); diff --git a/api/dragndrop.cpp b/api/dragndrop.cpp index 44c65141..9c442f34 100644 --- a/api/dragndrop.cpp +++ b/api/dragndrop.cpp @@ -237,7 +237,7 @@ API_ENUM(0_1, ImGui, DragDropFlags_SourceExtern, R"(External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously.)"); -API_ENUM(0_1, ImGui, DragDropFlags_SourceAutoExpirePayload, +API_ENUM(0_9_2, ImGui, DragDropFlags_PayloadAutoExpire, R"(Automatically expire the payload if the source cease to be submitted (otherwise payloads are persisting while being dragged).)"); API_SECTION_P(flags, "Payload", "For AcceptDragDropPayload"); diff --git a/api/drawlist.hpp b/api/drawlist.hpp index 1e6bb4b5..f1d4a7d3 100644 --- a/api/drawlist.hpp +++ b/api/drawlist.hpp @@ -24,14 +24,16 @@ #include "../src/context.hpp" struct DrawListProxy : ResourceProxy { - using GetterFuncType = ImDrawList*(*)(); - template + template struct Getter { static constexpr Key key { KeyValue }; static auto get(Context *ctx) { assertFrame(ctx); - return GetterFunc(); + if constexpr(std::is_same_v) + return GetterFunc(nullptr); + else + return GetterFunc(); } }; diff --git a/api/item.cpp b/api/item.cpp index d7f110eb..d10250f3 100644 --- a/api/item.cpp +++ b/api/item.cpp @@ -34,6 +34,11 @@ API_FUNC(0_5_5, void, BeginDisabled, (Context*,ctx) R"(Disable all user interactions and dim items visuals (applying StyleVar_DisabledAlpha over current colors). +Those can be nested but it cannot be used to enable an already disabled section +(a single BeginDisabled(true) in the stack is enough to keep everything disabled). + +Tooltips windows by exception are opted out of disabling. + BeginDisabled(false) essentially does nothing useful but is provided to facilitate use of boolean expressions. If you can avoid calling BeginDisabled(false)/EndDisabled() best to avoid it.)") diff --git a/api/slider.cpp b/api/slider.cpp index 327db52e..80eb1581 100644 --- a/api/slider.cpp +++ b/api/slider.cpp @@ -485,3 +485,6 @@ R"(Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits).)"); API_ENUM(0_1, ImGui, SliderFlags_NoInput, "Disable CTRL+Click or Enter key allowing to input text directly into the widget."); +API_ENUM(0_9_2, ImGui, SliderFlags_WrapAround, +R"(Enable wrapping around from max to min and from min to max + (only supported by DragXXX() functions for now).)"); diff --git a/api/style.cpp b/api/style.cpp index 8bfa3f6b..f0ab226d 100644 --- a/api/style.cpp +++ b/api/style.cpp @@ -314,12 +314,19 @@ API_ENUM(0_1, ImGui, Col_ResizeGrip, "Resize grip in lower-right and lower-left corners of windows."); API_ENUM(0_1, ImGui, Col_ResizeGripHovered, ""); API_ENUM(0_1, ImGui, Col_ResizeGripActive, ""); +API_ENUM(0_1, ImGui, Col_TabHovered, "Tab background, when hovered"); API_ENUM(0_1, ImGui, Col_Tab, - "TabItem in a TabBar"); -API_ENUM(0_1, ImGui, Col_TabHovered, ""); -API_ENUM(0_1, ImGui, Col_TabActive, ""); -API_ENUM(0_1, ImGui, Col_TabUnfocused, ""); -API_ENUM(0_1, ImGui, Col_TabUnfocusedActive, ""); + "Tab background, when tab-bar is focused & tab is unselected"); +API_ENUM(0_9_2, ImGui, Col_TabSelected, + "Tab background, when tab-bar is focused & tab is selected"); +API_ENUM(0_9_2, ImGui, Col_TabSelectedOverline, + "Tab horizontal overline, when tab-bar is focused & tab is selected"); +API_ENUM(0_9_2, ImGui, Col_TabDimmed, + "Tab background, when tab-bar is unfocused & tab is unselected"); +API_ENUM(0_9_2, ImGui, Col_TabDimmedSelected, + "Tab background, when tab-bar is unfocused & tab is selected"); +API_ENUM(0_9_2, ImGui, Col_TabDimmedSelectedOverline, + "Horizontal overline, when tab-bar is unfocused & tab is selected"); API_ENUM(0_5, ImGui, Col_DockingPreview, "Preview overlay color when about to docking something."); API_ENUM(0_5, ImGui, Col_DockingEmptyBg, diff --git a/api/tabbar.cpp b/api/tabbar.cpp index 133c9826..68707d6e 100644 --- a/api/tabbar.cpp +++ b/api/tabbar.cpp @@ -51,6 +51,8 @@ R"(Disable scrolling buttons (apply when fitting policy is TabBarFlags_FittingPolicyScroll).)"); API_ENUM(0_1, ImGui, TabBarFlags_NoTooltip, "Disable tooltips when hovering a tab."); +API_ENUM(0_9_2, ImGui, TabBarFlags_DrawSelectedOverline, + "Draw selected overline markers over selected tab"); API_ENUM(0_1, ImGui, TabBarFlags_FittingPolicyResizeDown, "Resize tabs when they don't fit."); API_ENUM(0_1, ImGui, TabBarFlags_FittingPolicyScroll, diff --git a/api/table.cpp b/api/table.cpp index 592563b2..52f007cb 100644 --- a/api/table.cpp +++ b/api/table.cpp @@ -50,14 +50,14 @@ The typical call flow is: )"); API_FUNC(0_9, bool, BeginTable, (Context*,ctx) -(const char*,str_id) (int,column) (RO,flags,ImGuiTableFlags_None) +(const char*,str_id) (int,columns) (RO,flags,ImGuiTableFlags_None) (RO,outer_size_w,0.0) (RO,outer_size_h,0.0) (RO,inner_width,0.0), "") { FRAME_GUARD; - return ImGui::BeginTable(str_id, column, API_GET(flags), + return ImGui::BeginTable(str_id, columns, API_GET(flags), ImVec2(API_GET(outer_size_w), API_GET(outer_size_h)), API_GET(inner_width)); } @@ -214,6 +214,16 @@ TableFlags_ContextMenuInBody). ImGui::TableSetColumnEnabled(column_n, v); } +API_FUNC(0_9_2, int, TableGetHoveredColumn, (Context*,ctx), +R"(Returns hovered column or -1 when table is not hovered. Returns columns_count +if the unused space at the right of visible columns is hovered. + +Can also use (TableGetColumnFlags() & TableColumnFlags_IsHovered) instead.)") +{ + FRAME_GUARD; + return ImGui::TableGetHoveredColumn(); +} + API_SECTION_DEF(columnFlags, columns, "Column Flags", "For TableSetupColumn."); API_ENUM(0_1, ImGui, TableColumnFlags_None, ""); API_SECTION_P(columnFlags, "Input Configuration"); diff --git a/api/window.cpp b/api/window.cpp index 3e2d5089..1eccb804 100644 --- a/api/window.cpp +++ b/api/window.cpp @@ -166,9 +166,12 @@ R"(Combined with AutoResizeX/AutoResizeY. Always measure size even when child is hidden, always return true, always disable clipping optimization! NOT RECOMMENDED.)"); API_ENUM(0_9, ImGui, ChildFlags_FrameStyle, R"(Style the child window like a framed item: use Col_FrameBg, -StyleVar_FrameRounding, StyleVar_FrameBorderSize, StyleVar_FramePadding instead -of Col_ChildBg, StyleVar_ChildRounding, StyleVar_ChildBorderSize, -StyleVar_WindowPadding.)"); + StyleVar_FrameRounding, StyleVar_FrameBorderSize, StyleVar_FramePadding + instead of Col_ChildBg, StyleVar_ChildRounding, StyleVar_ChildBorderSize, + StyleVar_WindowPadding.)"); +API_ENUM(0_9_2, ImGui, ChildFlags_NavFlattened, +R"(Share focus scope, allow gamepad/keyboard navigation to cross over parent + border to this child or between sibling child windows.)"); API_SECTION_DEF(properties, ROOT_SECTION, "Properties", R"(Prefer using SetNextWindow* functions (before Begin) rather that SetWindow* functions @@ -732,9 +735,6 @@ R"(WindowFlags_NoTitleBar | WindowFlags_NoResize | WindowFlags_NoScrollbar | WindowFlags_NoCollapse)"); API_ENUM(0_1, ImGui, WindowFlags_NoInputs, "WindowFlags_NoMouseInputs | WindowFlags_NoNavInputs | WindowFlags_NoNavFocus"); -API_ENUM(0_9_2, ImGui, WindowFlags_NavFlattened, -R"(On child window: share focus scope, allow gamepad/keyboard navigation to - cross over parent border to this child or between sibling child windows.)"); API_ENUM(0_5_5, ReaImGui, WindowFlags_TopMost, "Show the window above all non-topmost windows."); diff --git a/examples/demo.lua b/examples/demo.lua index d7515707..06857a71 100644 --- a/examples/demo.lua +++ b/examples/demo.lua @@ -1,4 +1,4 @@ --- Lua/ReaImGui port of Dear ImGui's C++ demo code (v1.90.8) +-- Lua/ReaImGui port of Dear ImGui's C++ demo code (v1.90.9) --[[ This file can be imported in other scripts to help during development: @@ -56,6 +56,7 @@ local ImGui = require 'imgui' '0.9.2' local ctx, clipper local FLT_MIN, FLT_MAX = ImGui.NumericLimits_Float() +local DBL_MIN, DBL_MAX = ImGui.NumericLimits_Double() local IMGUI_VERSION, IMGUI_VERSION_NUM, REAIMGUI_VERSION = ImGui.GetVersion() local demo = { @@ -419,18 +420,23 @@ function demo.ShowDemoWindow(open) rv,config.flags = ImGui.CheckboxFlags(ctx, 'ConfigFlags_NavEnableSetMousePos', config.flags, ImGui.ConfigFlags_NavEnableSetMousePos) ImGui.SameLine(ctx); demo.HelpMarker('Instruct navigation to move the mouse cursor.') rv,config.flags = ImGui.CheckboxFlags(ctx, 'ConfigFlags_NoMouse', config.flags, ImGui.ConfigFlags_NoMouse) + ImGui.SameLine(ctx); demo.HelpMarker('Instruct dear imgui to disable mouse inputs and interactions.') + + -- The "NoMouse" option can get us stuck with a disabled mouse! Let's provide an alternative way to fix it: if (config.flags & ImGui.ConfigFlags_NoMouse) ~= 0 then - -- The "NoMouse" option can get us stuck with a disabled mouse! Let's provide an alternative way to fix it: if ImGui.GetTime(ctx) % 0.40 < 0.20 then ImGui.SameLine(ctx) ImGui.Text(ctx, '<>') end - if ImGui.IsKeyPressed(ctx, ImGui.Key_Space) then + -- Prevent both being checked + if ImGui.IsKeyPressed(ctx, ImGui.Key_Space) or (config.flags & ImGui.ConfigFlags_NoKeyboard) ~= 0 then config.flags = config.flags & ~ImGui.ConfigFlags_NoMouse end end rv,config.flags = ImGui.CheckboxFlags(ctx, 'ConfigFlags_NoMouseCursorChange', config.flags, ImGui.ConfigFlags_NoMouseCursorChange) ImGui.SameLine(ctx); demo.HelpMarker('Instruct backend to not alter mouse cursor shape and visibility.') + rv,config.flags = ImGui.CheckboxFlags(ctx, 'ConfigFlags_NoKeyboard', config.flags, ImGui.ConfigFlags_NoKeyboard) + ImGui.SameLine(ctx); demo.HelpMarker('Instruct dear imgui to disable keyboard inputs and interactions.') configVarCheckbox('ConfigVar_InputTrickleEventQueue') ImGui.SameLine(ctx); demo.HelpMarker('Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates.') @@ -682,7 +688,8 @@ function demo.ShowDemoWindowWidgets() i0 = 123, i1 = 50, i2 = 42, - i3 = 0, + i3 = 128, + i4 = 0, d0 = 999999.00000001, d1 = 1e10, d2 = 1.00, @@ -788,15 +795,17 @@ function demo.ShowDemoWindowWidgets() Double-click or CTRL+click to input value.') rv,widgets.basic.i2 = ImGui.DragInt(ctx, 'drag int 0..100', widgets.basic.i2, 1, 0, 100, '%d%%', ImGui.SliderFlags_AlwaysClamp) + rv,widgets.basic.i3 = ImGui.DragInt(ctx, 'drag int wrap 100..200', widgets.basic.i3, 1, 100, 200, '%d', ImGui.SliderFlags_WrapAround) rv,widgets.basic.d2 = ImGui.DragDouble(ctx, 'drag double', widgets.basic.d2, 0.005) rv,widgets.basic.d3 = ImGui.DragDouble(ctx, 'drag small double', widgets.basic.d3, 0.0001, 0.0, 0.0, '%.06f ns') + -- rv,widgets.basic.d4 = ImGui.DragDouble(ctx, 'drag wrap -1..1', widgets.basic.d4, 0.005, -1.0, 1.0, nil, ImGui.SliderFlags_WrapAround) end ImGui.SeparatorText(ctx, 'Sliders') do - rv,widgets.basic.i3 = ImGui.SliderInt(ctx, 'slider int', widgets.basic.i3, -1, 3) + rv,widgets.basic.i4 = ImGui.SliderInt(ctx, 'slider int', widgets.basic.i4, -1, 3) ImGui.SameLine(ctx); demo.HelpMarker('CTRL+click to input value.') rv,widgets.basic.d4 = ImGui.SliderDouble(ctx, 'slider double', widgets.basic.d4, 0.0, 1.0, 'ratio = %.3f') @@ -944,10 +953,10 @@ function demo.ShowDemoWindowWidgets() -- which default value include the HoveredFlags_AllowWhenDisabled flag. ImGui.BeginDisabled(ctx) ImGui.Button(ctx, 'Disabled item', sz_w, sz_h) - ImGui.EndDisabled(ctx) if ImGui.IsItemHovered(ctx, ImGui.HoveredFlags_ForTooltip) then ImGui.SetTooltip(ctx, 'I am a a tooltip for a disabled item.') end + ImGui.EndDisabled(ctx) ImGui.TreePop(ctx) end @@ -1858,6 +1867,7 @@ label: rv,widgets.tabs.flags1 = ImGui.CheckboxFlags(ctx, 'TabBarFlags_AutoSelectNewTabs', widgets.tabs.flags1, ImGui.TabBarFlags_AutoSelectNewTabs) rv,widgets.tabs.flags1 = ImGui.CheckboxFlags(ctx, 'TabBarFlags_TabListPopupButton', widgets.tabs.flags1, ImGui.TabBarFlags_TabListPopupButton) rv,widgets.tabs.flags1 = ImGui.CheckboxFlags(ctx, 'TabBarFlags_NoCloseWithMiddleMouseButton', widgets.tabs.flags1, ImGui.TabBarFlags_NoCloseWithMiddleMouseButton) + rv,widgets.tabs.flags1 = ImGui.CheckboxFlags(ctx, 'TabBarFlags_DrawSelectedOverline', widgets.tabs.flags1, ImGui.TabBarFlags_DrawSelectedOverline) if widgets.tabs.flags1 & fitting_policy_mask == 0 then widgets.tabs.flags1 = widgets.tabs.flags1 | ImGui.TabBarFlags_FittingPolicyResizeDown -- was FittingPolicyDefault_ @@ -1870,9 +1880,11 @@ label: end -- Tab Bar + ImGui.AlignTextToFramePadding(ctx) + ImGui.Text(ctx, 'Opened:') local names = { 'Artichoke', 'Beetroot', 'Celery', 'Daikon' } - for n,opened in ipairs(widgets.tabs.opened) do - if n > 1 then ImGui.SameLine(ctx); end + for n, opened in ipairs(widgets.tabs.opened) do + ImGui.SameLine(ctx) rv,widgets.tabs.opened[n] = ImGui.Checkbox(ctx, names[n], opened) end @@ -2333,8 +2345,8 @@ label: ImGui.SameLine(ctx); demo.HelpMarker('Disable rounding underlying value to match precision of the format string (e.g. %.3f values are rounded to those 3 digits).') rv,widgets.sliders.flags = ImGui.CheckboxFlags(ctx, 'SliderFlags_NoInput', widgets.sliders.flags, ImGui.SliderFlags_NoInput) ImGui.SameLine(ctx); demo.HelpMarker('Disable CTRL+Click or Enter key allowing to input text directly into the widget.') - - local DBL_MIN, DBL_MAX = 2.22507e-308, 1.79769e+308 + rv,widgets.sliders.flags = ImGui.CheckboxFlags(ctx, 'SliderFlags_WrapAround', widgets.sliders.flags, ImGui.SliderFlags_WrapAround) + ImGui.SameLine(ctx); demo.HelpMarker('Enable wrapping around from max to min and from min to max (only supported by DragXXX() functions)') -- Drags ImGui.Text(ctx, ('Underlying double value: %f'):format(widgets.sliders.drag_d)) @@ -2345,9 +2357,10 @@ label: rv,widgets.sliders.drag_i = ImGui.DragInt(ctx, 'DragInt (0 -> 100)', widgets.sliders.drag_i, 0.5, 0, 100, '%d', widgets.sliders.flags) -- Sliders + local flags_for_sliders = widgets.sliders.flags & ~ImGui.SliderFlags_WrapAround ImGui.Text(ctx, ('Underlying float value: %f'):format(widgets.sliders.slider_d)) - rv,widgets.sliders.slider_d = ImGui.SliderDouble(ctx, 'SliderDouble (0 -> 1)', widgets.sliders.slider_d, 0.0, 1.0, '%.3f', widgets.sliders.flags) - rv,widgets.sliders.slider_i = ImGui.SliderInt(ctx, 'SliderInt (0 -> 100)', widgets.sliders.slider_i, 0, 100, '%d', widgets.sliders.flags) + rv,widgets.sliders.slider_d = ImGui.SliderDouble(ctx, 'SliderDouble (0 -> 1)', widgets.sliders.slider_d, 0.0, 1.0, '%.3f', flags_for_sliders) + rv,widgets.sliders.slider_i = ImGui.SliderInt(ctx, 'SliderInt (0 -> 100)', widgets.sliders.slider_i, 0, 100, '%d', flags_for_sliders) ImGui.TreePop(ctx) end @@ -7181,10 +7194,8 @@ function demo.ShowStyleEditor() Right-click to open edit options menu.') ImGui.SetNextWindowSizeConstraints(ctx, 0.0, ImGui.GetTextLineHeightWithSpacing(ctx) * 10, FLT_MAX, FLT_MAX) - if ImGui.BeginChild(ctx, '##colors', 0, 0, ImGui.ChildFlags_Border, - ImGui.WindowFlags_AlwaysVerticalScrollbar | - ImGui.WindowFlags_AlwaysHorizontalScrollbar | - ImGui.WindowFlags_NavFlattened) then + if ImGui.BeginChild(ctx, '##colors', 0, 0, ImGui.ChildFlags_Border | ImGui.ChildFlags_NavFlattened, + ImGui.WindowFlags_AlwaysVerticalScrollbar | ImGui.WindowFlags_AlwaysHorizontalScrollbar) then ImGui.PushItemWidth(ctx, ImGui.GetFontSize(ctx) * -12) local inner_spacing = ImGui.GetStyleVar(ctx, ImGui.StyleVar_ItemInnerSpacing) for i, name in demo.EachEnum('Col') do @@ -7268,10 +7279,10 @@ function demo.ShowStyleEditor() -- ImGui.SetNextWindowPos(ImGui.GetCursorScreenPos()); -- if (show_samples && ImGui::BeginTooltip()) -- { --- ImGui.TextUnformatted("(R = radius, N = number of segments)"); +-- ImGui.TextUnformatted("(R = radius, N = approx number of segments)"); -- ImGui.Spacing(); -- ImDrawList* draw_list = ImGui.GetWindowDrawList(); --- const float min_widget_width = ImGui.CalcTextSize("N: MMM\nR: MMM").x; +-- const float min_widget_width = ImGui.CalcTextSize("R: MMM\nN: MMM").x; -- for (int n = 0; n < 8; n++) -- { -- const float RAD_MIN = 5.0f; @@ -7280,6 +7291,7 @@ function demo.ShowStyleEditor() -- -- ImGui.BeginGroup(); -- +-- // N is not always exact here due to how PathArcTo() function work internally -- ImGui.Text("R: %.f\nN: %d", rad, draw_list->_CalcCircleAutoSegmentCount(rad)); -- -- const float canvas_width = IM_MAX(min_widget_width, rad * 2.0f); @@ -7654,7 +7666,7 @@ function ExampleAppConsole:Draw(title) -- Reserve enough left-over height for 1 separator + 1 input text local footer_height_to_reserve = select(2, ImGui.GetStyleVar(self.ctx, ImGui.StyleVar_ItemSpacing)) + ImGui.GetFrameHeightWithSpacing(self.ctx) - if ImGui.BeginChild(self.ctx, 'ScrollingRegion', 0, -footer_height_to_reserve, ImGui.ChildFlags_None, ImGui.WindowFlags_HorizontalScrollbar | ImGui.WindowFlags_NavFlattened) then + if ImGui.BeginChild(self.ctx, 'ScrollingRegion', 0, -footer_height_to_reserve, ImGui.ChildFlags_NavFlattened, ImGui.WindowFlags_HorizontalScrollbar) then if ImGui.BeginPopupContextWindow(self.ctx) then if ImGui.Selectable(self.ctx, 'Clear') then self:ClearLog() end ImGui.EndPopup(self.ctx) @@ -9162,6 +9174,7 @@ end -- if (opt_target == Target_Tab) -- { -- ImGuiTabBarFlags tab_bar_flags = (opt_fitting_flags) | (opt_reorderable ? ImGuiTabBarFlags_Reorderable : 0); +-- tab_bar_flags |= ImGuiTabBarFlags_DrawSelectedOverline; -- if (ImGui::BeginTabBar("##tabs", tab_bar_flags)) -- { -- if (opt_reorderable) diff --git a/shims/0.9.2.cpp b/shims/0.9.2.cpp index 46a73dd2..9a4f76cd 100644 --- a/shims/0.9.2.cpp +++ b/shims/0.9.2.cpp @@ -20,6 +20,10 @@ SHIM("0.9.2", (int, Mod_Ctrl) (int, Mod_Super) + (int, DragDropFlags_PayloadAutoExpire) + (int, Col_TabSelected) + (int, Col_TabDimmed) + (int, Col_TabDimmedSelected) ); // dear imgui v1.90.7 swaps Ctrl<>Super on macOS @@ -29,5 +33,12 @@ SHIM_ALIAS(0_8, Mod_Ctrl, Mod_Super) SHIM_ALIAS(0_8, Mod_Super, Mod_Ctrl) #else SHIM_ALIAS(0_8, Mod_Ctrl, Mod_Ctrl) -SHIM_ALIAS(0_8, Mod_Super, Mod_Ctrl) +SHIM_ALIAS(0_8, Mod_Super, Mod_Super) #endif + +// dear imgui v1.90.9 +SHIM_ALIAS(0_1, DragDropFlags_SourceAutoExpirePayload, + DragDropFlags_PayloadAutoExpire) +SHIM_ALIAS(0_1, Col_TabActive, Col_TabSelected) +SHIM_ALIAS(0_1, Col_TabUnfocused, Col_TabDimmed) +SHIM_ALIAS(0_1, Col_TabUnfocusedActive, Col_TabDimmedSelected) diff --git a/src/context.cpp b/src/context.cpp index 0c2581fa..3743c547 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -499,10 +499,8 @@ void Context::updateDragDrop() void Context::dragSources() { - constexpr ImGuiDragDropFlags flags { - ImGuiDragDropFlags_SourceExtern | - ImGuiDragDropFlags_SourceAutoExpirePayload - }; + constexpr ImGuiDragDropFlags flags + { ImGuiDragDropFlags_SourceExtern | ImGuiDragDropFlags_PayloadAutoExpire }; if(m_draggedFiles.empty()) return; @@ -632,10 +630,11 @@ void Context::clearFocus() else ImGui::FocusWindow(nullptr); // also calls ClearActiveID - // ClearInputKeys resets MousePos to -FLT_MAX + // ClearInputMouse resets MousePos to -FLT_MAX // Restoring it to gain focus on first click on Linux const ImVec2 mousePos { m_imgui->IO.MousePos }; - m_imgui->IO.ClearInputKeys(); // clears keyboard and mouse + m_imgui->IO.ClearInputKeys(); + m_imgui->IO.ClearInputMouse(); m_imgui->IO.MousePos = mousePos; HWND capture { Platform::getCapture() }; diff --git a/subprojects/imgui/imgui b/subprojects/imgui/imgui index c2a6bfec..04659908 160000 --- a/subprojects/imgui/imgui +++ b/subprojects/imgui/imgui @@ -1 +1 @@ -Subproject commit c2a6bfeccfb3181c487a3ff13cdc36b97680a253 +Subproject commit 0465990802a2e9df244b62142193a55ffc76fb74 diff --git a/tools/coverage.rb b/tools/coverage.rb index 7fca01bb..851abeb3 100755 --- a/tools/coverage.rb +++ b/tools/coverage.rb @@ -167,7 +167,7 @@ ] NATIVE_ONLY_CLASSES = %w[ - ImGuiIO ImFontAtlas ImFont ImDrawData ImGuiStoragePair + ImGuiIO ImFontAtlas ImFont ImDrawData ImGuiStorage ImGuiStyle ImGuiInputTextCallbackData ImFontGlyphRangesBuilder ImGuiTextBuffer ImFontConfig ] @@ -189,6 +189,7 @@ 'WindowFlags_NoBringToFrontOnFocus', # not supported with per-window viewports /\AMouseSource_/, # for backends (io.AddMouseSoruceEvent) 'StyleVar_DockingSeparatorSize', # only applicable mid-frame to DockSpace + /\ADragDropFlags_PayloadNoCross/, # only for dear imgui's internal use /\AWindowFlags_(ChildWindow|Tooltip|Popup|Modal|ChildMenu|DockNodeHost)\z/, @@ -295,6 +296,7 @@ 'char*', 'const char*', 'reaper_array*', + 'LICE_IBitmap*', 'void*', ] + RESOURCES.keys