From 46dde8697bb96102b3e9cb804e3c5151a3263688 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 18 Feb 2024 13:23:17 +0300 Subject: [PATCH] (info_new): use WRect to define a panel area. Signed-off-by: Andrew Borodin --- src/filemanager/info.c | 5 ++--- src/filemanager/info.h | 2 +- src/filemanager/layout.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/filemanager/info.c b/src/filemanager/info.c index 584bc2af6..c5e2d763e 100644 --- a/src/filemanager/info.c +++ b/src/filemanager/info.c @@ -361,15 +361,14 @@ info_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *da /* --------------------------------------------------------------------------------------------- */ WInfo * -info_new (int y, int x, int lines, int cols) +info_new (const WRect * r) { - WRect r = { y, x, lines, cols }; WInfo *info; Widget *w; info = g_new (struct WInfo, 1); w = WIDGET (info); - widget_init (w, &r, info_callback, NULL); + widget_init (w, r, info_callback, NULL); return info; } diff --git a/src/filemanager/info.h b/src/filemanager/info.h index cba2592e9..60bf3c6fc 100644 --- a/src/filemanager/info.h +++ b/src/filemanager/info.h @@ -18,7 +18,7 @@ typedef struct WInfo WInfo; /*** declarations of public functions ************************************************************/ -WInfo *info_new (int y, int x, int lines, int cols); +WInfo *info_new (const WRect * r); /*** inline functions ****************************************************************************/ #endif /* MC__INFO_H */ diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c index 4ba7e516b..d435bb29b 100644 --- a/src/filemanager/layout.c +++ b/src/filemanager/layout.c @@ -1188,7 +1188,7 @@ create_panel (int num, panel_view_mode_t type) } case view_info: - new_widget = WIDGET (info_new (r.y, r.x, r.lines, r.cols)); + new_widget = WIDGET (info_new (&r)); break; case view_tree: