menuconfig: delete shadows, prepare for vertical space reclaim
PATCH 1/3 menuconfig: delete shadows, prepare for vertical space reclaim
Shadows consumes precious vertical lines, simply delete them.
--- scripts/kconfig/lxdialog/checklist.c | 2 -- scripts/kconfig/lxdialog/dialog.h | 1 - scripts/kconfig/lxdialog/inputbox.c | 2 -- scripts/kconfig/lxdialog/menubox.c | 2 -- scripts/kconfig/lxdialog/textbox.c | 2 -- scripts/kconfig/lxdialog/util.c | 22 ---------------------- scripts/kconfig/lxdialog/yesno.c | 2 -- 7 files changed, 33 deletions(-)
scripts/kconfig/lxdialog/checklist.c +0 -2
@@ -130,8 +130,6 @@ int dialog_checklist(const char *title, const char *prompt, int height, x = (getmaxx (stdscr) - width) /2 ; y = (getmaxy (stdscr) - height) /2 ; -draw_shadow (stdscr, y, x, height, width); - dialog =newwin (height, width, y, x);keypad (dialog, TRUE);
scripts/kconfig/lxdialog/dialog.h +0 -1
@@ -206,7 +206,6 @@ void print_button(WINDOW * win, const char *label, int y, int x, int selected);void print_title (WINDOW *dialog,const char *title,int width);void draw_box (WINDOW * win,int y,int x,int height,int width,chtype box,chtype border); -void draw_shadow (WINDOW * win,int y,int x,int height,int width);int first_alpha (const char *string,const char *exempt);int dialog_yesno (const char *title,const char *prompt,int height,int width);
scripts/kconfig/lxdialog/inputbox.c +0 -2
@@ -52,8 +52,6 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width x = (getmaxx (stdscr) - width) /2 ; y = (getmaxy (stdscr) - height) /2 ; -draw_shadow (stdscr, y, x, height, width); - dialog =newwin (height, width, y, x);keypad (dialog, TRUE);
scripts/kconfig/lxdialog/menubox.c +0 -2
@@ -193,8 +193,6 @@ int dialog_menu(const char *title, const char *prompt, x = (getmaxx (stdscr) - width) /2 ; y = (getmaxy (stdscr) - height) /2 ; -draw_shadow (stdscr, y, x, height, width); - dialog =newwin (height, width, y, x);keypad (dialog, TRUE);
scripts/kconfig/lxdialog/textbox.c +0 -2
@@ -88,8 +88,6 @@ int dialog_textbox(const char *title, char *tbuf, int initial_height, x = (getmaxx (stdscr) - width) /2 ; y = (getmaxy (stdscr) - height) /2 ; -draw_shadow (stdscr, y, x, height, width); - dialog =newwin (height, width, y, x);keypad (dialog, TRUE);
scripts/kconfig/lxdialog/util.c +0 -22
@@ -491,28 +491,6 @@ draw_box(WINDOW * win, int y, int x, int height, int width, } } -/* -* Draw shadows along the right and bottom edge to give a more 3D look -* to the boxes -*/ -void draw_shadow (WINDOW * win,int y,int x,int height,int width) -{ -int i; - -if (has_colors ()) {/* Whether terminal supports color? */ -wattrset (win, dlg.shadow.atr); -wmove (win, y + height, x +2 ); -for (i =0 ; i < width; i++) -waddch (win,winch (win) &A_CHARTEXT ); -for (i = y +1 ; i < y + height +1 ; i++) { -wmove (win, i, x + width); -waddch (win,winch (win) &A_CHARTEXT ); -waddch (win,winch (win) &A_CHARTEXT ); - } -wnoutrefresh (win); - } -} -/* * Return the position of the first alphabetic character in a string. */
scripts/kconfig/lxdialog/yesno.c +0 -2
@@ -41,8 +41,6 @@ int dialog_yesno(const char *title, const char *prompt, int height, int width) x = (getmaxx (stdscr) - width) /2 ; y = (getmaxy (stdscr) - height) /2 ; -draw_shadow (stdscr, y, x, height, width); - dialog =newwin (height, width, y, x);keypad (dialog, TRUE);
Signature · 1 line
2.39.2
PATCH 2/3 menuconfig: reclaim horizontal space
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.
--- scripts/kconfig/lxdialog/menubox.c | 1 - 1 file changed, 1 deletion(-)
scripts/kconfig/lxdialog/menubox.c +0 -1
@@ -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 ());
Signature · 1 line
2.39.2
Re: [PATCH 2/3] menuconfig: reclaim horizontal space
Hi,
Quoted 3 lines · Alexey Dobriyan
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. ??
Quoted 10 lines
Signed-off-by Alexey Dobriyan <[email protected]>--- scripts/kconfig/lxdialog/menubox.c | 1 - 1 file changed, 1 deletion(-)scripts/kconfig/lxdialog/menubox.c +0
-0
scripts/kconfig/lxdialog/menubox.c int dialog_menu(const char *title, const char *prompt, · line 187
Quoted 4 lines
scripts/kconfig/lxdialog/menubox.c +0
-1@@ -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.
scripts/kconfig/lxdialog/menubox.c int dialog_menu(const char *title, const char *prompt, · line 189
Quoted 3 lines
scripts/kconfig/lxdialog/menubox.c +0
-0menu_height = height -10 ; max_choice =MIN (menu_height,item_count ());
Thanks.
Signature · 1 line
~Randy
Re: [PATCH 2/3] menuconfig: reclaim horizontal space
Quoted 19 lines · Randy Dunlap
Quoted 3 lines · Alexey Dobriyan
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. ??
Quoted 12 lines
Signed-off-by Alexey Dobriyan <[email protected]>--- scripts/kconfig/lxdialog/menubox.c | 1 - 1 file changed, 1 deletion(-)scripts/kconfig/lxdialog/menubox.c +0
-0@@ -184,7 +184,6 @@ int dialog_menu(const char *title, const char *prompt,return -ERRDISPLAYTOOSMALL ;
Quoted 6 lines
scripts/kconfig/lxdialog/menubox.c int dialog_menu(const char *title, const char *prompt, · line 187
Quoted 2 lines
scripts/kconfig/lxdialog/menubox.c +0
-1height -=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.
Quoted 11 lines
Anyway, it worked in my testing.
Tested-by Randy Dunlap <[email protected]>scripts/kconfig/lxdialog/menubox.c int dialog_menu(const char *title, const char *prompt, · line 189
Quoted 3 lines
scripts/kconfig/lxdialog/menubox.c +0
-0menu_height = height -10 ; max_choice =MIN (menu_height,item_count ());Thanks.
Signature · 1 line
~Randy
PATCH 3/3 menuconfig: reclaim vertical space
In reply to Alexey DobriyanMenuconfig has lots of vertical space wasted: on my system there are 17 lines of useful information about config options and 14 lines of useless fluff: legend, horizontal separators and shadows.
Sitation is even worse on smaller terminals because fixed vertical lines do not go away, but config option lines do, further decreasing informational density. Minimum reasonable 80×24 text console has only 10(!) lines of menus presented which is less than half of the screen.
--- scripts/kconfig/lxdialog/menubox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/kconfig/lxdialog/menubox.c +3 -3
@@ -183,14 +183,14 @@ int dialog_menu(const char *title, const char *prompt,if (height <MENUBOX_HEIGTH_MIN || width <MENUBOX_WIDTH_MIN )return -ERRDISPLAYTOOSMALL ; - height -=4 ; + height -=2 ; menu_height = height -10 ; max_choice =MIN (menu_height,item_count ());/* center dialog box on screen */ - x = (getmaxx (stdscr) - width) /2 ; - y = (getmaxy (stdscr) - height) /2 ; + x =0 ; + y =2 ; dialog =newwin (height, width, y, x);keypad (dialog, TRUE);
Signature · 1 line
2.39.2
Re: [PATCH 3/3] menuconfig: reclaim vertical space
Quoted 5 lines · Alexey Dobriyan
Menuconfig has lots of vertical space wasted: on my system there are 17 lines of useful information about config options and 14 lines of useless fluff: legend, horizontal separators and shadows.
Sitation is even worse on smaller terminals because fixed vertical
Situation
Quoted 9 lines
lines do not go away, but config option lines do, further decreasing informational density. Minimum reasonable 80×24 text console has only 10(!) lines of menus presented which is less than half of the screen.
Signed-off-by Alexey Dobriyan <[email protected]>--- scripts/kconfig/lxdialog/menubox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Thanks.
Signature · 1 line
~Randy
Re: [PATCH 3/3] menuconfig: reclaim vertical space
In reply to Alexey DobriyanQuoted 9 lines · Alexey Dobriyan
Menuconfig has lots of vertical space wasted: on my system there are 17 lines of useful information about config options and 14 lines of useless fluff: legend, horizontal separators and shadows.
Sitation is even worse on smaller terminals because fixed vertical lines do not go away, but config option lines do, further decreasing informational density. Minimum reasonable 80×24 text console has only 10(!) lines of menus presented which is less than half of the screen.
I think nconfig is a better fit for your system.
In my understanding, the concept of menuconfig is to use a similar appearance to the 'dialog' tool although we have largely modified the code.
Quoted 29 lines
Signed-off-by Alexey Dobriyan <[email protected]>--- scripts/kconfig/lxdialog/menubox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)scripts/kconfig/lxdialog/menubox.c +3
-4@@ -183,14 +183,14 @@ int dialog_menu(const char *title, const char *prompt,if (height <MENUBOX_HEIGTH_MIN || width <MENUBOX_WIDTH_MIN )return -ERRDISPLAYTOOSMALL ; - height -=4 ; + height -=2 ; menu_height = height -10 ; max_choice =MIN (menu_height,item_count ());/* center dialog box on screen */ - x = (getmaxx (stdscr) - width) /2 ; - y = (getmaxy (stdscr) - height) /2 ; + x =0 ; + y =2 ; dialog =newwin (height, width, y, x);keypad (dialog, TRUE); --
Quoted 2 lines
2.39.2
You missed to adjust dialog_textbox().
(1) Run 'make menuconfig'
(2) Press < Help > button to show help message
(3) Press < Exit > button to get back
When you do (2) and (3), please make sure the size of the grey window is not changed.
This is how the current menuconfig works.
I want to leave the blue frame.
My personal preference is
height -= 3; width -= 2;
--
Best Regards
Masahiro Yamada
Quoted 13 lines · Alexey Dobriyan
Shadows consumes precious vertical lines, simply delete them.
Signed-off-by Alexey Dobriyan <[email protected]>--- scripts/kconfig/lxdialog/checklist.c | 2 -- scripts/kconfig/lxdialog/dialog.h | 1 - scripts/kconfig/lxdialog/inputbox.c | 2 -- scripts/kconfig/lxdialog/menubox.c | 2 -- scripts/kconfig/lxdialog/textbox.c | 2 -- scripts/kconfig/lxdialog/util.c | 22 ---------------------- scripts/kconfig/lxdialog/yesno.c | 2 -- 7 files changed, 33 deletions(-)
Thanks.
Signature · 1 line
~Randy
Quoted 4 lines · Alexey Dobriyan
Shadows consumes precious vertical lines, simply delete them.
Signed-off-by Alexey Dobriyan <[email protected]>
Quoted 9 lines
--- scripts/kconfig/lxdialog/checklist.c | 2 -- scripts/kconfig/lxdialog/dialog.h | 1 - scripts/kconfig/lxdialog/inputbox.c | 2 -- scripts/kconfig/lxdialog/menubox.c | 2 -- scripts/kconfig/lxdialog/textbox.c | 2 -- scripts/kconfig/lxdialog/util.c | 22 ---------------------- scripts/kconfig/lxdialog/yesno.c | 2 -- 7 files changed, 33 deletions(-)
I do not have a strong opinion about the shadow.
If you do this, please removedialog_info::shadow as well.
--
Best Regards
Masahiro Yamada