From 7e6e1b3cc472b03410dd81ab2d804a6017262f99 Mon Sep 17 00:00:00 2001 From: Yimura Date: Sat, 8 Jan 2022 22:30:39 +0100 Subject: [PATCH] feat(Globals): Modified styling of buttons and fields --- .../src/gui/window/dbg/debug_globals.cpp | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/BigBaseV2/src/gui/window/dbg/debug_globals.cpp b/BigBaseV2/src/gui/window/dbg/debug_globals.cpp index 79e9ff94..82e56ffd 100644 --- a/BigBaseV2/src/gui/window/dbg/debug_globals.cpp +++ b/BigBaseV2/src/gui/window/dbg/debug_globals.cpp @@ -27,27 +27,37 @@ namespace big for (auto& global : g_globals_service->m_globals) { + char label[64]; + ImGui::Separator(); - char label[64]; - sprintf(label, "Freeze###freeze_%d", global.get_id()); + sprintf(label, "Freeze##%d", global.get_id()); ImGui::Checkbox(label, &global.m_freeze); + + ImGui::BeginGroup(); + + ImGui::Text("Name:"); + ImGui::Text("Value:"); + + ImGui::EndGroup(); + ImGui::SameLine(); + ImGui::BeginGroup(); + ImGui::Text(global.m_name.c_str()); - ImGui::SameLine(); - + sprintf(label, "###input_%d", global.get_id()); - ImGui::PushItemWidth(200.f); + ImGui::SetNextItemWidth(200.f); ImGui::InputInt(label, global.get()); - ImGui::PopItemWidth(); - sprintf(label, "Write###btn_%d", global.get_id()); - if (ImGui::Button(label)) - global.write(); + ImGui::EndGroup(); ImGui::SameLine(); - sprintf(label, "Delete##delete_%d", global.get_id()); + + ImGui::BeginGroup(); + + sprintf(label, "Delete##%d", global.get_id()); if (ImGui::Button(label)) { for (int i = 0; i < g_globals_service->m_globals.size(); i++) @@ -56,6 +66,12 @@ namespace big break; } + + sprintf(label, "Write###%d", global.get_id()); + if (ImGui::Button(label)) + global.write(); + + ImGui::EndGroup(); } ImGui::EndTabItem();