public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/19] kconfig: recenter menuconfig
@ 2006-04-09 15:27 Roman Zippel
  2006-04-09 21:25 ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: Roman Zippel @ 2006-04-09 15:27 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton, Sam Ravnborg


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);

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/19] kconfig: recenter menuconfig
  2006-04-09 15:27 [PATCH 3/19] kconfig: recenter menuconfig Roman Zippel
@ 2006-04-09 21:25 ` Sam Ravnborg
  2006-04-09 21:46   ` Roman Zippel
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2006-04-09 21:25 UTC (permalink / raw)
  To: Roman Zippel; +Cc: linux-kernel, Andrew Morton

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/19] kconfig: recenter menuconfig
  2006-04-09 21:25 ` Sam Ravnborg
@ 2006-04-09 21:46   ` Roman Zippel
  2006-04-09 21:55     ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: Roman Zippel @ 2006-04-09 21:46 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel, Andrew Morton

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/19] kconfig: recenter menuconfig
  2006-04-09 21:46   ` Roman Zippel
@ 2006-04-09 21:55     ` Sam Ravnborg
  2006-04-09 22:10       ` Roman Zippel
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2006-04-09 21:55 UTC (permalink / raw)
  To: Roman Zippel; +Cc: linux-kernel, Andrew Morton

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/19] kconfig: recenter menuconfig
  2006-04-09 21:55     ` Sam Ravnborg
@ 2006-04-09 22:10       ` Roman Zippel
  2006-04-09 23:31         ` Nigel Cunningham
  0 siblings, 1 reply; 8+ messages in thread
From: Roman Zippel @ 2006-04-09 22:10 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel, Andrew Morton

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/19] kconfig: recenter menuconfig
  2006-04-09 23:31         ` Nigel Cunningham
@ 2006-04-09 22:39           ` Andrew Morton
  2006-04-10  0:33             ` Randy.Dunlap
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Morton @ 2006-04-09 22:39 UTC (permalink / raw)
  To: Nigel Cunningham; +Cc: zippel, sam, linux-kernel

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..


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/19] kconfig: recenter menuconfig
  2006-04-09 22:10       ` Roman Zippel
@ 2006-04-09 23:31         ` Nigel Cunningham
  2006-04-09 22:39           ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Nigel Cunningham @ 2006-04-09 23:31 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Sam Ravnborg, linux-kernel, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/19] kconfig: recenter menuconfig
  2006-04-09 22:39           ` Andrew Morton
@ 2006-04-10  0:33             ` Randy.Dunlap
  0 siblings, 0 replies; 8+ messages in thread
From: Randy.Dunlap @ 2006-04-10  0:33 UTC (permalink / raw)
  To: Andrew Morton; +Cc: ncunningham, zippel, sam, linux-kernel

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-04-10  0:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-09 15:27 [PATCH 3/19] kconfig: recenter menuconfig Roman Zippel
2006-04-09 21:25 ` Sam Ravnborg
2006-04-09 21:46   ` Roman Zippel
2006-04-09 21:55     ` Sam Ravnborg
2006-04-09 22:10       ` Roman Zippel
2006-04-09 23:31         ` Nigel Cunningham
2006-04-09 22:39           ` Andrew Morton
2006-04-10  0:33             ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox