Mailing List Archive

[PATCH 3/19] kconfig: recenter menuconfig
Move the menuconfig output more into the centre again, it's using a
fixed position depending on the window width using the fact that the
menu output has to work in a 80 chars terminal.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>

---

scripts/kconfig/lxdialog/menubox.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)

Index: linux-2.6-git/scripts/kconfig/lxdialog/menubox.c
===================================================================
--- linux-2.6-git.orig/scripts/kconfig/lxdialog/menubox.c
+++ linux-2.6-git/scripts/kconfig/lxdialog/menubox.c
@@ -58,8 +58,7 @@

#include "dialog.h"

-#define ITEM_IDENT 1 /* Indent of menu entries. Fixed for all menus */
-static int menu_width;
+static int menu_width, item_x;

/*
* Print menu item
@@ -70,7 +69,7 @@ static void do_print_item(WINDOW * win,
int j;
char *menu_item = malloc(menu_width + 1);

- strncpy(menu_item, item, menu_width - ITEM_IDENT);
+ strncpy(menu_item, item, menu_width - item_x);
menu_item[menu_width] = 0;
j = first_alpha(menu_item, "YyNnMmHh");

@@ -87,13 +86,13 @@ static void do_print_item(WINDOW * win,
wclrtoeol(win);
#endif
wattrset(win, selected ? item_selected_attr : item_attr);
- mvwaddstr(win, choice, ITEM_IDENT, menu_item);
+ mvwaddstr(win, choice, item_x, menu_item);
if (hotkey) {
wattrset(win, selected ? tag_key_selected_attr : tag_key_attr);
- mvwaddch(win, choice, ITEM_IDENT + j, menu_item[j]);
+ mvwaddch(win, choice, item_x + j, menu_item[j]);
}
if (selected) {
- wmove(win, choice, ITEM_IDENT + 1);
+ wmove(win, choice, item_x + 1);
}
free(menu_item);
wrefresh(win);
@@ -227,6 +226,8 @@ int dialog_menu(const char *title, const
draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2,
menubox_border_attr, menubox_attr);

+ item_x = (menu_width - 70) / 2;
+
/* Set choice to default item */
for (i = 0; i < item_no; i++)
if (strcmp(current, items[i * 2]) == 0)
@@ -263,10 +264,10 @@ int dialog_menu(const char *title, const
wnoutrefresh(menu);

print_arrows(dialog, item_no, scroll,
- box_y, box_x + ITEM_IDENT + 1, menu_height);
+ box_y, box_x + item_x + 1, menu_height);

print_buttons(dialog, height, width, 0);
- wmove(menu, choice, ITEM_IDENT + 1);
+ wmove(menu, choice, item_x + 1);
wrefresh(menu);

while (key != ESC) {
@@ -349,7 +350,7 @@ int dialog_menu(const char *title, const
print_item(scroll + choice, choice, TRUE);

print_arrows(dialog, item_no, scroll,
- box_y, box_x + ITEM_IDENT + 1, menu_height);
+ box_y, box_x + item_x + 1, menu_height);

wnoutrefresh(dialog);
wrefresh(menu);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/19] kconfig: recenter menuconfig [ In reply to ]
On Sun, Apr 09, 2006 at 05:27:14PM +0200, Roman Zippel wrote:
>
> Move the menuconfig output more into the centre again, it's using a
> fixed position depending on the window width using the fact that the
> menu output has to work in a 80 chars terminal.
>
> Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
NACK.
With this change when window width is > 80 then we waste half of
the screen width only to right-indent the menus.

We truncate longer prompts and with this we require twice the
width to see full prompt.

One could argue that the old ITEM_IDENT should be 0 instead of 1,
avoiding wasting an extra char. But with this change we waste
a lot of space.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/19] kconfig: recenter menuconfig [ In reply to ]
Hi,

On Sun, 9 Apr 2006, Sam Ravnborg wrote:

> With this change when window width is > 80 then we waste half of
> the screen width only to right-indent the menus.

Currently we waste a lot of screen on right side, which is not much
different. Further there is now a mix of left aligned and centered output,
which is ugly, so this patch only restores the old behaviour (without the
jumping around for small text changes).

> We truncate longer prompts and with this we require twice the
> width to see full prompt.

If these longer prompts don't fit into a 80 coloumn window, it's a bug.

