@@ -433,6 +433,7 @@ static void nk_console_file_entry_onclick(nk_console* button, void* user_data) {
433433 nk_console_add_event (file , NK_CONSOLE_EVENT_POST_RENDER_ONCE , & nk_console_file_refresh );
434434}
435435
436+ #ifdef NK_CONSOLE_FILE_ADD_FILES
436437/**
437438 * Click handler for file entry buttons (non-directory) in button view mode.
438439 *
@@ -463,6 +464,7 @@ static void nk_console_file_button_file_onclick(nk_console* button, void* user_d
463464 }
464465 nk_console_navigate_back (file );
465466}
467+ #endif
466468
467469NK_API nk_console * nk_console_file_add_entry (nk_console * parent , const char * path , nk_bool is_directory ) {
468470 if (parent == NULL || path == NULL || path [0 ] == '\0' ) {
@@ -608,21 +610,20 @@ NK_API void nk_console_file_refresh(nk_console* widget, void* user_data) {
608610 }
609611
610612 if (cvector_empty (data -> entries )) {
611- nk_console * empty_label = nk_console_label (widget , "[Empty]" );
613+ nk_console * empty_label = nk_console_label (widget , "[Empty Directory]" );
614+ empty_label -> alignment = NK_TEXT_CENTERED ;
612615 empty_label -> disabled = nk_true ;
613616 }
614617 else {
615618 for (size_t i = 0 ; i < cvector_size (data -> entries ); i ++ ) {
616619 nk_console_file_entry * entry = & data -> entries [i ];
617- nk_console * btn ;
618620 if (entry -> is_directory ) {
619- btn = nk_console_button_onclick (widget , entry -> label , & nk_console_file_entry_onclick );
621+ nk_console * btn = nk_console_button_onclick (widget , entry -> label , & nk_console_file_entry_onclick );
620622 nk_console_button_set_symbol (btn , NK_SYMBOL_TRIANGLE_RIGHT );
621623 }
622624 else {
623- btn = nk_console_button_onclick (widget , entry -> label , & nk_console_file_button_file_onclick );
625+ nk_console_button_onclick (widget , entry -> label , & nk_console_file_button_file_onclick );
624626 }
625- NK_UNUSED (btn );
626627 }
627628 }
628629
0 commit comments