NeoMutt  2022-04-29-215-gc12b98
Teaching an old dog new tricks
DOXYGEN
color()

Calculate the colour for a line of the menu. More...

+ Collaboration diagram for color():

Functions

struct AttrColorindex_color (struct Menu *menu, int line)
 Calculate the colour for a line of the index - Implements Menu::color() -. More...
 
static struct AttrColordefault_color (struct Menu *menu, int line)
 Get the default colour for a line of the menu - Implements Menu::color() -. More...
 

Detailed Description

Calculate the colour for a line of the menu.

Parameters
menuMenu containing items
lineMenu line number
Return values
>0Colour pair in an integer
0No colour

Function Documentation

◆ index_color()

struct AttrColor * index_color ( struct Menu menu,
int  line 
)

Calculate the colour for a line of the index - Implements Menu::color() -.

Definition at line 884 of file dlg_index.c.

885{
886 struct IndexPrivateData *priv = menu->mdata;
887 struct IndexSharedData *shared = priv->shared;
888 struct Mailbox *m = shared->mailbox;
889 if (!m || (line < 0))
890 return NULL;
891
892 struct Email *e = mutt_get_virt_email(m, line);
893 if (!e)
894 return NULL;
895
896 if (e->attr_color)
897 return e->attr_color;
898
900 return e->attr_color;
901}
void mutt_set_header_color(struct Mailbox *m, struct Email *e)
Select a colour for a message.
Definition: dlg_index.c:1366
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition: mview.c:414
The envelope/body of an email.
Definition: email.h:37
struct AttrColor * attr_color
Color-pair to use when displaying in the index.
Definition: email.h:112
Private state data for the Index.
Definition: private_data.h:35
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:42
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:43
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:41
A mailbox.
Definition: mailbox.h:79
void * mdata
Private data.
Definition: lib.h:137
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ default_color()

static struct AttrColor * default_color ( struct Menu menu,
int  line 
)
static

Get the default colour for a line of the menu - Implements Menu::color() -.

Definition at line 46 of file menu.c.

47{
49}
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
Definition: simple.c:74
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function: