From b9868cb588492057bffc8d972afcee0c26cdbc10 Mon Sep 17 00:00:00 2001 From: tot Date: Tue, 15 Aug 2017 00:15:00 +0200 Subject: [PATCH 01/15] Fixed authoring and provided the exact color used in the screenshot --- LICENSE | 5 +++++ imgui_tabs.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/LICENSE b/LICENSE index fd1ce05..d871c2b 100644 --- a/LICENSE +++ b/LICENSE @@ -19,3 +19,8 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +DrawTabsBackground added by eric bachard (Jul 21, 2017) under the same license +See : https://github.com/ebachard/imgui_tabs +and https://github.com/ScottMudge/imgui_tabs/issues/1 diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index e9305bb..425b65b 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -271,6 +271,8 @@ void ImGui::TabBar::_drawTabBarBottom() { dl->AddRectFilled(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.15f),corner_rounding,ImGuiCorner_BottomLeft | ImGuiCorner_BottomRight); // Draw the border in a given color + alpha dl->AddRect(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.35f),corner_rounding,ImGuiCorner_BottomLeft | ImGuiCorner_TopRight); + // below, the real color used in the screenshot + //dl->AddRect(upperLeft, pos,ImColor(0.2f,0.2f,0.2f,0.35f),corner_rounding,ImGuiCorner_BottomLeft | ImGuiCorner_TopRight); dc.CursorPos += ImVec2(0,corner_rounding+2.0f); // Add all the extra height used above. ImGui::PopClipRect(); From 1296a58ef5dc57b4277b3eae06171b5b3662d09a Mon Sep 17 00:00:00 2001 From: tot Date: Wed, 23 Aug 2017 14:15:18 +0200 Subject: [PATCH 02/15] upgrade to ImgUI 1.51_WIP + fix some warnings + did some cleanup --- imgui_tabs.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index 425b65b..76cd914 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -31,6 +31,9 @@ #include "imgui_tabs.h" +// use this constant in the case you are using ImGUI < 1.51 +// #define IMGUI_VERSION_150_OR_MINUS + ImGui::ImGuiUserStyle::ImGuiUserStyle(){ Colors[ImGuiUserCol_TabNormal] = ImVec4(0.65f, 0.65f, 0.68f, 1.00f); Colors[ImGuiUserCol_TabTitleTextNormal] = ImVec4(0.0f, 0.0f, 0.0f, 0.5f); @@ -103,12 +106,20 @@ void ImGui::_drawPartialRect(const ImVec2 a, const ImVec2 b, const float roundin dl->PathArcToFast(ImVec2(a.x+r3-shadow_offset,b.y-r3), r3, 3, 6); dl->PathArcToFast(ImVec2(a.x+r0-shadow_offset,a.y+r0), r0, 6, 9); dl->PathLineTo(ImVec2(a.x,b.y)); +#if defined(IMGUI_VERSION_150_OR_MINUS) dl->PathFill(col); +#else + dl->PathFillConvex(col); +#endif } if (shadow_edges & EDGE_RIGHT){ dl->PathArcToFast(ImVec2(b.x-r1+shadow_offset,a.y+r1), r1, 9, 12); dl->PathArcToFast(ImVec2(b.x-r2+shadow_offset,b.y-r2), r2, 0, 3); dl->PathLineTo(ImVec2(b.x,b.y)); +#if defined(IMGUI_VERSION_150_OR_MINUS) dl->PathFill(col); +#else + dl->PathFillConvex(col); +#endif } } } @@ -155,7 +166,8 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { const float tab_height = CalcTextSize(tabTitles[0]).y + (frame_padding.y * 2); float selected_offset = 0; - _TabType selected_tab_type; + // ericb FIXME : unused + // _TabType selected_tab_type; ImVec2 selected_expands; _EdgeType selected_shadow_edges = EDGE_NONE; int selected_idx = 0; @@ -190,8 +202,11 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { const float xr = offs + division - shrink + expands.y; const ImRect bb = ImRect(ImVec2(pos + ImVec2(xl, 0)),ImVec2( pos + ImVec2(xr, tab_height))); - bool hovered, held; - bool pressed = ButtonBehavior(bb, tabHashes[i], &hovered, &held); + bool hovered = false + bool held = false; + // ericb : pressed was unused + // bool pressed = ButtonBehavior(bb, tabHashes[i], &hovered, &held); + if (held) newSelected = i; @@ -264,7 +279,8 @@ void ImGui::TabBar::_drawTabBarBottom() { // the zero below the tabs is dc.CursorPos.y - padding.y // and if we wnt to add the tab height, we'll have to remove a constant // (= all the additional offsets used for the layout). FIXME : use the real name(s) instead - const float height = dc.CursorPos.y - padding.y + wind->Size.y - 92.0f; + const float additionnalOffsets = 92.0f; + const float height = dc.CursorPos.y - padding.y + wind->Size.y - additionnalOffsets; const ImVec2 pos = ImVec2(wind->Pos.x + wind->Size.x - padding.x, height); // Draw the background in a given color + alpha From 565864efe70299c26205e7febff78b69be1222aa Mon Sep 17 00:00:00 2001 From: tot Date: Wed, 23 Aug 2017 14:16:45 +0200 Subject: [PATCH 03/15] fixed some warnings too in the header --- imgui_tabs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_tabs.h b/imgui_tabs.h index 4e3eb2c..cbfda89 100644 --- a/imgui_tabs.h +++ b/imgui_tabs.h @@ -120,7 +120,7 @@ namespace ImGui }; /// Used internally to draw a rounded rect with the different borders disabled - static void _drawPartialRect(const ImVec2 a, const ImVec2 b, const float rounding, const int rounding_corners, + /*static void*/ _drawPartialRect(const ImVec2 a, const ImVec2 b, const float rounding, const int rounding_corners, ImDrawList* dl, const _EdgeType edges, const ImU32 color, const bool shadow = false, const _EdgeType shadow_edges = EDGE_NONE, const float shadow_offset = 4.0f, const float shadow_alpha = 0.075f); From ef579114799d6275a0dba857a5d52db59e907e40 Mon Sep 17 00:00:00 2001 From: tot Date: Wed, 23 Aug 2017 14:23:39 +0200 Subject: [PATCH 04/15] fixed stupid typo --- imgui_tabs.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/imgui_tabs.h b/imgui_tabs.h index cbfda89..aff15a6 100644 --- a/imgui_tabs.h +++ b/imgui_tabs.h @@ -68,6 +68,12 @@ #ifndef IMGUI_TABS_HPP #define IMGUI_TABS_HPP +#ifndef IMGUI_DEFINE_MATH_OPERATORS +#define IMGUI_DEFINE_MATH_OPERATORS +#endif + +#include +#include #include #include "imgui.h" #include "imgui_internal.h" @@ -120,7 +126,7 @@ namespace ImGui }; /// Used internally to draw a rounded rect with the different borders disabled - /*static void*/ _drawPartialRect(const ImVec2 a, const ImVec2 b, const float rounding, const int rounding_corners, + /*static*/ void _drawPartialRect(const ImVec2 a, const ImVec2 b, const float rounding, const int rounding_corners, ImDrawList* dl, const _EdgeType edges, const ImU32 color, const bool shadow = false, const _EdgeType shadow_edges = EDGE_NONE, const float shadow_offset = 4.0f, const float shadow_alpha = 0.075f); From 5ee508ddea327dd7b1cd7b666d759031f5478df0 Mon Sep 17 00:00:00 2001 From: tot Date: Wed, 23 Aug 2017 14:26:33 +0200 Subject: [PATCH 05/15] Added missing ; --- imgui_tabs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index 76cd914..ca2f3c9 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -202,7 +202,7 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { const float xr = offs + division - shrink + expands.y; const ImRect bb = ImRect(ImVec2(pos + ImVec2(xl, 0)),ImVec2( pos + ImVec2(xr, tab_height))); - bool hovered = false + bool hovered = false; bool held = false; // ericb : pressed was unused // bool pressed = ButtonBehavior(bb, tabHashes[i], &hovered, &held); From 4f28d160aaf01a5502486998f248d5f18ab291e2 Mon Sep 17 00:00:00 2001 From: tot Date: Wed, 23 Aug 2017 14:32:50 +0200 Subject: [PATCH 06/15] OOops ... wrong fix. This is the real fix for the unused pressed warning --- imgui_tabs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index ca2f3c9..07b4da7 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -205,7 +205,7 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { bool hovered = false; bool held = false; // ericb : pressed was unused - // bool pressed = ButtonBehavior(bb, tabHashes[i], &hovered, &held); + ButtonBehavior(bb, tabHashes[i], &hovered, &held); if (held) newSelected = i; From dbbf7660f96e7a376194095273ee5f5f28feed89 Mon Sep 17 00:00:00 2001 From: tot Date: Wed, 23 Aug 2017 14:34:49 +0200 Subject: [PATCH 07/15] Kept the origin of the issue, just in case --- imgui_tabs.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index 07b4da7..b829d0d 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -205,6 +205,7 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { bool hovered = false; bool held = false; // ericb : pressed was unused + // bool pressed = ButtonBehavior(bb, tabHashes[i], &hovered, &held); ButtonBehavior(bb, tabHashes[i], &hovered, &held); if (held) From 32b2e64a03234d0367a27297e5083949c08ae1a5 Mon Sep 17 00:00:00 2001 From: ericb Date: Mon, 13 Nov 2017 22:29:03 +0100 Subject: [PATCH 08/15] Keep up to date with Dear ImGui 1.53. Please read the imgui_tabs.h to adapt to your sources --- imgui_tabs.cpp | 12 ++---------- imgui_tabs.h | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index b829d0d..99c6e6f 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -106,20 +106,12 @@ void ImGui::_drawPartialRect(const ImVec2 a, const ImVec2 b, const float roundin dl->PathArcToFast(ImVec2(a.x+r3-shadow_offset,b.y-r3), r3, 3, 6); dl->PathArcToFast(ImVec2(a.x+r0-shadow_offset,a.y+r0), r0, 6, 9); dl->PathLineTo(ImVec2(a.x,b.y)); -#if defined(IMGUI_VERSION_150_OR_MINUS) - dl->PathFill(col); -#else dl->PathFillConvex(col); -#endif } if (shadow_edges & EDGE_RIGHT){ dl->PathArcToFast(ImVec2(b.x-r1+shadow_offset,a.y+r1), r1, 9, 12); dl->PathArcToFast(ImVec2(b.x-r2+shadow_offset,b.y-r2), r2, 0, 3); dl->PathLineTo(ImVec2(b.x,b.y)); -#if defined(IMGUI_VERSION_150_OR_MINUS) - dl->PathFill(col); -#else dl->PathFillConvex(col); -#endif } } } @@ -285,9 +277,9 @@ void ImGui::TabBar::_drawTabBarBottom() { const ImVec2 pos = ImVec2(wind->Pos.x + wind->Size.x - padding.x, height); // Draw the background in a given color + alpha - dl->AddRectFilled(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.15f),corner_rounding,ImGuiCorner_BottomLeft | ImGuiCorner_BottomRight); + dl->AddRectFilled(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.15f),corner_rounding,ImGuiCorner_BotLeft | ImGuiCorner_BotRight); // Draw the border in a given color + alpha - dl->AddRect(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.35f),corner_rounding,ImGuiCorner_BottomLeft | ImGuiCorner_TopRight); + dl->AddRect(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.35f),corner_rounding,ImGuiCorner_BotLeft | ImGuiCorner_TopRight); // below, the real color used in the screenshot //dl->AddRect(upperLeft, pos,ImColor(0.2f,0.2f,0.2f,0.35f),corner_rounding,ImGuiCorner_BottomLeft | ImGuiCorner_TopRight); diff --git a/imgui_tabs.h b/imgui_tabs.h index aff15a6..d44bf82 100644 --- a/imgui_tabs.h +++ b/imgui_tabs.h @@ -78,6 +78,23 @@ #include "imgui.h" #include "imgui_internal.h" +// Define one of them to keep the compatibility with older versions of Dear ImGui + +// use this constant if you are using Dear ImGui < 1.51 +//#define IMGUI_VERSION_150_OR_MINUS + +#if defined (IMGUI_VERSION_150_OR_MINUS) +#define PathFillConvex PathFill +#endif + +// use this constant if you are using Dear ImGui < 1.53 +//#define IMGUI_VERSION_152_OR_MINUS + +#if defined (IMGUI_VERSION_152_OR_MINUS) +#define ImGuiCorner_BotLeft ImGuiCorner_BottomLeft +#define ImGuiCorner_BotRight ImGuiCorner_BottomRight +#endif + // Extra Math Helpers (Set the proper define below in imgui_internal.h) #ifdef IMGUI_DEFINE_MATH_OPERATORS From e2c128bdbe22958953c8304ecb233b4e4c3db626 Mon Sep 17 00:00:00 2001 From: ericb Date: Mon, 13 Nov 2017 22:43:31 +0100 Subject: [PATCH 09/15] Fixed a probable typo --- imgui_tabs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index 99c6e6f..3d1eb16 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -279,7 +279,7 @@ void ImGui::TabBar::_drawTabBarBottom() { // Draw the background in a given color + alpha dl->AddRectFilled(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.15f),corner_rounding,ImGuiCorner_BotLeft | ImGuiCorner_BotRight); // Draw the border in a given color + alpha - dl->AddRect(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.35f),corner_rounding,ImGuiCorner_BotLeft | ImGuiCorner_TopRight); + dl->AddRect(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.35f),corner_rounding,ImGuiCorner_BotLeft | ImGuiCorner_BotRight); // below, the real color used in the screenshot //dl->AddRect(upperLeft, pos,ImColor(0.2f,0.2f,0.2f,0.35f),corner_rounding,ImGuiCorner_BottomLeft | ImGuiCorner_TopRight); From 1c63e9099bad4c246787ab1e83ac59267455b03b Mon Sep 17 00:00:00 2001 From: ebachard Date: Thu, 26 Apr 2018 18:17:27 +0200 Subject: [PATCH 10/15] Simplified the code, now using more Dear Imgui themes + added a new LightGreen theme (inspired from linux Traditional Green gtk theme) --- Changelog | 17 ++++++ imgui_tabs.cpp | 163 +++++++++++++++++++++++++++++++++++++------------ imgui_tabs.h | 25 ++++---- 3 files changed, 155 insertions(+), 50 deletions(-) create mode 100644 Changelog diff --git a/Changelog b/Changelog new file mode 100644 index 0000000..7ddf0f9 --- /dev/null +++ b/Changelog @@ -0,0 +1,17 @@ +2018 April 26th + +eric bachard +Resync'ed the code with Dear ImGui 1.61 WIP +Added IMGUI_VERSION_160_OR_MINUX GUARD for old code +Simplified the interface : +-removed :ImGuiUserCol_TabHover, ImGuiUserCol_TabTitleTextNormal, ImGuiUserCol_TabTitleTextSelected, +- now using ImGui themes +- added StyleColorsLightGreen() theme, since it is miniDart legacy theme +- removed duplicated code +Tested ok using miniDart +The code builds OK when cross-compiling (target : Windows7+ 64 and 32 bits) + +2018 July 21 +DrawTabsBackground added by eric bachard (Jul 21, 2017) under the same license +See : https://github.com/ebachard/imgui_tabs +and https://github.com/ScottMudge/imgui_tabs/issues/1 diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index 3d1eb16..1a89d46 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -31,16 +31,14 @@ #include "imgui_tabs.h" -// use this constant in the case you are using ImGUI < 1.51 +// define this constant in the case you are using ImGUI < 1.51 // #define IMGUI_VERSION_150_OR_MINUS -ImGui::ImGuiUserStyle::ImGuiUserStyle(){ - Colors[ImGuiUserCol_TabNormal] = ImVec4(0.65f, 0.65f, 0.68f, 1.00f); - Colors[ImGuiUserCol_TabTitleTextNormal] = ImVec4(0.0f, 0.0f, 0.0f, 0.5f); - Colors[ImGuiUserCol_TabTitleTextSelected] = ImVec4(1.0f, 1.0f, 1.0f, 1.00f); +ImGui::ImGuiUserStyle::ImGuiUserStyle() +{ + Colors[ImGuiUserCol_TabNormal] = ImVec4(0.69f, 0.69f, 0.69f, 1.00/*0.70f*/); Colors[ImGuiUserCol_TabBorder] = Colors[ImGuiUserCol_TabNormal] * ImVec4(1.15f,1.15f,1.15f,1.0f); Colors[ImGuiUserCol_TabBorderShadow] = Colors[ImGuiUserCol_TabNormal] * ImVec4(0.65f,0.65f,0.65f,1.0f); - Colors[ImGuiUserCol_TabHover] = Colors[ImGuiUserCol_TabNormal] * ImVec4(1.15f,1.15f,1.15f,1.0f); } const ImU32 ImGui::GetColorU32(ImGuiUserCol_ idx, float alpha_mul) { @@ -117,16 +115,19 @@ void ImGui::_drawPartialRect(const ImVec2 a, const ImVec2 b, const float roundin } } -ImGui::TabBar::TabBar(const char *label, const ImVec2 tab_bar_size) { +ImGui::TabBar::TabBar(const char *label, const ImVec2 tab_bar_size) +{ hash = ImHash(label,0); size = tab_bar_size; } -void ImGui::TabBar::setActiveTab(const unsigned idx) { +void ImGui::TabBar::setActiveTab(const unsigned idx) +{ activeTab = (int)idx; // This get's checked at the beginning of } -const int ImGui::TabBar::getActiveTab() { +const int ImGui::TabBar::getActiveTab() +{ return activeTab; } @@ -151,19 +152,23 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { const float division = ((wind->Size.x - 2*padding.x)/(float)tabCount); // Compile-time constants - static constexpr const float rounding = 6.0f; + // static constexpr const float rounding = 6.0f; + // ericb limit tabs rounding, to keep the consistence with the current theme + static constexpr const float rounding = 3.0f; // This is the border shrink in px. Not sure why it needs to be 1, but it works. Adjust to your border size static constexpr const float shrink = 1.0f; - const float tab_height = CalcTextSize(tabTitles[0]).y + (frame_padding.y * 2); + // ericb ajouté 2.0, parce que pas assez d'espace + const float tab_height = CalcTextSize(tabTitles[0]).y + (frame_padding.y * 2) + 2.0; float selected_offset = 0; - // ericb FIXME : unused + // FIXME unused // _TabType selected_tab_type; ImVec2 selected_expands; _EdgeType selected_shadow_edges = EDGE_NONE; int selected_idx = 0; // Store maximum/minimum x value for clipping rect. + // TEST3 const float max_x = wind->Pos.x + wind->Size.x - padding.x; // Used for clipping rect adjustment. const float min_x = wind->Pos.x + padding.x; @@ -196,28 +201,24 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { bool hovered = false; bool held = false; - // ericb : pressed was unused - // bool pressed = ButtonBehavior(bb, tabHashes[i], &hovered, &held); ButtonBehavior(bb, tabHashes[i], &hovered, &held); if (held) newSelected = i; - ImU32 col; - hovered ? col = GetColorU32(ImGuiUserCol_TabHover) : col = GetColorU32(ImGuiUserCol_TabNormal); + hovered ? col = GetColorU32(ImGuiCol_ButtonHovered) : col = GetColorU32(ImGuiCol_Button); // Draw background rect - dl->AddRectFilled(bb.Min, bb.Max, col, rounding, - ImGuiCorner_TopLeft | ImGuiCorner_TopRight); + dl->AddRectFilled(bb.Min, bb.Max, col, rounding, ImDrawCornerFlags_All); + // Draw the border - _drawPartialRect(bb.Min, bb.Max,rounding, ImGuiCorner_TopLeft | ImGuiCorner_TopRight, dl, + _drawPartialRect(bb.Min, bb.Max,rounding, ImDrawCornerFlags_All, dl, (_EdgeType) (EDGE_LEFT | EDGE_RIGHT | EDGE_TOP), GetColorU32(ImGuiUserCol_TabBorderShadow)); // Draw the text const ImVec2 text_size = CalcTextSize(tabTitles[i]); const ImVec2 text_pos = pos + ImVec2(offs+((xr-xl) - text_size.x)/2.0f,((text_size.y - frame_padding.y*2.0f)/2.0f)); - dl->AddText(text_pos,GetColorU32(ImGuiUserCol_TabTitleTextNormal),tabTitles[i]); - + dl->AddText(text_pos,GetColorU32(ImGuiCol_Text),tabTitles[i]); } else{ selected_offset = offs; @@ -238,19 +239,23 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { const float xl = selected_offset - selected_expands.x + shrink; const float xr = selected_offset + division - shrink + selected_expands.y; const ImRect bb = ImRect(ImVec2(pos + ImVec2(xl, 0)),ImVec2( pos + ImVec2(xr, tab_height))); + // Draw the selected tab on top of everything else - dl->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiUserCol_TabNormal), rounding, ImGuiCorner_TopLeft | ImGuiCorner_TopRight); - dl->AddRectFilled(bb.Min, bb.Max, ImColor(1.0f, 1.0f, 1.0f, 0.35f), rounding, ImGuiCorner_TopLeft | ImGuiCorner_TopRight); + // current theme + dl->AddRectFilled(bb.Min, bb.Max,GetColorU32(ImGuiCol_ButtonActive), rounding, ImDrawCornerFlags_All); + // Draw the border - _drawPartialRect(bb.Min, bb.Max,rounding, ImGuiCorner_TopLeft | ImGuiCorner_TopRight, dl, + _drawPartialRect(bb.Min, bb.Max,rounding, ImDrawCornerFlags_All, dl, (_EdgeType) (EDGE_LEFT | EDGE_RIGHT | EDGE_TOP), GetColorU32(ImGuiUserCol_TabBorderShadow), true,selected_shadow_edges); - // Draw the text + + // at the end ... draw the text const ImVec2 text_size = CalcTextSize(tabTitles[selected_idx]); const ImVec2 text_pos = pos + ImVec2(selected_offset+((xr-xl) - text_size.x)/2.0f - selected_expands.x,((text_size.y - frame_padding.y*2.0f)/2.0f)); - dl->AddText(text_pos+ImVec2(1,1),GetColorU32(ImGuiUserCol_TabTitleTextNormal),tabTitles[selected_idx]); // Shadow - dl->AddText(text_pos,GetColorU32(ImGuiUserCol_TabTitleTextSelected),tabTitles[selected_idx]); + + // shadow or not shadow ? + dl->AddText(text_pos,GetColorU32(ImGuiCol_Text),tabTitles[selected_idx]); dc.CursorPos += ImVec2(0,tab_height + padding.y); // Add all the extra height used above. upperLeft = dc.CursorPos - ImVec2(0,padding.y); @@ -272,21 +277,21 @@ void ImGui::TabBar::_drawTabBarBottom() { // the zero below the tabs is dc.CursorPos.y - padding.y // and if we wnt to add the tab height, we'll have to remove a constant // (= all the additional offsets used for the layout). FIXME : use the real name(s) instead - const float additionnalOffsets = 92.0f; - const float height = dc.CursorPos.y - padding.y + wind->Size.y - additionnalOffsets; + const float additionnalOffset_y = 92.0f;//53.0f;//92.0f;// 63.0f; + const float height = dc.CursorPos.y - padding.y + wind->Size.y - additionnalOffset_y; const ImVec2 pos = ImVec2(wind->Pos.x + wind->Size.x - padding.x, height); // Draw the background in a given color + alpha - dl->AddRectFilled(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.15f),corner_rounding,ImGuiCorner_BotLeft | ImGuiCorner_BotRight); + dl->AddRectFilled(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.15f),corner_rounding,ImDrawCornerFlags_All); + // Draw the border in a given color + alpha - dl->AddRect(upperLeft, pos,ImColor(1.0f,1.0f,1.0f,0.35f),corner_rounding,ImGuiCorner_BotLeft | ImGuiCorner_BotRight); - // below, the real color used in the screenshot - //dl->AddRect(upperLeft, pos,ImColor(0.2f,0.2f,0.2f,0.35f),corner_rounding,ImGuiCorner_BottomLeft | ImGuiCorner_TopRight); + dl->AddRect(upperLeft, pos,ImColor(0.2f,0.2f,0.2f,0.35f),corner_rounding,ImDrawCornerFlags_All); dc.CursorPos += ImVec2(0,corner_rounding+2.0f); // Add all the extra height used above. ImGui::PopClipRect(); } + void ImGui::TabBar::_setTabCount() { if (newSelected >= 0 ){ activeTab = newSelected; @@ -354,7 +359,8 @@ void ImGui::BeginTabBar(const char *label, const ImVec2 size) { TabStack.getCurrentTabBar()->_drawTabBarTop(label); } -const bool ImGui::AddTab(const char *title) { +const bool ImGui::AddTab(const char *title) +{ // Get current TabBar; TabBar* bar = TabStack.getCurrentTabBar(); // Check to make sure there aren't any null pointers @@ -388,9 +394,88 @@ void ImGui::EndTabBar() { bar->_setTabCount(); } -/* FIXME : unused ? -void ImGui::SetActiveTabOfCurrentTabBar(const unsigned idx) { - TabStack.getCurrentTabBar()->setActiveTab(idx); +// Legacy miniDart theme +void ImGui::StyleColorsLightGreen(ImGuiStyle* dst) +{ + ImGuiStyle* style = dst ? dst : &ImGui::GetStyle(); + ImVec4* colors = style->Colors; + + style->WindowRounding = 2.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows + style->ScrollbarRounding = 3.0f; // Radius of grab corners rounding for scrollbar + style->GrabRounding = 2.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. + style->AntiAliasedLines = true; + style->AntiAliasedFill = true; + style->WindowRounding = 2; + style->ChildRounding = 2; + style->ScrollbarSize = 16; + style->ScrollbarRounding = 3; + style->GrabRounding = 2; + style->ItemSpacing.x = 10; + style->ItemSpacing.y = 4; + style->IndentSpacing = 22; + style->FramePadding.x = 6; + style->FramePadding.y = 4; + style->Alpha = 1.0f; + style->FrameRounding = 3.0f; + + colors[ImGuiCol_Text] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f); + colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f); + //colors[ImGuiCol_TextHovered] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); + //colors[ImGuiCol_TextActive] = ImVec4(1.00f, 1.00f, 0.00f, 1.00f); + colors[ImGuiCol_WindowBg] = ImVec4(0.86f, 0.86f, 0.86f, 1.00f); +// unused ?? + colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); +// ?? + colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); + colors[ImGuiCol_PopupBg] = ImVec4(0.93f, 0.93f, 0.93f, 0.98f); + colors[ImGuiCol_Border] = ImVec4(0.71f, 0.71f, 0.71f, 0.08f); + colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.04f); + colors[ImGuiCol_FrameBg] = ImVec4(0.71f, 0.71f, 0.71f, 0.55f); + colors[ImGuiCol_FrameBgHovered] = ImVec4(0.94f, 0.94f, 0.94f, 0.55f); + colors[ImGuiCol_FrameBgActive] = ImVec4(0.71f, 0.78f, 0.69f, 0.98f); + colors[ImGuiCol_TitleBg] = ImVec4(0.85f, 0.85f, 0.85f, 1.00f); + colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.82f, 0.78f, 0.78f, 0.51f); + colors[ImGuiCol_TitleBgActive] = ImVec4(0.78f, 0.78f, 0.78f, 1.00f); + colors[ImGuiCol_MenuBarBg] = ImVec4(0.86f, 0.86f, 0.86f, 1.00f); + colors[ImGuiCol_ScrollbarBg] = ImVec4(0.20f, 0.25f, 0.30f, 0.61f); + colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.90f, 0.90f, 0.90f, 0.30f); + colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.92f, 0.92f, 0.92f, 0.78f); + colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); + colors[ImGuiCol_CheckMark] = ImVec4(0.184f, 0.407f, 0.193f, 1.00f); + colors[ImGuiCol_SliderGrab] = ImVec4(0.26f, 0.59f, 0.98f, 0.78f); + colors[ImGuiCol_SliderGrabActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_Button] = ImVec4(0.71f, 0.78f, 0.69f, 0.40f); + colors[ImGuiCol_ButtonHovered] = ImVec4(0.725f, 0.805f, 0.702f, 1.00f); + colors[ImGuiCol_ButtonActive] = ImVec4(0.793f, 0.900f, 0.836f, 1.00f); + colors[ImGuiCol_Header] = ImVec4(0.71f, 0.78f, 0.69f, 0.31f); + colors[ImGuiCol_HeaderHovered] = ImVec4(0.71f, 0.78f, 0.69f, 0.80f); + colors[ImGuiCol_HeaderActive] = ImVec4(0.71f, 0.78f, 0.69f, 1.00f); +// 1.61 ? + colors[ImGuiCol_Column] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f); + colors[ImGuiCol_ColumnHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.78f); + colors[ImGuiCol_ColumnActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_Separator] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f); + colors[ImGuiCol_SeparatorHovered] = ImVec4(0.14f, 0.44f, 0.80f, 0.78f); + colors[ImGuiCol_SeparatorActive] = ImVec4(0.14f, 0.44f, 0.80f, 1.00f); +//// + colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.00f); + colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.45f); + colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.78f); +#ifdef IMGUI_VERSION_160_OR_MINUS + // obsolete since ImGui 1.61 + style->colors[ImGuiCol_CloseButton] = ImVec4(0.59f, 0.59f, 0.59f, 0.50f); + style->colors[ImGuiCol_CloseButtonActive] = ImVec4(0.98f, 0.98f, 0.98f, 1.00f); + style->colors[ImGuiCol_CloseButtonHovered] = ImVec4(1.00f, 0.43f, 0.35f, 0.90f); +#endif + + colors[ImGuiCol_PlotLines] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f); + colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f); + colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f); + colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); + colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f); + colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f); + + colors[ImGuiCol_DragDropTarget] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f); + colors[ImGuiCol_NavHighlight] = colors[ImGuiCol_HeaderHovered]; + colors[ImGuiCol_NavWindowingHighlight] = ImVec4(0.70f, 0.70f, 0.70f, 0.70f); } -*/ - diff --git a/imgui_tabs.h b/imgui_tabs.h index d44bf82..c9cf06d 100644 --- a/imgui_tabs.h +++ b/imgui_tabs.h @@ -79,27 +79,30 @@ #include "imgui_internal.h" // Define one of them to keep the compatibility with older versions of Dear ImGui - -// use this constant if you are using Dear ImGui < 1.51 //#define IMGUI_VERSION_150_OR_MINUS +//#define IMGUI_VERSION_154_OR_MINUS +//#define IMGUI_VERSION_160_OR_MINUS #if defined (IMGUI_VERSION_150_OR_MINUS) #define PathFillConvex PathFill #endif -// use this constant if you are using Dear ImGui < 1.53 -//#define IMGUI_VERSION_152_OR_MINUS - #if defined (IMGUI_VERSION_152_OR_MINUS) #define ImGuiCorner_BotLeft ImGuiCorner_BottomLeft #define ImGuiCorner_BotRight ImGuiCorner_BottomRight #endif +#if defined (IMGUI_VERSION_153_OR_MINUS) +#define AntiAliasedFill AntiAliasedShapes +#define ChildRounding ChildWindowRounding +#define ImGuiStyleVar_ChildRounding ImGuiStyleVar_ChildWindowRounding +#endif + // Extra Math Helpers (Set the proper define below in imgui_internal.h) #ifdef IMGUI_DEFINE_MATH_OPERATORS -static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x+rhs.x, lhs.y+rhs.y, lhs.z+rhs.z, lhs.w+rhs.w); } -static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x*rhs.x, lhs.y*rhs.y, lhs.z*rhs.z, lhs.w*rhs.w); } +//static inline ImVec4 operator+(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x+rhs.x, lhs.y+rhs.y, lhs.z+rhs.z, lhs.w+rhs.w); } +//static inline ImVec4 operator*(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x*rhs.x, lhs.y*rhs.y, lhs.z*rhs.z, lhs.w*rhs.w); } static inline ImVec4 operator/(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x/rhs.x, lhs.y/rhs.y, lhs.z/rhs.z, lhs.w/rhs.w); } static inline ImVec4& operator+=(ImVec4& lhs, const ImVec4& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; lhs.z += rhs.z; lhs.w += rhs.w; return lhs;} @@ -115,12 +118,12 @@ namespace ImGui ImGuiUserCol_TabBorder = 0, ImGuiUserCol_TabBorderShadow, ImGuiUserCol_TabNormal, - ImGuiUserCol_TabHover, - ImGuiUserCol_TabTitleTextNormal, - ImGuiUserCol_TabTitleTextSelected, ImGuiUserCol_COUNT }; + // New style inspired from Traditionnal Green (gtk+) on Linux + to be improved ! + IMGUI_API void StyleColorsLightGreen(ImGuiStyle* dst = NULL); // the default style in miniDart software + /// Defines our user style attributes that don't fit within the standard ImGui stack IMGUI_API struct ImGuiUserStyle { @@ -250,6 +253,6 @@ namespace ImGui /// Call this after you are done adding tabs IMGUI_API void EndTabBar(); - + } // namespace ImGui #endif //IMGUI_TABS_HPP From f574ea2aaf9153465e309f6703e78502a1c455cc Mon Sep 17 00:00:00 2001 From: ebachard Date: Thu, 26 Apr 2018 18:25:50 +0200 Subject: [PATCH 11/15] Added some information about the recent changes --- imgui_tabs.cpp | 1 + imgui_tabs.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index 1a89d46..0901d84 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -25,6 +25,7 @@ * SOFTWARE. * * **************************************************************************************/ +// 2017-2018 : some changes made by eric bachard. See the Changelog // File Name: imgui_tabs.cpp // File Description: Custom ImGui tab system module diff --git a/imgui_tabs.h b/imgui_tabs.h index c9cf06d..c929dd3 100644 --- a/imgui_tabs.h +++ b/imgui_tabs.h @@ -25,6 +25,8 @@ * SOFTWARE. * * **************************************************************************************/ + +// Some changes have been done by eric bachard. See the changelog // File Name: imgui_tabs.cpp // File Description: Custom ImGui tab system module added by me (Scott) /* From db14fa46ff482763058aeb437360eb98d5e30687 Mon Sep 17 00:00:00 2001 From: ebachard Date: Mon, 30 Apr 2018 21:03:15 +0200 Subject: [PATCH 12/15] Fixed wrong types for style variables --- imgui_tabs.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index 0901d84..1861b52 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -406,16 +406,16 @@ void ImGui::StyleColorsLightGreen(ImGuiStyle* dst) style->GrabRounding = 2.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. style->AntiAliasedLines = true; style->AntiAliasedFill = true; - style->WindowRounding = 2; - style->ChildRounding = 2; - style->ScrollbarSize = 16; - style->ScrollbarRounding = 3; - style->GrabRounding = 2; - style->ItemSpacing.x = 10; - style->ItemSpacing.y = 4; - style->IndentSpacing = 22; - style->FramePadding.x = 6; - style->FramePadding.y = 4; + style->WindowRounding = 2.0f; + style->ChildRounding = 2.0f; + style->ScrollbarSize = 16.0f; + style->ScrollbarRounding = 3.0f; + style->GrabRounding = 2.0f; + style->ItemSpacing.x = 10.0f; + style->ItemSpacing.y = 4.0f; + style->IndentSpacing = 22.0f; + style->FramePadding.x = 6.0f; + style->FramePadding.y = 4.0f; style->Alpha = 1.0f; style->FrameRounding = 3.0f; From aeb4f063356806e00636ef549259bff8d7085f12 Mon Sep 17 00:00:00 2001 From: erba Date: Wed, 18 Jul 2018 08:59:01 +0200 Subject: [PATCH 13/15] Resnc with Dear ImGui (1.63 WIP july 18th) --- imgui_tabs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index 1861b52..31d1913 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -138,7 +138,7 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { // Gather pointers and references ImGuiWindow* wind = ImGui::GetCurrentWindow(); ImDrawList* dl = wind->DrawList; - ImGuiDrawContext& dc = wind->DC; + ImGuiWindowTempData& dc = wind->DC; ImGuiStyle& style = ImGui::GetStyle(); std::string str = label; @@ -269,7 +269,7 @@ void ImGui::TabBar::_drawTabBarBottom() { ImGuiWindow* wind = ImGui::GetCurrentWindow(); ImDrawList* dl = wind->DrawList; ImGuiStyle& style = ImGui::GetStyle(); - ImGuiDrawContext& dc = wind->DC; + ImGuiWindowTempData& dc = wind->DC; const ImVec2 padding = style.WindowPadding; From 9c4c0dbce9d06bb8f250941bc4282d5698f585b2 Mon Sep 17 00:00:00 2001 From: erba Date: Fri, 31 Aug 2018 15:15:37 +0200 Subject: [PATCH 14/15] Now resync'ed with ImGui1.64 --- imgui_tabs.cpp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index 31d1913..bab0faf 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -138,11 +138,12 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { // Gather pointers and references ImGuiWindow* wind = ImGui::GetCurrentWindow(); ImDrawList* dl = wind->DrawList; - ImGuiWindowTempData& dc = wind->DC; + ImGuiDrawContext& dc = wind->DC; ImGuiStyle& style = ImGui::GetStyle(); std::string str = label; barTitle = str.substr(0,str.find_first_of("#")); + if (barTitle.length()>0) ImGui::Text(std::string("\t"+barTitle).c_str(), "%s"); @@ -160,7 +161,7 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { static constexpr const float shrink = 1.0f; // ericb ajouté 2.0, parce que pas assez d'espace - const float tab_height = CalcTextSize(tabTitles[0]).y + (frame_padding.y * 2) + 2.0; + const float tab_height = CalcTextSize(tabTitles[0]).y + (frame_padding.y * 2) + 6.0; float selected_offset = 0; // FIXME unused @@ -168,8 +169,8 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { ImVec2 selected_expands; _EdgeType selected_shadow_edges = EDGE_NONE; int selected_idx = 0; + // Store maximum/minimum x value for clipping rect. - // TEST3 const float max_x = wind->Pos.x + wind->Size.x - padding.x; // Used for clipping rect adjustment. const float min_x = wind->Pos.x + padding.x; @@ -180,14 +181,16 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { newSelected = -1; // Draw the tabs - for (int i = 0; iAddText(text_pos,GetColorU32(ImGuiCol_Text),tabTitles[i]); - } else{ + } + else + { selected_offset = offs; selected_idx = i; - if (i == 0) { + if (i == 0) + { selected_expands = ImVec2(0,rounding); selected_shadow_edges = EDGE_RIGHT; - } else if (i == tabCount - 1) { + } + else if (i == tabCount - 1) + { selected_expands = ImVec2(rounding,0); selected_shadow_edges = EDGE_LEFT; - } else { + } + else + { selected_expands = ImVec2(rounding,rounding); selected_shadow_edges = (_EdgeType)(EDGE_RIGHT | EDGE_LEFT); } } } + const float xl = selected_offset - selected_expands.x + shrink; const float xr = selected_offset + division - shrink + selected_expands.y; const ImRect bb = ImRect(ImVec2(pos + ImVec2(xl, 0)),ImVec2( pos + ImVec2(xr, tab_height))); @@ -253,7 +264,7 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { // at the end ... draw the text const ImVec2 text_size = CalcTextSize(tabTitles[selected_idx]); - const ImVec2 text_pos = pos + ImVec2(selected_offset+((xr-xl) - text_size.x)/2.0f - selected_expands.x,((text_size.y - frame_padding.y*2.0f)/2.0f)); + const ImVec2 text_pos = pos + ImVec2(selected_offset+((xr-xl) - text_size.x)/2.0f + 2.0f - selected_expands.x,((text_size.y - frame_padding.y*2.0f)/2.0f)); // shadow or not shadow ? dl->AddText(text_pos,GetColorU32(ImGuiCol_Text),tabTitles[selected_idx]); @@ -269,7 +280,7 @@ void ImGui::TabBar::_drawTabBarBottom() { ImGuiWindow* wind = ImGui::GetCurrentWindow(); ImDrawList* dl = wind->DrawList; ImGuiStyle& style = ImGui::GetStyle(); - ImGuiWindowTempData& dc = wind->DC; + ImGuiDrawContext& dc = wind->DC; const ImVec2 padding = style.WindowPadding; @@ -278,7 +289,7 @@ void ImGui::TabBar::_drawTabBarBottom() { // the zero below the tabs is dc.CursorPos.y - padding.y // and if we wnt to add the tab height, we'll have to remove a constant // (= all the additional offsets used for the layout). FIXME : use the real name(s) instead - const float additionnalOffset_y = 92.0f;//53.0f;//92.0f;// 63.0f; + const float additionnalOffset_y = 67.0f;//53.0f;//92.0f;// 63.0f; const float height = dc.CursorPos.y - padding.y + wind->Size.y - additionnalOffset_y; const ImVec2 pos = ImVec2(wind->Pos.x + wind->Size.x - padding.x, height); From 53578bffb6728247e93d3aaba4ec3f18d53a7c56 Mon Sep 17 00:00:00 2001 From: SR_team Date: Sun, 7 Oct 2018 15:16:31 +0300 Subject: [PATCH 15/15] Update to ImGui 1.66 --- imgui_tabs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui_tabs.cpp b/imgui_tabs.cpp index bab0faf..9a6fe92 100644 --- a/imgui_tabs.cpp +++ b/imgui_tabs.cpp @@ -138,7 +138,7 @@ void ImGui::TabBar::_drawTabBarTop(const char *label) { // Gather pointers and references ImGuiWindow* wind = ImGui::GetCurrentWindow(); ImDrawList* dl = wind->DrawList; - ImGuiDrawContext& dc = wind->DC; + ImGuiWindowTempData& dc = wind->DC; ImGuiStyle& style = ImGui::GetStyle(); std::string str = label; @@ -280,7 +280,7 @@ void ImGui::TabBar::_drawTabBarBottom() { ImGuiWindow* wind = ImGui::GetCurrentWindow(); ImDrawList* dl = wind->DrawList; ImGuiStyle& style = ImGui::GetStyle(); - ImGuiDrawContext& dc = wind->DC; + ImGuiWindowTempData& dc = wind->DC; const ImVec2 padding = style.WindowPadding;