Skip to content

Commit

Permalink
ThemeTweak: older themes at the end of list
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Jun 18, 2024
1 parent a8ea6d0 commit ed40bce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hello_imgui/impl/imgui_theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,9 +1024,11 @@ namespace ImGuiTheme
ImVec2 listboxSize = ImVec2(0.f, ImGuiTheme_Count * (ImGui::GetFontSize() + ImGui::GetStyle().ItemInnerSpacing.y) );
if (ImGui::BeginListBox("Available_themes", listboxSize))
{
for (int i = 0; i < ImGuiTheme_Count; ++i)
int nbThemes = ImGuiTheme_Count;
// We start at 3 because we want to place the older themes at the end
for (int i = 3; i < nbThemes + 3; ++i)
{
ImGuiTheme_ theme_i = (ImGuiTheme_)(i);
ImGuiTheme_ theme_i = (ImGuiTheme_)(i % nbThemes);
const bool is_selected = (*theme == theme_i);
if (ImGui::Selectable(ImGuiTheme_Name(theme_i), is_selected))
{
Expand Down

0 comments on commit ed40bce

Please sign in to comment.