From 2cf031b91d5248561fbeff78ceccb0b2d6c73809 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 9 Aug 2025 11:18:02 +0200 Subject: refactors, working on settings view --- src/ui/ui_settings.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/ui/ui_settings.cpp (limited to 'src/ui/ui_settings.cpp') diff --git a/src/ui/ui_settings.cpp b/src/ui/ui_settings.cpp new file mode 100644 index 0000000..81f6d31 --- /dev/null +++ b/src/ui/ui_settings.cpp @@ -0,0 +1,35 @@ +#include "ui.hpp" +#include "imgui.h" +#include "administration.hpp" +#include "locales.hpp" + +extern bool draw_contact_form(contact* buffer, bool back_button_enabled = true, bool viewing_only = false); + +static contact company_info; +void ui_setup_settings() +{ + company_info = administration_get_company_info(); +} + +void ui_draw_settings() +{ + // @localize + if (ImGui::BeginTabBar("SettingsTabBar", 0)) + { + if (ImGui::BeginTabItem("Company")) + { + bool save = draw_contact_form(&company_info, false); + + if (save) { + administration_set_company_info(company_info); + } + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("VAT Rates")) + { + ImGui::Text("This is the Broccoli tab!\nblah blah blah blah blah"); + ImGui::EndTabItem(); + } + ImGui::EndTabBar(); + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2