Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/menuc 1) Use standard box drawing characters. It loo...



details:   https://anonhg.NetBSD.org/src/rev/9fce15e0f770
branches:  trunk
changeset: 517681:9fce15e0f770
user:      perry <perry%NetBSD.org@localhost>
date:      Sat Nov 17 01:12:47 2001 +0000

description:
1) Use standard box drawing characters. It looks a whole lot better
   than *'s.
2) On displays that handle color, do a cheesy white-on-blue theme.

As silly as it may seem, many people seem to respond better to color
and nice borders for sysinst.

XXX will rig up a way to do this more cleanly.

diffstat:

 usr.bin/menuc/menu_sys.def |  21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r 5b61a8818018 -r 9fce15e0f770 usr.bin/menuc/menu_sys.def
--- a/usr.bin/menuc/menu_sys.def        Sat Nov 17 00:56:04 2001 +0000
+++ b/usr.bin/menuc/menu_sys.def        Sat Nov 17 01:12:47 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menu_sys.def,v 1.25 2001/01/07 06:09:20 phil Exp $     */
+/*     $NetBSD: menu_sys.def,v 1.26 2001/11/17 01:12:47 perry Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -312,7 +312,13 @@
                (void) fprintf (stderr,
                        "Could not create window for menu \"%s\"\n", m->title);
                exit(1);
-       } 
+       }
+
+       /* XXX is it even worth doing this right? */
+       if (has_colors()) {
+               wbkgd(m->mw, COLOR_PAIR(1));
+               wattrset(m->mw, COLOR_PAIR(1));
+       }
 }
 
 static char
@@ -406,7 +412,7 @@
 
        /* Add the box. */
        if (!(m->mopt & MC_NOBOX))
-               box(m->mw, '*', '*');
+               box(m->mw, 0, 0);
 
        wmove(m->mw, selrow, hasbox);
 }
@@ -611,6 +617,15 @@
 
        cbreak();
        noecho();
+
+       /* XXX Should be configurable but it almost isn't worth it. */
+       if (has_colors()) {
+               start_color();
+               init_pair(1, COLOR_WHITE, COLOR_BLUE);
+               bkgd(COLOR_PAIR(1));
+               attrset(COLOR_PAIR(1));
+       }
+
        max_lines = getmaxy(stdscr);
        max_cols = getmaxx(stdscr);
        init_keyseq();



Home | Main Index | Thread Index | Old Index