diff options
| author | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-01 14:33:14 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-01 14:33:14 +0100 |
| commit | a1d639e963eaad1f8d24d47cd004c22052166978 (patch) | |
| tree | 473a9a1b8b9ed5bd0c24a81fa848c31d3db788d0 /src/ui/ui_invoices.cpp | |
| parent | be5c11029adb25c586c4fcde6fedfa01d1bdcd49 (diff) | |
export dropdown ui
Diffstat (limited to 'src/ui/ui_invoices.cpp')
| -rw-r--r-- | src/ui/ui_invoices.cpp | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/ui/ui_invoices.cpp b/src/ui/ui_invoices.cpp index 6a50c7f..eb04af4 100644 --- a/src/ui/ui_invoices.cpp +++ b/src/ui/ui_invoices.cpp @@ -20,6 +20,7 @@ #include "ui.hpp" #include "imgui.h" #include "memops.hpp" +#include "config.hpp" #include "strops.hpp" #include "locales.hpp" #include "importer.hpp" @@ -484,6 +485,28 @@ static void draw_invoice_create() ImGui::EndChild(); } +static void draw_send_options() +{ + static exporter::export_request* active_request = NULL; + + if (ImGui::BeginExportDropdown("##Send", locale::get("ui.sendAs"), active_request)) + { + if (ImGui::Selectable(locale::get("ui.sendAs.email"), false)) { + active_request = exporter::send_email("test@test-vz9dlemj2564kj50.mlsender.net", "aldrikboy@gmail.com", "test", "test 123", + [](e_err status) { + if (status == E_ERR_SUCCESS) { + administration::activity_add(ACTIVITY_USER, active_invoice.id, "Sent email", 0); + _reload_activities(); + } + }); + } + // if (ImGui::Selectable(locale::get("ui.sendAs.einvoice"), false)) { + + // } + ImGui::EndCombo(); + } +} + static void draw_invoice_view() { if (ImGui::Button(locale::get("form.back"), true, false)) { @@ -499,17 +522,8 @@ static void draw_invoice_view() ImGui::SameLine(); - ImGui::PushItemWidth(100.0f); - if (ImGui::BeginCombo("##Send", locale::get("ui.sendAs"))) - { - if (ImGui::Selectable(locale::get("ui.sendAs.email"), false)) { - exporter::send_email("test@test-vz9dlemj2564kj50.mlsender.net", "aldrikboy@gmail.com", "test", "test 123"); - } - // if (ImGui::Selectable(locale::get("ui.sendAs.einvoice"), false)) { - - // } - ImGui::EndCombo(); - } + ImGui::PushItemWidth(180.0f); + draw_send_options(); ImGui::PushItemWidth(0.0f); ImGui::SameLine(); |