bye, Roman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/19] kconfig: recenter menuconfig [ In reply to ]
On Sun, Apr 09, 2006 at 11:46:00PM +0200, Roman Zippel wrote:
> Hi,
>
> On Sun, 9 Apr 2006, Sam Ravnborg wrote:
>
> > With this change when window width is > 80 then we waste half of
> > the screen width only to right-indent the menus.
>
> Currently we waste a lot of screen on right side, which is not much
> different.
Thats normal behaviour vi does the same for this text.

> Further there is now a mix of left aligned and centered output,
> which is ugly
So we should fix the rest too instead of reintroducing the old
behaviour.

>
> > We truncate longer prompts and with this we require twice the
> > width to see full prompt.
>
> If these longer prompts don't fit into a 80 coloumn window, it's a bug.

Try to add three directories somewhere deep to "Initramfs source file(s)".
Thats where I have been hit by the limitation today.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/19] kconfig: recenter menuconfig [ In reply to ]
Hi,

On Sun, 9 Apr 2006, Sam Ravnborg wrote:

> > Further there is now a mix of left aligned and centered output,
> > which is ugly
> So we should fix the rest too instead of reintroducing the old
> behaviour.

Well, I prefer the old behaviour.

> > > We truncate longer prompts and with this we require twice the
> > > width to see full prompt.
> >
> > If these longer prompts don't fit into a 80 coloumn window, it's a bug.
>
> Try to add three directories somewhere deep to "Initramfs source file(s)".
> Thats where I have been hit by the limitation today.

This means it wouldn't work in a 80 coloumn window either. In either case
we should fix the real problem, like putting the value on a separate line.

bye, Roman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/19] kconfig: recenter menuconfig [ In reply to ]
Nigel Cunningham <ncunningham@cyclades.com> wrote:
>
> Hi.
>
> On Monday 10 April 2006 08:10, Roman Zippel wrote:
> > Hi,
> >
> > On Sun, 9 Apr 2006, Sam Ravnborg wrote:
> > > > Further there is now a mix of left aligned and centered output,
> > > > which is ugly
> > >
> > > So we should fix the rest too instead of reintroducing the old
> > > behaviour.
> >
> > Well, I prefer the old behaviour.
>
> I don't know if you want 2c worth from other people, but I liked menuconfig
> much better when it was more centred. This new
> 'everything-hard-against-the-left-margin' look is ugly, IMHO :)
>

It hardly seems to matter, given that the colours we use make the text
invisible anyway..

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/19] kconfig: recenter menuconfig [ In reply to ]
Hi.

On Monday 10 April 2006 08:10, Roman Zippel wrote:
> Hi,
>
> On Sun, 9 Apr 2006, Sam Ravnborg wrote:
> > > Further there is now a mix of left aligned and centered output,
> > > which is ugly
> >
> > So we should fix the rest too instead of reintroducing the old
> > behaviour.
>
> Well, I prefer the old behaviour.

I don't know if you want 2c worth from other people, but I liked menuconfig
much better when it was more centred. This new
'everything-hard-against-the-left-margin' look is ugly, IMHO :)

Regards,

NIgel
Re: [PATCH 3/19] kconfig: recenter menuconfig [ In reply to ]
On Sun, 9 Apr 2006 15:39:14 -0700 Andrew Morton wrote:

> Nigel Cunningham <ncunningham@cyclades.com> wrote:
> >
> > Hi.
> >
> > On Monday 10 April 2006 08:10, Roman Zippel wrote:
> > > Hi,
> > >
> > > On Sun, 9 Apr 2006, Sam Ravnborg wrote:
> > > > > Further there is now a mix of left aligned and centered output,
> > > > > which is ugly
> > > >
> > > > So we should fix the rest too instead of reintroducing the old
> > > > behaviour.
> > >
> > > Well, I prefer the old behaviour.
> >
> > I don't know if you want 2c worth from other people, but I liked menuconfig
> > much better when it was more centred. This new
> > 'everything-hard-against-the-left-margin' look is ugly, IMHO :)
> >
>
> It hardly seems to matter, given that the colours we use make the text
> invisible anyway..

You (anyone) can get alternate colors or monochrome here:
http://www.xenotime.net/linux/patches/menuconfig-altcolor-mono.patch

The yellow highlight character shows up poorly for me. OTOH, I doubt that
any one color scheme would be good for everyone.

---
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/