From 60488d722bf29f3ff0ce3e08b90f30523a8d7b6d Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 26 Oct 2025 17:23:28 +0100 Subject: loading animations and block navigation while writing to disk --- include/ui.hpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'include/ui.hpp') diff --git a/include/ui.hpp b/include/ui.hpp index 88a88ec..8b3d10d 100644 --- a/include/ui.hpp +++ b/include/ui.hpp @@ -46,27 +46,10 @@ namespace ui { VIEW_IMPORT_REQUEST, } view_state; - typedef struct - { - bool visible; - int flash_count; - int color; - char text[STATUS_TEXT_LEN]; - float time; - bool loading; - } status; - extern ImFont* fontBold; extern ImFont* fontBig; void set_state(main_state state); - - // Status functions. - status get_status(); - void set_status_loading(bool loading); - void set_status_error(const char* txt); - void set_status(const char* txt); - void draw_status(); // Draw calls. void draw_main(); @@ -100,6 +83,8 @@ namespace ui { namespace ImGui { bool WarningIcon(float radius); + bool Button(const char* label, bool block_while_writing_to_disk, bool show_loading_indicator_while_blocked = true); + bool CheckboxX(const char* label, bool* v, bool disabled = false, bool show_loading_indicator_while_disabled = false); void InputTextWithError(const char* text, char* buffer, size_t buf_size, bool has_error); int InputTextWithAutocomplete(const char* hint, char* buffer, size_t buf_size, char** suggestions, int suggestion_count, bool has_error); -- cgit v1.2.3-70-g09d2