[2/3] menuconfig: reclaim horizontal space

Message ID 20230311114248.36587-2-adobriyan@gmail.com
State New
Headers
Series [1/3] menuconfig: delete shadows, prepare for vertical space reclaim |

Commit Message

Alexey Dobriyan March 11, 2023, 11:42 a.m. UTC
  Draw the menu box from position (0, 2) so that there is less unused
space available. Horizontal is not _really_ important but on small
terminals maybe it is.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
 scripts/kconfig/lxdialog/menubox.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Randy Dunlap March 13, 2023, 12:29 a.m. UTC | #1
Hi,

On 3/11/23 03:42, Alexey Dobriyan wrote:
> Draw the menu box from position (0, 2) so that there is less unused
> space available. Horizontal is not _really_ important but on small
> terminals maybe it is.

ISTM that the first sentence goes with patch 3/3. ??

> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>  scripts/kconfig/lxdialog/menubox.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
> index 5c3addad89b0..5eb67c04821f 100644
> --- a/scripts/kconfig/lxdialog/menubox.c
> +++ b/scripts/kconfig/lxdialog/menubox.c
> @@ -184,7 +184,6 @@ int dialog_menu(const char *title, const char *prompt,
>  		return -ERRDISPLAYTOOSMALL;
>  
>  	height -= 4;
> -	width  -= 5;

How does this work?  In my test patch, I changed 5 to 4 to recover/reclaim the
shadow line.  To my surprise, I don't see any negative issue with this change,
but I am perplexed by it.

Anyway, it worked in my testing.

Tested-by: Randy Dunlap <rdunlap@infradead.org>

>  	menu_height = height - 10;
>  
>  	max_choice = MIN(menu_height, item_count());

Thanks.
  
Alexey Dobriyan March 13, 2023, 7:27 p.m. UTC | #2
On Sun, Mar 12, 2023 at 05:29:24PM -0700, Randy Dunlap wrote:
> On 3/11/23 03:42, Alexey Dobriyan wrote:
> > Draw the menu box from position (0, 2) so that there is less unused
> > space available. Horizontal is not _really_ important but on small
> > terminals maybe it is.
> 
> ISTM that the first sentence goes with patch 3/3. ??
> 
> > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> > ---
> >  scripts/kconfig/lxdialog/menubox.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
> > index 5c3addad89b0..5eb67c04821f 100644
> > --- a/scripts/kconfig/lxdialog/menubox.c
> > +++ b/scripts/kconfig/lxdialog/menubox.c
> > @@ -184,7 +184,6 @@ int dialog_menu(const char *title, const char *prompt,
> >  		return -ERRDISPLAYTOOSMALL;
> >  
> >  	height -= 4;
> > -	width  -= 5;
> 
> How does this work?  In my test patch, I changed 5 to 4 to recover/reclaim the
> shadow line.  To my surprise, I don't see any negative issue with this change,
> but I am perplexed by it.

Ehh? It is calculated as (getmaxx - width) / 2, so both 5 or 4 do
the same thing.

> Anyway, it worked in my testing.
> 
> Tested-by: Randy Dunlap <rdunlap@infradead.org>
> 
> >  	menu_height = height - 10;
> >  
> >  	max_choice = MIN(menu_height, item_count());
> 
> Thanks.
> -- 
> ~Randy
  

Patch

diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index 5c3addad89b0..5eb67c04821f 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -184,7 +184,6 @@  int dialog_menu(const char *title, const char *prompt,
 		return -ERRDISPLAYTOOSMALL;
 
 	height -= 4;
-	width  -= 5;
 	menu_height = height - 10;
 
 	max_choice = MIN(menu_height, item_count());