summaryrefslogtreecommitdiff
path: root/scripts/kconfig/lxdialog/textbox.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-07-24 23:40:46 +0400
committerSam Ravnborg <sam@neptun.ravnborg.org>2006-09-30 13:19:19 +0400
commit98e5a1579e7d34fe3803240750a1c48efcd9cb15 (patch)
tree433f6b354eb0bb6fa01f325237f9f4651bf5ac9f /scripts/kconfig/lxdialog/textbox.c
parentbf603625660b1742004bf86432ce3c210d14d4fd (diff)
downloadlinux-98e5a1579e7d34fe3803240750a1c48efcd9cb15.tar.xz
kconfig/lxdialog: refactor color support
Clean up and refactor color support. All color support are now in util.c including color definitions. In the process introduced a global variable named 'dlg' which is used all over to set color - thats the reason why all files are changed. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/lxdialog/textbox.c')
-rw-r--r--scripts/kconfig/lxdialog/textbox.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/scripts/kconfig/lxdialog/textbox.c b/scripts/kconfig/lxdialog/textbox.c
index 77848bb8e07f..336793b03954 100644
--- a/scripts/kconfig/lxdialog/textbox.c
+++ b/scripts/kconfig/lxdialog/textbox.c
@@ -87,20 +87,21 @@ int dialog_textbox(const char *title, const char *file, int height, int width)
/* Create window for text region, used for scrolling text */
text = subwin(dialog, height - 4, width - 2, y + 1, x + 1);
- wattrset(text, dialog_attr);
- wbkgdset(text, dialog_attr & A_COLOR);
+ wattrset(text, dlg.dialog.atr);
+ wbkgdset(text, dlg.dialog.atr & A_COLOR);
keypad(text, TRUE);
/* register the new window, along with its borders */
- draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ draw_box(dialog, 0, 0, height, width,
+ dlg.dialog.atr, dlg.border.atr);
- wattrset(dialog, border_attr);
+ wattrset(dialog, dlg.border.atr);
mvwaddch(dialog, height - 3, 0, ACS_LTEE);
for (i = 0; i < width - 2; i++)
waddch(dialog, ACS_HLINE);
- wattrset(dialog, dialog_attr);
- wbkgdset(dialog, dialog_attr & A_COLOR);
+ wattrset(dialog, dlg.dialog.atr);
+ wbkgdset(dialog, dlg.dialog.atr & A_COLOR);
waddch(dialog, ACS_RTEE);
print_title(dialog, title, width);
@@ -110,7 +111,7 @@ int dialog_textbox(const char *title, const char *file, int height, int width)
getyx(dialog, cur_y, cur_x); /* Save cursor position */
/* Print first page of text */
- attr_clear(text, height - 4, width - 2, dialog_attr);
+ attr_clear(text, height - 4, width - 2, dlg.dialog.atr);
print_page(text, height - 4, width - 2);
print_position(dialog, height, width);
wmove(dialog, cur_y, cur_x); /* Restore cursor position */
@@ -524,8 +525,8 @@ static void print_position(WINDOW * win, int height, int width)
fprintf(stderr, "\nError moving file pointer in print_position().\n");
exit(-1);
}
- wattrset(win, position_indicator_attr);
- wbkgdset(win, position_indicator_attr & A_COLOR);
+ wattrset(win, dlg.position_indicator.atr);
+ wbkgdset(win, dlg.position_indicator.atr & A_COLOR);
percent = !file_size ?
100 : ((fpos - bytes_read + page - buf) * 100) / file_size;
wmove(win, height - 3, width - 9);