From 45ab72a78a0844fdad099e936f3f72e7f42f9e57 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Mon, 13 Feb 2023 20:29:26 +0800 Subject: [PATCH] InfoPanel: fix out of display text When debug is enabled, the memory allocated details is supposed to display the free chunks but as the text length is too long it's getting out of the display area. This patch is increasing the window width to handle such case. --- src/dialog.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/dialog.c b/src/dialog.c index 7f3a0ef4..b8d3c6db 100755 --- a/src/dialog.c +++ b/src/dialog.c @@ -1220,7 +1220,11 @@ void wShowInfoPanel(WScreen *scr) panel->win = WMCreateWindow(scr->wmscreen, "info"); WMGetScaleBaseFromSystemFont(scr->wmscreen, &wmScaleWidth, &wmScaleHeight); +#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO2) && defined(DEBUG) + pwidth = WMScaleX(412); +#else pwidth = WMScaleX(382); +#endif pheight = WMScaleY(250); WMResizeWidget(panel->win, pwidth, pheight); @@ -1321,7 +1325,6 @@ void wShowInfoPanel(WScreen *scr) } #if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO2) - { struct mallinfo2 ma = mallinfo2(); snprintf(buffer, sizeof(buffer), @@ -1395,7 +1398,11 @@ void wShowInfoPanel(WScreen *scr) #endif panel->infoL = WMCreateLabel(panel->win); +#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO2) && defined(DEBUG) + WMResizeWidget(panel->infoL, WMScaleX(380), WMScaleY(80)); +#else WMResizeWidget(panel->infoL, WMScaleX(350), WMScaleY(80)); +#endif WMMoveWidget(panel->infoL, WMScaleX(15), WMScaleY(115)); WMSetLabelText(panel->infoL, strbuf); font = WMSystemFontOfSize(scr->wmscreen, WMScaleY(11));