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>
diff --git a/scripts/kconfig/lxdialog/lxdialog.c b/scripts/kconfig/lxdialog/lxdialog.c
index 79f6c5f..c264e02 100644
--- a/scripts/kconfig/lxdialog/lxdialog.c
+++ b/scripts/kconfig/lxdialog/lxdialog.c
@@ -78,11 +78,11 @@
offset += 2;
}
} else if (!strcmp(argv[offset + 1], "--backtitle")) {
- if (backtitle != NULL) {
+ if (dlg.backtitle != NULL) {
Usage(argv[0]);
exit(-1);
} else {
- backtitle = argv[offset + 2];
+ dlg.backtitle = argv[offset + 2];
offset += 2;
}
} else if (!strcmp(argv[offset + 1], "--clear")) {
@@ -123,7 +123,7 @@
retval = (*(modePtr->jumper)) (title, argc - offset, argv + offset);
if (opt_clear) { /* clear screen before exit */
- attr_clear(stdscr, LINES, COLS, screen_attr);
+ attr_clear(stdscr, LINES, COLS, dlg.screen.atr);
refresh();
}
end_dialog();