On Sun, Apr 29, 2012 at 03:52:07PM +0200, Thorsten Wißmann wrote:

> I also fixed the annoying lag between a click and the reaction by abook.
> Now the mouse should just work as expected™. Can someone test it and
> give feedback? (Then we could enable it by default)

One visual problem I found is that editing a field immediately makes
some garbage appear in the bottom editing bar ( #X* ).

I also found some problem with wheel-down handling. It appears that
ncurses before 2005 didn't support it (at least it didn't #define
corresponding events). Then it comes for --with-ext-mouse ncurses build
(which is still not the default for gentoo in 5.9), see:
$ grep -m1 NCURSES_MOUSE_VERSION /usr/include/ncursesw/curses.h

AFAICT button2 represents the middle click rather than the wheel but the
patch appeared to work for me because I'm using a newer version of
rxvt-unicode which embed built-in support for mouse wheel.

The attached patch should apply on top of yours.

* It does not attach to BUTTON1_PRESS event anymore as it's not needed,
  unless I missed something.

* Conditionally set mousemask() according to ncurses headers and removed
  the use of BUTTON2_PRESS which AFAICT is not involved in mouse-wheel-down,
  whatever NCURSES_MOUSE_VERSION is.
  There may be more elegant function to do this in the ncurses API but I
  didn't take the time to look at them.

* detach from mouse signal before we start editing a field (in
  edit_field()) and restore before we return.

* removed some debug statements

So it's a bit crappy (4x #if NCURSES_MOUSE_VERSION) but tries to play
nice with ncurses headers. Let me know if you have any idea in order to
make the whole better.

Finally, I've a bad feeling about was_double_click() / custom handling
of mouse interval ? do we really need this ? isn't what mouseinterval(200) 
would do ?
It may also be a bug in ncurses, or a bad use of the mouse handling API ?
Could you ensure that this is the right way to fix the lag (I didn't
find myself the UI laggy) ? or that it still happens when we stop listening
to BUTTON1_PRESSED ? ...
thank you!



best regards


