implemented style for pdfs

This commit is contained in:
root committed 2026-10-21 20:28:33 +02:00
1 parent 46bf3c23c3
commit 8772d10c4c
2 files changed
+21 -6

No files matched your search

+8 -4
View File
@@ -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
+13 -2
View File
@@ -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( &regular_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,