Skip to content

Commit

Permalink
Adjust imgui_savestyle.cpp for 1.91.4
Browse files Browse the repository at this point in the history
ImGuiCol_NavHighlight has been renamed to ImGuiCol_NavCursor
  • Loading branch information
DanielGibson committed Oct 29, 2024
1 parent 97edc59 commit 81cab59
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions neo/sys/imgui_savestyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Hosted at https://github.com/DanielGibson/Snippets/
*
* Written for/tested with Dear ImGui v1.90.8 (incl. Docking Branch)
* Written for/tested with Dear ImGui v1.91.4 (incl. Docking Branch)
*
* If anything changes in struct ImGuiStyle or enum ImGuiCol_, this code should detect it
* during compilation and give (hopefully) helpful errors with static_assert() (always check and
Expand Down Expand Up @@ -208,7 +208,7 @@ namespace DG {
D3_IMSTYLE_COLOR( TextLink ) \
D3_IMSTYLE_COLOR( TextSelectedBg ) \
D3_IMSTYLE_COLOR( DragDropTarget ) \
D3_IMSTYLE_COLOR( NavHighlight ) \
D3_IMSTYLE_COLOR( NavCursor ) \
D3_IMSTYLE_COLOR( NavWindowingHighlight ) \
D3_IMSTYLE_COLOR( NavWindowingDimBg ) \
D3_IMSTYLE_COLOR( ModalWindowDimBg )
Expand Down Expand Up @@ -309,9 +309,10 @@ struct ImGuiColorBackwardCompat {
};

static struct ImGuiColorBackwardCompat backwardCompatColorMappings[] = {
{ "TabActive", ImGuiCol_TabSelected },
{ "TabUnfocused", ImGuiCol_TabDimmed },
{ "TabUnfocusedActive", ImGuiCol_TabDimmedSelected },
{ "TabActive", ImGuiCol_TabSelected }, // renamed in 1.90.9
{ "TabUnfocused", ImGuiCol_TabDimmed }, // renamed in 1.90.9
{ "TabUnfocusedActive", ImGuiCol_TabDimmedSelected }, // renamed in 1.90.9
{ "NavHighlight", ImGuiCol_NavCursor }, // renamed in 1.91.4
};

} //anon namespace
Expand All @@ -330,11 +331,6 @@ static void parseColorLine( ImGuiStyle& s, const char* line )

#undef D3_IMSTYLE_COLOR

// NOTE: here backwards-compat is also possible, like
// if ( sscanf( line, "OldColorName = %f , %f , %f , %f", &c.x, &c.y, &c.z, &c.w) == 4 ) {
// s.Colors[ ImGuiCol_NewColorName ] = c;
// return;
// }
for( const ImGuiColorBackwardCompat& bc : backwardCompatColorMappings ) {
char matchString[64];
snprintf( matchString, sizeof(matchString), "%s = %%f , %%f , %%f , %%f", bc.oldColorStr );
Expand Down

0 comments on commit 81cab59

Please sign in to comment.