X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=list.c;h=5bb6753a4d7be745bd82e6cc565427e629c68cd3;hb=ceba9214d8bebe32d0c34c7a82916bcb9d798d69;hp=6cb8ed791b8bd71065d62cd63657e7387cd50210;hpb=b6053007306a73fefe0ed952862ae71da9483d0e;p=pkg%2Fabook.git diff --git a/list.c b/list.c index 6cb8ed7..5bb6753 100644 --- a/list.c +++ b/list.c @@ -9,8 +9,8 @@ #include #include -#include #include "abook.h" +#include #include "ui.h" #include "database.h" #include "edit.h" @@ -109,19 +109,14 @@ refresh_list() for( line = 0, i = first_list_item ; i <= LAST_LIST_ITEM && i < items; line++, i++ ) { - if(i == curitem) - highlight_line(list, line); - - print_list_line(i, line); - - wstandend(list); + print_list_line(i, line, i == curitem); } wrefresh(list); } void -print_list_line(int i, int line) +print_list_line(int i, int line, int highlight) { int extra = extra_column; char tmp[MAX_EMAILSTR_LEN]; @@ -129,6 +124,8 @@ print_list_line(int i, int line) EMAILLEN : COLS - EMAILPOS; scrollok(list, FALSE); + if(highlight) + highlight_line(list, line); if( selected[i] ) mvwaddch(list, line, 0, '*' ); @@ -150,19 +147,27 @@ print_list_line(int i, int line) EXTRALEN); scrollok(list, TRUE); + if(highlight) + wstandend(list); } void list_headerline() { +#ifdef A_BOLD attrset(A_BOLD); +#else + /* hmm, maybe something here */ +#endif mvaddstr(2, NAMEPOS, abook_fields[NAME].name); mvaddstr(2, EMAILPOS, abook_fields[EMAIL].name); if(extra_column > 0) mvaddnstr(2, EXTRAPOS, abook_fields[extra_column].name, COLS-EXTRAPOS); +#ifdef A_BOLD attrset(A_NORMAL); +#endif } void @@ -278,8 +283,12 @@ void highlight_line(WINDOW *win, int line) { wstandout(win); - -#ifdef mvwchgat + + /* + * this is a tricky one + */ +#if 0 +/*#ifdef mvwchgat*/ mvwchgat(win, line, 0, -1, A_STANDOUT, 0, NULL); #else /*