summaryrefslogtreecommitdiff
path: root/include/ui.hpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-10-26 17:23:28 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-10-26 17:23:28 +0100
commit60488d722bf29f3ff0ce3e08b90f30523a8d7b6d (patch)
treec2e01243d8a0d970c35e250b66a66a226ab230dc /include/ui.hpp
parent5e06ad208e32330b662af90ce41613f5421095cb (diff)
loading animations and block navigation while writing to disk
Diffstat (limited to 'include/ui.hpp')
-rw-r--r--include/ui.hpp19
1 files changed, 2 insertions, 17 deletions
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);