summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 19d591b)
raw | patch | inline | side by side (parent: 19d591b)
author | Kalle Wallin <kaw@linux.se> | |
Sat, 27 Mar 2004 12:03:40 +0000 (12:03 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Sat, 27 Mar 2004 12:03:40 +0000 (12:03 +0000) |
screen.c | patch | blob | history |
diff --git a/screen.c b/screen.c
index a63af20f69a8e61aa18f7ddc44ec0602cbc35672..37f5146222b07db5615dae479dfd684fab25cd6c 100644 (file)
--- a/screen.c
+++ b/screen.c
{
/* initialize the curses library */
initscr();
- start_color();
- if( options.enable_colors )
+ if( has_colors() )
+ {
+ start_color();
+ if( options.enable_colors )
+ {
+ init_pair(1, options.title_color, options.bg_color);
+ init_pair(2, options.line_color, options.bg_color);
+ init_pair(3, options.list_color, options.bg_color);
+ init_pair(4, options.progress_color, options.bg_color);
+ init_pair(5, options.status_color, options.bg_color);
+ init_pair(6, options.alert_color, options.bg_color);
+ }
+ else
+ use_default_colors();
+ }
+ else if( options.enable_colors )
{
- init_pair(1, options.title_color, options.bg_color);
- init_pair(2, options.line_color, options.bg_color);
- init_pair(3, options.list_color, options.bg_color);
- init_pair(4, options.progress_color, options.bg_color);
- init_pair(5, options.status_color, options.bg_color);
- init_pair(6, options.alert_color, options.bg_color);
+ fprintf(stderr, "Terminal lacks color capabilities.\n");
+ options.enable_colors = 0;
}
- else
- use_default_colors();
/* tell curses not to do NL->CR/NL on output */
nonl();
screen->helplist = list_window_init( screen->main_window.w,
screen->main_window.cols,
screen->main_window.rows );
+
leaveok(screen->main_window.w, TRUE);
keypad(screen->main_window.w, TRUE);
/* set background attributes */
wbkgd(screen->main_window.w, LIST_COLORS);
wbkgd(screen->top_window.w, TITLE_COLORS);
- wbkgd(screen->playlist->w, LIST_COLORS);
- wbkgd(screen->filelist->w, LIST_COLORS);
- wbkgd(screen->helplist->w, LIST_COLORS);
wbkgd(screen->progress_window.w, PROGRESS_COLORS);
wbkgd(screen->status_window.w, STATUS_COLORS);
}