1+ #include "gui_element_footer.h"
2+ #include <stdio.h>
3+ #include <stdlib.h>
4+ #include <string.h>
5+ #include "gui_element_icontext.h"
6+ #include "pax_gfx.h"
7+
8+ void gui_footer_draw (pax_buf_t * pax_buffer , gui_theme_t * theme , gui_element_icontext_t * left , size_t left_count ,
9+ gui_element_icontext_t * right , size_t right_count ) {
10+ gui_element_style_t * style = & theme -> footer ;
11+ int buffer_width = pax_buf_get_width (pax_buffer );
12+ int buffer_height = pax_buf_get_height (pax_buffer );
13+ int box_height = style -> height + (style -> vertical_margin * 2 );
14+
15+ pax_draw_line (pax_buffer , theme -> palette .color_foreground , style -> horizontal_margin , buffer_height - box_height ,
16+ buffer_width - style -> horizontal_margin , buffer_height - box_height );
17+
18+ int x = style -> horizontal_margin + style -> horizontal_padding ;
19+ for (size_t i = 0 ; i < left_count ; i ++ ) {
20+ x += gui_icontext_draw (pax_buffer , theme , x , buffer_height - box_height , & left [i ], style -> horizontal_padding ,
21+ box_height );
22+ }
23+
24+ x = buffer_width - style -> horizontal_margin ;
25+ for (size_t i = 0 ; i < right_count ; i ++ ) {
26+ x -= gui_icontext_width (theme , buffer_width , buffer_height , & right [i ], style -> horizontal_padding );
27+ gui_icontext_draw (pax_buffer , theme , x - style -> horizontal_padding , buffer_height - box_height , & right [i ],
28+ style -> horizontal_padding , box_height );
29+ }
30+ }
0 commit comments