39
39
#define ICON_BORDER_FOCUS_COLOR (0x14bacb)
40
40
#define ICON_BORDER_MARGIN (5)
41
41
#define ICON_MARGIN (20)
42
+ #define LOADING_SIZE (18)
42
43
43
44
kfont_t font ;
44
45
@@ -480,6 +481,13 @@ int reload_icons(){
480
481
return 0 ;
481
482
}
482
483
484
+ void show_loading_screen (){
485
+ memset (fb .buffer , 0 , fb .size );
486
+ load_pen (font , & fb , 0 , 0 , LOADING_SIZE , 0 , DATE_TIME_COLOR );
487
+ write_paragraph (font , 0 , (fb .height - LOADING_SIZE ) / 2 , fb .width , PARAGRAPH_CENTER , "Loading..." , -1 );
488
+ draw_frame ();
489
+ }
490
+
483
491
void get_input (){
484
492
static bool arrow_pressed = false;
485
493
static bool wait_release = false;
@@ -558,10 +566,12 @@ void get_input(){
558
566
focus_icon_row = 0 ;
559
567
focus_icon_column = 0 ;
560
568
current_page = 0 ;
569
+ show_loading_screen ();
561
570
process_icons ();
562
571
update_icon_page = true;
563
572
}else {
564
573
if (icons_executable_path [c ] != NULL ){
574
+ show_loading_screen ();
565
575
pid_t p = fork ();
566
576
if (p < 0 ){
567
577
perror ("explorer: fork failed" );
@@ -585,6 +595,7 @@ void get_input(){
585
595
reload_icons ();
586
596
}
587
597
}else if (icons_try_to_execute [c ]){
598
+ show_loading_screen ();
588
599
pid_t p = fork ();
589
600
if (p < 0 ){
590
601
perror ("explorer: fork failed" );
@@ -616,6 +627,7 @@ void get_input(){
616
627
}
617
628
}else if (key == 62 && pressed ){
618
629
// open bash
630
+ show_loading_screen ();
619
631
pid_t p = fork ();
620
632
if (p < 0 ){
621
633
perror ("desktop: fork failed" );
@@ -641,6 +653,7 @@ void get_input(){
641
653
}
642
654
}else if (key == 61 && pressed ){
643
655
// go back directory
656
+ show_loading_screen ();
644
657
char * parent_directory = get_parent_directory (current_path );
645
658
free (current_path );
646
659
current_path = parent_directory ;
@@ -655,6 +668,7 @@ void get_input(){
655
668
current_page ++ ;
656
669
focus_icon_row = 0 ;
657
670
focus_icon_column = 0 ;
671
+ show_loading_screen ();
658
672
process_icons ();
659
673
update_icon_page = true;
660
674
}
@@ -664,6 +678,7 @@ void get_input(){
664
678
current_page -- ;
665
679
focus_icon_row = 0 ;
666
680
focus_icon_column = 0 ;
681
+ show_loading_screen ();
667
682
process_icons ();
668
683
update_icon_page = true;
669
684
}
0 commit comments