aboutsummaryrefslogtreecommitdiff
path: root/kscurses/ui/group.jai
diff options
context:
space:
mode:
authordam <dam@gudinoff>2024-03-11 00:10:26 +0000
committerdam <dam@gudinoff>2024-03-11 00:10:26 +0000
commit4013fe7798a04761102fb2511c6eb6afbeeca4b8 (patch)
treebfd7251981c30327b9882f6f4983d3ed4077e2bc /kscurses/ui/group.jai
parentb379cbe75de1f4cf6ef9fabd73b1c0c9630af842 (diff)
downloadtask-time-tracker-4013fe7798a04761102fb2511c6eb6afbeeca4b8.tar.zst
task-time-tracker-4013fe7798a04761102fb2511c6eb6afbeeca4b8.zip
Removing curses dependency files.
Diffstat (limited to 'kscurses/ui/group.jai')
-rw-r--r--kscurses/ui/group.jai44
1 files changed, 0 insertions, 44 deletions
diff --git a/kscurses/ui/group.jai b/kscurses/ui/group.jai
deleted file mode 100644
index 366c513..0000000
--- a/kscurses/ui/group.jai
+++ /dev/null
@@ -1,44 +0,0 @@
-UI_Group :: struct {
- #as using base_parent : UI_Parent = .{type = .GROUP};
-
- Element :: struct {
- ptr : *UI_Elem;
- zone : Ibox2;
- }
-
- elements : []Element;
-}
-set_sub_elements :: (group : *UI_Group, elements : ..UI_Group.Element) {
- group.elements = elements;
- for e : elements {
- e.ptr.parent = group;
- }
-}
-c_draw_group :: (canvas : *Canvas, ui_elem : *UI_Elem, zone : Ibox2, style : *UI_Style) -> bool {
- using cast(*UI_Group) ui_elem;
- for e : elements {
- e_zone := e.zone;
- if !inside(e_zone, zone.size) return false;
- e_zone.corner += zone.corner;
- if !c_draw(canvas, e.ptr, e_zone, style) return false;
- }
- return true;
-}
-handle_key_group :: (ui_elem : *UI_Elem, key : Key) -> handled:bool {
- using cast(*UI_Group) ui_elem;
- assert(cursor_state == .ON || cursor_state == .OUTSIDE);
-
- handled := false;
- if cursor_state == .OUTSIDE {
- assert(xx active_element);
- {
- ok := false;
- for e : elements if e.ptr == active_element ok = true;
- assert(ok);
- }
- handled = handle_key(active_element, key);
- } else {
- assert(xx !active_element);
- }
- return handled;
-} \ No newline at end of file