Skip to content

Commit

Permalink
settings: double indent when treenode collapsed but search make it ex…
Browse files Browse the repository at this point in the history
…pand aaaaaa
  • Loading branch information
Eknous-P committed Nov 22, 2024
1 parent 2e7a1cb commit a466380
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gui/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "../ta-log.h"
#include "../fileutils.h"
#include "misc/freetype/imgui_freetype.h"
#include <imgui.h>

void FurnaceGUI::drawSettingsCategory(SettingsCategory* cat) {
bool filterActive=settings.filter.IsActive();
Expand All @@ -37,10 +36,12 @@ void FurnaceGUI::drawSettingsCategory(SettingsCategory* cat) {
if (ImGui::IsItemClicked()) {
settings.activeCategory=*cat;
}
float indentWidth=ImGui::GetStyle().IndentSpacing;
if (!cat->expandChild) indentWidth*=2.0f;
if (cat->expandChild || filterActive) {
ImGui::Indent();
ImGui::Indent(indentWidth);
for (SettingsCategory child:cat->children) drawSettingsCategory(&child);
ImGui::Unindent();
ImGui::Unindent(indentWidth);
if (cat->expandChild) ImGui::TreePop();
}
} else { // a lonely child...
Expand Down

0 comments on commit a466380

Please sign in to comment.