diff --git a/inc/config.h b/inc/config.h index d6f930a..80b530d 100644 --- a/inc/config.h +++ b/inc/config.h @@ -69,10 +69,14 @@ const uint32_t source_colour = 0x6FADD8; #define AR_STYLE_NUM ( ( int )1 ) const style_t archive_style[ AR_STYLE_NUM ] = { style_bold }; -const uint32_t archive_colour = 0xE02482; +const uint32_t archive_colour = 0x885ACE; -#define OTH_STYLE_NUM ( ( int )1 ) -const style_t others_style[ OTH_STYLE_NUM ] = { style_none }; -const uint32_t others_colour = 0xFFFFFF; +#define PDF_STYLE_NUM ( ( int )1 ) +const style_t pdf_style[ PDF_STYLE_NUM ] = { style_none }; +const uint32_t pdf_colour = 0x4D70E9; + +#define REG_STYLE_NUM ( ( int )1 ) +const style_t regular_style[ REG_STYLE_NUM ] = { style_none }; +const uint32_t regular_colour = 0xFFFFFF; #endif diff --git a/src/display.c b/src/display.c index 560acd6..49ddbd6 100644 --- a/src/display.c +++ b/src/display.c @@ -20,6 +20,7 @@ void display_permissions( const char* const permissions, bool no_colour ); bool compare_makefile( const directory_entry_t* const entry ); bool compare_archives( const directory_entry_t* const entry ); bool compare_sources( const directory_entry_t* const entry ); +bool compare_pdf( const directory_entry_t* const entry ); static void size_to_string( const directory_entry_t* const entry, char* file_size, @@ -293,10 +294,15 @@ void set_file_style( const directory_entry_t* const entry ) format_set_style( &source_style[ 0 ], SRC_STYLE_NUM ); format_set_colour( source_colour ); } + else if ( compare_pdf( entry ) ) + { + format_set_style( &pdf_style[ 0 ], PDF_STYLE_NUM ); + format_set_colour( pdf_colour ); + } else { - format_set_style( &others_style[ 0 ], OTH_STYLE_NUM ); - format_set_colour( others_colour ); + format_set_style( ®ular_style[ 0 ], REG_STYLE_NUM ); + format_set_colour( regular_colour ); } } @@ -331,6 +337,11 @@ bool compare_sources( const directory_entry_t* const entry ) || 0 == compare_strings( entry->extension, "rs", 3, true ); } +bool compare_pdf( const directory_entry_t* const entry ) +{ + return 0 == compare_strings( entry->extension, "pdf", 4, true ); +} + void size_to_string( const directory_entry_t* const entry, char* file_size,