PS: I also attached the colors-related patches rebased/merged, as they
will appear in the upstream/master repository once pushed; unless you have some
additional remarks. (I would personally have preferred to see 2/2
Fabio's patch merged into Thorsten's one but either way wouldn't hurt).
diff --git a/edit.c b/edit.c
index 5f794a8..089088f 100644
--- a/edit.c
+++ b/edit.c
@@ -588,13 +588,14 @@ key_to_field_number(char c)
 static void
 edit_field(int tab, char c, int item_number)
 {
+       mousemask(0, NULL);
        int i = 0, number, idx;
        char *msg;
        abook_field_list *f;
        list_item item;
 
        if((number = key_to_field_number(c)) < 0)
-               return;
+               goto detachfield;
 
        edit_undo(item_number, BACKUP_ITEM);
 
@@ -602,7 +603,7 @@ edit_field(int tab, char c, int item_number)
 
        while(1) {
                if(!f)
-                       return;
+                       goto detachfield;
 
                if(i == number)
                        break;
@@ -631,10 +632,17 @@ edit_field(int tab, char c, int item_number)
                        break;
                case FIELD_DATE:
                        edit_date(item_number, idx);
-                       return;
+                       goto detachfield;
                default:
                        assert(0);
        }
+
+ detachfield:
+#if NCURSES_MOUSE_VERSION == 2
+       mousemask(BUTTON1_CLICKED | BUTTON4_PRESSED | BUTTON5_PRESSED, NULL);
+#else
+       mousemask(BUTTON1_CLICKED | BUTTON4_PRESSED, NULL);
+#endif
 }
 
 static int
@@ -671,13 +679,10 @@ edit_loop(int item)
        if(c == KEY_MOUSE) {
                MEVENT event;
                if(getmouse(&event) == OK) {
-                       if(event.bstate & BUTTON1_PRESSED
-                          || event.bstate & BUTTON1_CLICKED
+                       if(event.bstate & BUTTON1_CLICKED
                           || event.bstate & BUTTON1_DOUBLE_CLICKED) {
                                int window_y, window_x;
                                getbegyx(editw, window_y, window_x);
-                               /* fprintf(stderr, "tabline at  %d\n", 
TABLINE); */
-                               /* fprintf(stderr, "mouse at  %d\n", 
event.y+window_y); */
                                if(event.y == 0) {
                                        /* if first row is selected, then go 
back to list */
                                        return -1;
@@ -711,10 +716,13 @@ edit_loop(int item)
                                }
                        } else if(event.bstate & BUTTON4_PRESSED) {
                                tab = tab == 0 ? views_count - 1 : tab - 1;
-                       } else if(event.bstate & 0x80 || event.bstate & 
0x8000000) {
-                               /* scroll wheel up --> but which ncurses 
#define? */
+                       }
+#if NCURSES_MOUSE_VERSION == 2
+                       else if(event.bstate & BUTTON5_PRESSED) {
+#else
+                       else if(event.bstate & 0x80 || event.bstate & 
0x8000000) {
+#endif
                                tab = tab == views_count - 1 ? 0 : tab + 1;
-                       } else {
                        }
                        return item;
                }
diff --git a/ui.c b/ui.c
index b748caa..5c6b0d4 100644
--- a/ui.c
+++ b/ui.c
@@ -136,7 +136,11 @@ ui_init_curses()
        if(opt_get_bool(BOOL_USE_MOUSE)) {
                mouseinterval(0);
                timerclear(&last_click_time);
-               mousemask(BUTTON1_PRESSED | BUTTON4_PRESSED | BUTTON2_PRESSED, 
NULL);
+#if NCURSES_MOUSE_VERSION == 2
+               mousemask(BUTTON1_CLICKED | BUTTON4_PRESSED | BUTTON5_PRESSED, 
NULL);
+#else
+               mousemask(BUTTON1_CLICKED | BUTTON4_PRESSED, NULL);
+#endif
        }
        keypad(stdscr, TRUE);
        if(opt_get_bool(BOOL_USE_COLORS)) {
@@ -529,8 +533,7 @@ get_commands()
                        MEVENT event;
                        bool double_clicked = was_double_click();
                        if(getmouse(&event) == OK) {
-                               if(event.bstate & BUTTON1_PRESSED
-                                  || event.bstate & BUTTON1_CLICKED
+                               if(event.bstate & BUTTON1_CLICKED
                                   || event.bstate & BUTTON1_DOUBLE_CLICKED) {
                                        if(event.y == 0) {
                                                return;
@@ -543,7 +546,11 @@ get_commands()
                                        }
                                } else if(event.bstate & BUTTON4_PRESSED) {
                                        scroll_up();
-                               } else if(event.bstate & BUTTON2_PRESSED) {
+#if NCURSES_MOUSE_VERSION == 2
+                               } else if(event.bstate & BUTTON5_PRESSED) {
+#else
+                               } else if(event.bstate & 0x80 || event.bstate & 
0x8000000) {
+#endif
                                        scroll_down();
                                }
                        }
>From b4dccb09da2e06345c130ff4b0e5853384fea6e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorsten=20Wi=C3=9Fmann?= <e...@thorsten-wissmann.de>
Date: Sun, 8 Apr 2012 13:15:57 +0200
Subject: [PATCH 1/3] Add basic color support

This adds optional support for an colorized ui, providing configurable
and documented foreground/background colors for the:

  * header        * footer            * odd list entries
  * list-header   * list-selection    * even list entries
  * tab-border    * tab-label         * field-name
  * field-value
---
 abookrc.5 |   74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 color.h   |   21 +++++++++++++++++
 edit.c    |    7 +++++
 list.c    |   12 +++++++++-
 options.c |   23 ++++++++++++++++++-
 options.h |   21 +++++++++++++++++
 ui.c      |   56 ++++++++++++++++++++++++++++++++++++++++++++++
 ui.h      |    1 +
 8 files changed, 213 insertions(+), 2 deletions(-)
 create mode 100644 color.h

diff --git a/abookrc.5 b/abookrc.5
index 04e5149..fef99d6 100644
--- a/abookrc.5
+++ b/abookrc.5
@@ -146,6 +146,80 @@ Defines the field to be used by the "sort by field" 
command. Default is "nick" (
 \fBshow_cursor\fP=[true|false]
 Defines if the cursor is visible in main display. Default is false.
 
+.TP
+\fBuse_colors\fP=[true|false]
+Defines if the output of abook is colorized. Default is false.
+
+.TP
+Color settings:
+\fBcolor_header_fg\fP=color
+Foreground color for header bar
+
+\fBcolor_header_bg\fP=color
+Background color for header bar
+
+\fBcolor_footer_fg\fP=color
+Foreground color for footer bar
+
+\fBcolor_footer_bg\fP=color
+Background color for footer bar
+
+\fBcolor_list_even_fg\fP=color
+Foreground color for normal list entries with even index in the list (starting
+with index 0)
+
+\fBcolor_list_even_bg\fP=color
+Background color for normal list entries with even index in the list (starting
+with index 0)
+
+\fBcolor_list_odd_fg\fP=color
+Foreground color for normal list entries with odd index in the list (starting
+with index 0)
+
+\fBcolor_list_odd_bg\fP=color
+Background color for normal list entries with odd index in the list (starting
+with index 0)
+
+\fBcolor_list_header_fg\fP=color
+Foreground color for the list header
+
+\fBcolor_list_header_bg\fP=color
+Background color for the list header
+
+\fBcolor_list_highlight_fg\fP=color
+Foreground color for highlighted list entries
+
+\fBcolor_list_highlight_bg\fP=color
+Background color for highlighted list entries
+
+\fBcolor_tab_border_fg\fP=color
+Foreground color for tab borders on details page
+
+\fBcolor_tab_border_bg\fP=color
+Background color for tab borders on details page
+
+\fBcolor_tab_label_fg\fP=color
+Foreground color for tab labes on details page
+
+\fBcolor_tab_label_bg\fP=color
+Background color for tab labes on details page
+
+\fBcolor_field_name_fg\fP=color
+Foreground color for field names on details page
+
+\fBcolor_field_name_bg\fP=color
+Background color for field names on details page
+
+\fBcolor_field_value_fg\fP=color
+Foreground color for field values on details page
+
+\fBcolor_field_value_bg\fP=color
+Background color for field values on details page
+
+Where \fBcolor\fP can be: default, black, red, green, yellow, blue, magenta, 
cyan, white
+
+
+
 .SH SAMPLE CONFIGURATION FILE
 
 .nf
diff --git a/color.h b/color.h
new file mode 100644
index 0000000..9063ff5
--- /dev/null
+++ b/color.h
@@ -0,0 +1,21 @@
+
+#ifndef __ABOOK_COLORS_H_
+#define __ABOOK_COLORS_H_
+
+#define COLOR_DEFAULT -1
+
+enum {
+       CP_HEADER = 1,
+       CP_FOOTER,
+       CP_LIST_EVEN,
+       CP_LIST_ODD,
+       CP_LIST_HEADER,
+       CP_LIST_HIGHLIGHT,
+       CP_TAB_BORDER,
+       CP_TAB_LABEL,
+       CP_FIELD_NAME,
+       CP_FIELD_VALUE,
+};
+
+#endif
+
diff --git a/edit.c b/edit.c
index d2cba62..81da889 100644
--- a/edit.c
+++ b/edit.c
@@ -21,6 +21,7 @@
 #include "misc.h"
 #include "views.h"
 #include "xmalloc.h"
+#include "color.h"
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
 #endif
@@ -47,6 +48,7 @@ editor_tab(const int tab)
        int x_pos = 2; /* current x pos */
        char *tab_name;
 
+       wattrset(editw, COLOR_PAIR(CP_TAB_BORDER));
        mvwhline(editw, TABLINE + 1, 0, UI_HLINE_CHAR, EDITW_COLS);
 
        for(i = 0; i < views_count; i++) {
@@ -63,7 +65,9 @@ editor_tab(const int tab)
 
                mvwaddch(editw,  TABLINE, x_pos,  UI_ULCORNER_CHAR);
                mvwaddch(editw,  TABLINE, x_pos + 1,  UI_LBOXLINE_CHAR);
+               wattrset(editw, COLOR_PAIR(CP_TAB_LABEL));
                mvwaddstr(editw, TABLINE, x_pos + 2,  tab_name);
+               wattrset(editw, COLOR_PAIR(CP_TAB_BORDER));
                mvwaddch(editw,  TABLINE, x_pos + width - 3, UI_RBOXLINE_CHAR);
                mvwaddch(editw,  TABLINE, x_pos + width - 2, UI_URCORNER_CHAR);
 
@@ -192,6 +196,7 @@ print_editor_header(int item)
        else
                snprintf(header, EDITW_COLS, "%s", db_name_get(item));
 
+       wattrset(editw, COLOR_PAIR(CP_TAB_LABEL));
        mvwaddstr(editw, 0, (EDITW_COLS - strwidth(header)) / 2, header);
 
        free(header);
@@ -215,6 +220,7 @@ editor_print_data(int tab, int item)
                } else
                        y = FIELDS_START_Y;
 
+               wattrset(editw, COLOR_PAIR(CP_FIELD_NAME));
                mvwprintw(editw, y, FIELDS_START_X, "%c - ",
                                (j < 10) ? '0' + j : 'A' + j - 10);
                mvwaddnstr(editw, y, FIELDS_START_X + 4, cur->field->name,
@@ -222,6 +228,7 @@ editor_print_data(int tab, int item)
                                        FIELDNAME_MAX_WIDTH));
                mvwaddch(editw, y, TAB_COLON_POS, ':');
 
+               wattrset(editw, COLOR_PAIR(CP_FIELD_VALUE));
                if((cur->field->type == FIELD_EMAILS) ||
                                (cur->field->type == FIELD_LIST)) {
                        abook_list *emails, *e;
diff --git a/list.c b/list.c
index 7a04397..9eb4ede 100644
--- a/list.c
+++ b/list.c
@@ -19,6 +19,7 @@
 #include "misc.h"
 #include "options.h"
 #include "xmalloc.h"
+#include "color.h"
 
 
 int curitem = -1;
@@ -194,7 +195,10 @@ print_list_field(int item, int line, int *x_pos, struct 
index_elem *e)
 static void
 highlight_line(WINDOW *win, int line)
 {
-       wstandout(win);
+       wattrset(win, COLOR_PAIR(CP_LIST_HIGHLIGHT));
+       if(!opt_get_bool(BOOL_USE_COLORS)) {
+               wstandout(win);
+       }
 
        /*
         * this is a tricky one
@@ -224,6 +228,10 @@ print_list_line(int item, int line, int highlight)
        struct index_elem *cur;
        int x_pos = 1;
 
+       if(item % 2 == 0)
+               wattrset(list, COLOR_PAIR(CP_LIST_EVEN));
+       else
+               wattrset(list, COLOR_PAIR(CP_LIST_ODD));
        scrollok(list, FALSE);
        if(highlight)
                highlight_line(list, line);
@@ -300,6 +308,8 @@ list_headerline()
 #if defined(A_BOLD) && defined(A_NORMAL)
        attrset(A_BOLD);
 #endif
+       attrset(COLOR_PAIR(CP_LIST_HEADER));
+       mvhline(2, 0, ' ', COLS);
 
        for(e = index_elements; e; e = e->next)
                if(e->type == INDEX_TEXT)
diff --git a/options.c b/options.c
index 84f08ca..57cb334 100644
--- a/options.c
+++ b/options.c
@@ -67,7 +67,28 @@ static struct option abook_vars[] = {
        { "preserve_fields", OT_STR, STR_PRESERVE_FIELDS, UL "standard" },
        { "sort_field", OT_STR, STR_SORT_FIELD, UL "nick" },
        { "show_cursor", OT_BOOL, BOOL_SHOW_CURSOR, FALSE },
-
+       { "use_colors", OT_BOOL, BOOL_USE_COLORS, FALSE },
+       { "color_header_fg", OT_STR, STR_COLOR_HEADER_FG, UL "blue" },
+       { "color_header_fg", OT_STR, STR_COLOR_HEADER_FG, UL "blue" },
+       { "color_header_bg", OT_STR, STR_COLOR_HEADER_BG, UL "red" },
+       { "color_footer_fg", OT_STR, STR_COLOR_FOOTER_FG, UL "red" },
+       { "color_footer_bg", OT_STR, STR_COLOR_FOOTER_BG, UL "default" },
+       { "color_list_even_fg", OT_STR, STR_COLOR_LIST_EVEN_FG, UL "yellow" },
+       { "color_list_even_bg", OT_STR, STR_COLOR_LIST_EVEN_BG, UL "default" },
+       { "color_list_odd_fg", OT_STR, STR_COLOR_LIST_ODD_FG, UL "default" },
+       { "color_list_odd_bg", OT_STR, STR_COLOR_LIST_ODD_BG, UL "default" },
+       { "color_list_header_fg", OT_STR, STR_COLOR_LIST_HEADER_FG, UL "white" 
},
+       { "color_list_header_bg", OT_STR, STR_COLOR_LIST_HEADER_BG, UL "blue" },
+       { "color_list_highlight_fg", OT_STR, STR_COLOR_LIST_HIGHLIGHT_FG, UL 
"black" },
+       { "color_list_highlight_bg", OT_STR, STR_COLOR_LIST_HIGHLIGHT_BG, UL 
"green" },
+       { "color_tab_border_fg", OT_STR, STR_COLOR_TAB_BORDER_FG, UL "cyan" },
+       { "color_tab_border_bg", OT_STR, STR_COLOR_TAB_BORDER_BG, UL "default" 
},
+       { "color_tab_label_fg", OT_STR, STR_COLOR_TAB_LABEL_FG, UL "magenta" },
+       { "color_tab_label_bg", OT_STR, STR_COLOR_TAB_LABEL_BG, UL "default" },
+       { "color_field_name_fg", OT_STR, STR_COLOR_FIELD_NAME_FG, UL "yellow" },
+       { "color_field_name_bg", OT_STR, STR_COLOR_FIELD_NAME_BG, UL "default" 
},
+       { "color_field_value_fg", OT_STR, STR_COLOR_FIELD_VALUE_FG, UL "green" 
},
+       { "color_field_value_bg", OT_STR, STR_COLOR_FIELD_VALUE_BG, UL 
"default" },
        { NULL }
 };
 
diff --git a/options.h b/options.h
index 138efc2..2dbadc3 100644
--- a/options.h
+++ b/options.h
@@ -26,6 +26,7 @@ enum bool_opts {
        BOOL_USE_ASCII_ONLY,
        BOOL_ADD_EMAIL_PREVENT_DUPLICATES,
        BOOL_SHOW_CURSOR,
+       BOOL_USE_COLORS,
        BOOL_MAX
 };
 
@@ -53,6 +54,26 @@ enum str_opts {
        STR_ADDRESS_STYLE,
        STR_PRESERVE_FIELDS,
        STR_SORT_FIELD,
+       STR_COLOR_HEADER_FG,
+       STR_COLOR_HEADER_BG,
+       STR_COLOR_FOOTER_FG,
+       STR_COLOR_FOOTER_BG,
+       STR_COLOR_LIST_EVEN_FG,
+       STR_COLOR_LIST_EVEN_BG,
+       STR_COLOR_LIST_ODD_FG,
+       STR_COLOR_LIST_ODD_BG,
+       STR_COLOR_LIST_HEADER_FG,
+       STR_COLOR_LIST_HEADER_BG,
+       STR_COLOR_LIST_HIGHLIGHT_FG,
+       STR_COLOR_LIST_HIGHLIGHT_BG,
+       STR_COLOR_TAB_BORDER_FG,
+       STR_COLOR_TAB_BORDER_BG,
+       STR_COLOR_TAB_LABEL_FG,
+       STR_COLOR_TAB_LABEL_BG,
+       STR_COLOR_FIELD_NAME_FG,
+       STR_COLOR_FIELD_NAME_BG,
+       STR_COLOR_FIELD_VALUE_FG,
+       STR_COLOR_FIELD_VALUE_BG,
        STR_MAX
 };
 
diff --git a/ui.c b/ui.c
index 1d5eb43..69fb71d 100644
--- a/ui.c
+++ b/ui.c
@@ -25,6 +25,7 @@
 #include "options.h"
 #include "filter.h"
 #include "xmalloc.h"
+#include "color.h"
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
 #endif
@@ -130,6 +131,57 @@ ui_init_curses()
        nonl();
        intrflush(stdscr, FALSE);
        keypad(stdscr, TRUE);
+       if(opt_get_bool(BOOL_USE_COLORS)) {
+               start_color();
+               use_default_colors();
+               ui_init_color_pairs_user();
+       }
+}
+
+
+#define CHECK_COLOR_NAME(value, name, DEFNAME) \
+       if(!strcmp((name), (value))){ \
+               return DEFNAME; \
+       }
+short
+opt_color_to_color(enum str_opts enum_name)
+{
+       char* name = opt_get_str(enum_name);
+       CHECK_COLOR_NAME(name, "default", COLOR_DEFAULT)
+       else CHECK_COLOR_NAME(name, "black", COLOR_BLACK)
+       else CHECK_COLOR_NAME(name, "red", COLOR_RED)
+       else CHECK_COLOR_NAME(name, "green", COLOR_GREEN)
+       else CHECK_COLOR_NAME(name, "yellow", COLOR_YELLOW)
+       else CHECK_COLOR_NAME(name, "blue", COLOR_BLUE)
+       else CHECK_COLOR_NAME(name, "magenta", COLOR_MAGENTA)
+       else CHECK_COLOR_NAME(name, "cyan", COLOR_CYAN)
+       else CHECK_COLOR_NAME(name, "white", COLOR_WHITE)
+    else return COLOR_DEFAULT;
+}
+
+void
+ui_init_color_pairs_user()
+{
+       init_pair(CP_HEADER, opt_color_to_color(STR_COLOR_HEADER_FG),
+                            opt_color_to_color(STR_COLOR_HEADER_BG));
+       init_pair(CP_FOOTER, opt_color_to_color(STR_COLOR_FOOTER_FG),
+                            opt_color_to_color(STR_COLOR_FOOTER_BG));
+       init_pair(CP_LIST_EVEN, opt_color_to_color(STR_COLOR_LIST_EVEN_FG),
+                               opt_color_to_color(STR_COLOR_LIST_EVEN_BG));
+       init_pair(CP_LIST_ODD,  opt_color_to_color(STR_COLOR_LIST_ODD_FG),
+                               opt_color_to_color(STR_COLOR_LIST_ODD_BG));
+       init_pair(CP_LIST_HEADER, opt_color_to_color(STR_COLOR_LIST_HEADER_FG),
+                            opt_color_to_color(STR_COLOR_LIST_HEADER_BG));
+       init_pair(CP_LIST_HIGHLIGHT, 
opt_color_to_color(STR_COLOR_LIST_HIGHLIGHT_FG),
+                            opt_color_to_color(STR_COLOR_LIST_HIGHLIGHT_BG));
+       init_pair(CP_TAB_BORDER, opt_color_to_color(STR_COLOR_TAB_BORDER_FG),
+                            opt_color_to_color(STR_COLOR_TAB_BORDER_BG));
+       init_pair(CP_TAB_LABEL, opt_color_to_color(STR_COLOR_TAB_LABEL_FG),
+                            opt_color_to_color(STR_COLOR_TAB_LABEL_BG));
+       init_pair(CP_FIELD_NAME, opt_color_to_color(STR_COLOR_FIELD_NAME_FG),
+                            opt_color_to_color(STR_COLOR_FIELD_NAME_BG));
+       init_pair(CP_FIELD_VALUE, opt_color_to_color(STR_COLOR_FIELD_VALUE_FG),
+                            opt_color_to_color(STR_COLOR_FIELD_VALUE_BG));
 }
 
 int
@@ -179,6 +231,8 @@ headerline(const char *str)
 {
        werase(top);
 
+       wattrset(top, COLOR_PAIR(CP_HEADER));
+       mvwhline(top, 0, 0, ' ', COLS);
        mvwhline(top, 1, 0, UI_HLINE_CHAR, COLS);
 
        mvwprintw(top, 0, 0, "%s | %s", PACKAGE " " VERSION, str);
@@ -355,6 +409,7 @@ refresh_statusline()
 {
        werase(bottom);
 
+       wattrset(bottom, COLOR_PAIR(CP_FOOTER));
        mvwhline(bottom, 0, 0, UI_HLINE_CHAR, COLS);
 
        refresh();
@@ -593,6 +648,7 @@ ui_print_number_of_items()
        char *str = strdup_printf("     " "|%3d/%3d",
                selected_items(), db_n_items());
 
+       attrset(COLOR_PAIR(CP_HEADER));
        mvaddstr(0, COLS-strlen(str), str);
 
        free(str);
diff --git a/ui.h b/ui.h
index 25bc850..3e7483b 100644
--- a/ui.h
+++ b/ui.h
@@ -10,6 +10,7 @@ enum {
 
 int            is_ui_initialized();
 void           ui_init_curses();
+void           ui_init_color_pairs_user();
 int            init_ui();
 void           close_ui();
 void           headerline(const char *str);
-- 
1.7.8

>From a7d7cb6b1a89b01f3e58f8811ec37a0f4fef0ccb Mon Sep 17 00:00:00 2001
From: Fabio Zanini <fabio.zan...@fastmail.fm>
Date: Sun, 15 Apr 2012 12:41:08 +0200
Subject: [PATCH 2/3] Added sample config for color settings.

---
 sample.abookrc |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/sample.abookrc b/sample.abookrc
index 3dac32c..63f6eee 100644
--- a/sample.abookrc
+++ b/sample.abookrc
@@ -108,3 +108,9 @@ set sort_field=nick
 # show cursor in main display
 set show_cursor=false
 
+# colors
+set use_colors = true
+set color_header_fg = red
+set color_header_bg = default
+set color_list_header_fg = blue
+set color_list_header_bg = default
-- 
1.7.8

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Abook-devel mailing list
Abook-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/abook-devel

Reply via email to