@@ -661,7 +661,7 @@ static size_t get_dialog_items_count(const rg_gui_option_t *options)
661661 return opt - options ;
662662}
663663
664- void rg_gui_draw_dialog (const char * title , const rg_gui_option_t * options , size_t options_count , int sel )
664+ rg_rect_t rg_gui_draw_dialog (const char * title , const rg_gui_option_t * options , size_t options_count , int sel ) // const rg_rect_t *rect,
665665{
666666 RG_ASSERT_ARG (options || options_count == 0 );
667667
@@ -674,6 +674,7 @@ void rg_gui_draw_dialog(const char *title, const rg_gui_option_t *options, size_
674674 const int row_padding_x = 8 ;
675675 const int max_inner_width = max_box_width - sep_width - (row_padding_x + box_padding ) * 2 ;
676676
677+ int box_x , box_y ;
677678 int box_width = box_padding * 2 ;
678679 int box_height = box_padding * 2 + (title ? font_height + 6 : 0 );
679680 int inner_width = TEXT_RECT (title , 0 ).width ;
@@ -717,9 +718,8 @@ void rg_gui_draw_dialog(const char *title, const rg_gui_option_t *options, size_
717718 col2_width = inner_width - col1_width - sep_width ;
718719 box_width += inner_width + row_padding_x * 2 ;
719720 box_height = RG_MIN (box_height , max_box_height );
720-
721- const int box_x = (gui .screen_width - box_width ) / 2 ;
722- const int box_y = (gui .screen_height - box_height ) / 2 ;
721+ box_x = (gui .screen_width - box_width ) / 2 ;
722+ box_y = (gui .screen_height - box_height ) / 2 ;
723723
724724 int x = box_x + box_padding ;
725725 int y = box_y + box_padding ;
@@ -804,9 +804,14 @@ void rg_gui_draw_dialog(const char *title, const rg_gui_option_t *options, size_
804804 rg_gui_draw_rect (box_x , y , box_width , (box_y + box_height ) - y , 0 , 0 , gui .style .box_background );
805805 }
806806
807+ // Draw box border
807808 rg_gui_draw_rect (box_x , box_y , box_width , box_height , box_padding , gui .style .box_background , C_NONE );
808809 rg_gui_draw_rect (box_x - 1 , box_y - 1 , box_width + 2 , box_height + 2 , 1 , gui .style .box_border , C_NONE );
809810
811+ // Draw box shadow
812+ // rg_gui_draw_rect(box_x + box_width + 4, box_y + box_height, box_width, 4, 0, C_NONE, gui.style.shadow); // Bottom
813+ // rg_gui_draw_rect(box_x + box_width, box_y + 4, 4, box_height, 0, C_NONE, gui.style.shadow); // left
814+
810815 // Basic scroll indicators are overlayed at the end...
811816 if (list_top_i > 0 )
812817 {
@@ -816,7 +821,6 @@ void rg_gui_draw_dialog(const char *title, const rg_gui_option_t *options, size_
816821 rg_gui_draw_rect (x + 1 , y - 2 , 4 , 2 , 0 , 0 , gui .style .scrollbar );
817822 rg_gui_draw_rect (x + 2 , y - 4 , 2 , 2 , 0 , 0 , gui .style .scrollbar );
818823 }
819-
820824 if (list_end_i + 1 < options_count )
821825 {
822826 int x = box_x + box_width - 10 ;
@@ -825,9 +829,11 @@ void rg_gui_draw_dialog(const char *title, const rg_gui_option_t *options, size_
825829 rg_gui_draw_rect (x + 1 , y - 2 , 4 , 2 , 0 , 0 , gui .style .scrollbar );
826830 rg_gui_draw_rect (x + 2 , y - 0 , 2 , 2 , 0 , 0 , gui .style .scrollbar );
827831 }
832+
833+ return (rg_rect_t ){box_x , box_y , box_width , box_height };
828834}
829835
830- void rg_gui_draw_message (const char * format , ...)
836+ rg_rect_t rg_gui_draw_message (const char * format , ...) // const rg_rect_t *rect,
831837{
832838 RG_ASSERT_ARG (format );
833839
@@ -841,7 +847,7 @@ void rg_gui_draw_message(const char *format, ...)
841847 RG_DIALOG_END ,
842848 };
843849 // FIXME: Should rg_display_force_redraw() be called? Before? After? Both?
844- rg_gui_draw_dialog (NULL , options , 1 , 0 );
850+ return rg_gui_draw_dialog (NULL , options , 1 , 0 );
845851}
846852
847853intptr_t rg_gui_dialog (const char * title , const rg_gui_option_t * options_const , int selected_index )
@@ -2153,7 +2159,7 @@ void rg_gui_debug_menu(void)
21532159 snprintf (heap_free , 20 , "%d+%d" , stats .freeMemoryInt , stats .freeMemoryExt );
21542160 snprintf (block_free , 20 , "%d+%d" , stats .freeBlockInt , stats .freeBlockExt );
21552161 snprintf (app_name , 32 , "%s" , rg_system_get_app ()-> name );
2156- snprintf (uptime , 20 , "%ds" , ( int )( rg_system_timer () / 1000000 ) );
2162+ snprintf (uptime , 20 , "%ds" , stats . uptime );
21572163 snprintf (overclock , 20 , "%d (%dMhz)" , rg_system_get_overclock (), rg_system_get_cpu_speed ());
21582164
21592165 rg_battery_t battery ;
0 commit comments