Skip to content

Commit

Permalink
settings: fix crash on search, separator in vertical mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Eknous-P committed Nov 20, 2024
1 parent 7e5387e commit ccbeb2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#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();
ImGui::PushID(cat->id);
if (cat->children.size()>0) {
ImGuiTreeNodeFlags f=ImGuiTreeNodeFlags_SpanFullWidth|ImGuiTreeNodeFlags_OpenOnArrow|ImGuiTreeNodeFlags_OpenOnDoubleClick;
if (settings.activeCategory.name==cat->name) f|=ImGuiTreeNodeFlags_Selected;
Expand All @@ -50,7 +50,6 @@ void FurnaceGUI::drawSettingsCategory(SettingsCategory* cat) {
}
ImGui::EndDisabled();
}
ImGui::PopID();
}

void FurnaceGUI::searchDrawSettingItems(SettingsCategory* cat) {
Expand Down Expand Up @@ -312,10 +311,11 @@ void FurnaceGUI::drawSettings() {
for (SettingsCategory cat:settings.categories) drawSettingsCategory(&cat);
}
ImGui::EndChild();
if (ImGui::GetWindowSize().y>ImGui::GetWindowSize().x) ImGui::TableNextRow();
if (vertical) ImGui::TableNextRow();
ImGui::TableNextColumn();
ImVec2 settingsItemsViewSize=ImGui::GetContentRegionAvail();
settingsItemsViewSize.y-=ImGui::GetFrameHeight()+ImGui::GetStyle().WindowPadding.y;
if (vertical) ImGui::Separator();
if (ImGui::BeginChild("SettingsItems",settingsItemsViewSize)) {
drawSettingsItems();
if ((strncmp(settings.filter.InputBuf,"cheat",6)==0) && !nonLatchNibble) {
Expand Down

0 comments on commit ccbeb2e

Please sign in to comment.