(info_new): use WRect to define a panel area.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2024-02-18 13:23:17 +03:00
parent be148a0578
commit 46dde8697b
3 changed files with 4 additions and 5 deletions

View File

@ -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;
}

View File

@ -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 */

View File

@ -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: