[1/3] menuconfig: delete shadows, prepare for vertical space reclaim

Message ID 20230311114248.36587-1-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
  Shadows consumes precious vertical lines, simply delete them.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
 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(-)
  

Comments

Randy Dunlap March 13, 2023, 12:29 a.m. UTC | #1
On 3/11/23 03:42, Alexey Dobriyan wrote:
> Shadows consumes precious vertical lines, simply delete them.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>  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(-)
> 


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

Thanks.
  
Masahiro Yamada March 21, 2023, 5:35 a.m. UTC | #2
On Sat, Mar 11, 2023 at 8:43 PM Alexey Dobriyan <adobriyan@gmail.com> wrote:
>
> Shadows consumes precious vertical lines, simply delete them.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>  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 remove
dialog_info::shadow as well.








--
Best Regards
Masahiro Yamada
  

Patch

diff --git a/scripts/kconfig/lxdialog/checklist.c b/scripts/kconfig/lxdialog/checklist.c
index fd161cfff121..7ce5233afaca 100644
--- a/scripts/kconfig/lxdialog/checklist.c
+++ b/scripts/kconfig/lxdialog/checklist.c
@@ -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);
 
diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h
index 68b565e3c495..50b2674b734d 100644
--- a/scripts/kconfig/lxdialog/dialog.h
+++ b/scripts/kconfig/lxdialog/dialog.h
@@ -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);
diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
index 1dcfb288ee63..0bda6186a599 100644
--- a/scripts/kconfig/lxdialog/inputbox.c
+++ b/scripts/kconfig/lxdialog/inputbox.c
@@ -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);
 
diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index 58c2f8afe59b..5c3addad89b0 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -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);
 
diff --git a/scripts/kconfig/lxdialog/textbox.c b/scripts/kconfig/lxdialog/textbox.c
index 4e339b12664e..de965d0770e2 100644
--- a/scripts/kconfig/lxdialog/textbox.c
+++ b/scripts/kconfig/lxdialog/textbox.c
@@ -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);
 
diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
index 3f78fb265136..72dc30e3322d 100644
--- a/scripts/kconfig/lxdialog/util.c
+++ b/scripts/kconfig/lxdialog/util.c
@@ -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.
  */
diff --git a/scripts/kconfig/lxdialog/yesno.c b/scripts/kconfig/lxdialog/yesno.c
index bcaac9b7bab2..25e4f10e0e6a 100644
--- a/scripts/kconfig/lxdialog/yesno.c
+++ b/scripts/kconfig/lxdialog/yesno.c
@@ -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);