diff options
| author | physick <mynameisgennadiy@vk.com> | 2026-09-06 16:10:24 +0500 |
|---|---|---|
| committer | physick <mynameisgennadiy@vk.com> | 2026-09-06 16:10:24 +0500 |
| commit | 2284646db66fc117246225bd30298ddbef8ed13a (patch) | |
| tree | 05f3d0ff88932c9f49db00821f12a3a1ee6f2ea8 /src/ui_elements | |
| parent | c88bb49416aaeb13c3969727a305bc7ed3263963 (diff) | |
Diffstat (limited to 'src/ui_elements')
| -rw-r--r-- | src/ui_elements/UI.c | 8 | ||||
| -rw-r--r-- | src/ui_elements/UI.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/ui_elements/UI.c b/src/ui_elements/UI.c index ea3463a..f9b7527 100644 --- a/src/ui_elements/UI.c +++ b/src/ui_elements/UI.c @@ -139,6 +139,7 @@ void GetPanesSplit(Rectangle *pane1, Rectangle *pane2, Rectangle body, float pro pane2->width = (body.width - PADDING) * (1 - proportion_h); } +// !! Not used anywhere at this moment void DrawPageView(int y, unsigned int pages, unsigned int current_page) { if (pages == 0) return; float width = 2 * PAGE_DOTS_PADDING @@ -168,3 +169,10 @@ void DrawPageView(int y, unsigned int pages, unsigned int current_page) { x_pos += PAGE_DOTS_SPACING + PAGE_DOTS_RADIUS * 2; } } + +void PrintTime(char *trg, size_t seconds) { + if (trg == NULL) return; + size_t disp_minutes = seconds / 60; + size_t disp_seconds = seconds % 60; + sprintf(trg, "%02zu:%02zu", disp_minutes, disp_seconds); +} diff --git a/src/ui_elements/UI.h b/src/ui_elements/UI.h index e48804e..356c2f4 100644 --- a/src/ui_elements/UI.h +++ b/src/ui_elements/UI.h @@ -50,6 +50,7 @@ static const int PAGE_DOTS_RADIUS = 3; static const char PAGE_DOTS_TRANSPARENCY = (char)192; /// Draws the little dots that represent the page you are on +// !! Not used anywhere at this moment void DrawPageView(int y, unsigned int pages, unsigned int current_page); // ========== TEXT EDITOR ========== @@ -104,4 +105,8 @@ void FreeTextArea(TextArea *ta); /// and vertical orientation void GetPanesSplit(Rectangle *pane1, Rectangle *pane2, Rectangle body, float proportion_h, float proportion_v); +/// Prints the time in the format MM:SS to the trg. +/// It is expected that size of outp buffer is at least 16 bytes +void PrintTime(char *trg, size_t seconds); + #endif // UI_ELEMENTS_H |
