mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-04 04:44:16 +01:00
Info panel: Shorten memory line and simplify code a bit
With the fonts I use here, the memory information line in the "Info panel" did not fit inside the window. So make that line a bit shorter by displaying Total memory allocated: 2600 kB (in use: 2182 kB) instead of Total allocated memory: 2600 kB. Total memory in use: 2182 kB. Furthermore, the surrounding code was a bit convoluted to display either "Additional support for: WMSPEC" or "Additional support for: WMSPEC and MW" As WMSPEC is always present and it doesn't seem we are adding more stuff to support, one can do the same with a shorter code which reads a little bit better.
This commit is contained in:
25
src/dialog.c
25
src/dialog.c
@@ -1230,7 +1230,7 @@ void wShowInfoPanel(WScreen * scr)
|
|||||||
{
|
{
|
||||||
struct mallinfo ma = mallinfo();
|
struct mallinfo ma = mallinfo();
|
||||||
snprintf(buffer, sizeof(buffer),
|
snprintf(buffer, sizeof(buffer),
|
||||||
_("Total allocated memory: %i kB. Total memory in use: %i kB.\n"),
|
_("Total memory allocated: %i kB (in use: %i kB).\n"),
|
||||||
(ma.arena + ma.hblkhd) / 1024, (ma.uordblks + ma.hblkhd) / 1024);
|
(ma.arena + ma.hblkhd) / 1024, (ma.uordblks + ma.hblkhd) / 1024);
|
||||||
|
|
||||||
strbuf = wstrappend(strbuf, buffer);
|
strbuf = wstrappend(strbuf, buffer);
|
||||||
@@ -1244,30 +1244,11 @@ void wShowInfoPanel(WScreen * scr)
|
|||||||
strbuf = wstrappend(strbuf, " ");
|
strbuf = wstrappend(strbuf, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
strbuf = wstrappend(strbuf, _("\nAdditional support for: "));
|
strbuf = wstrappend(strbuf, _("\nAdditional support for: WMSPEC"));
|
||||||
{
|
|
||||||
char *list[9];
|
|
||||||
char buf[80];
|
|
||||||
int j = 0;
|
|
||||||
|
|
||||||
list[j++] = "WMSPEC";
|
|
||||||
#ifdef MWM_HINTS
|
#ifdef MWM_HINTS
|
||||||
list[j++] = "MWM";
|
strbuf = wstrappend(strbuf, " and MWM");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
buf[0] = 0;
|
|
||||||
for (i = 0; i < j; i++) {
|
|
||||||
if (i > 0) {
|
|
||||||
if (i == j - 1)
|
|
||||||
strcat(buf, _(" and "));
|
|
||||||
else
|
|
||||||
strcat(buf, ", ");
|
|
||||||
}
|
|
||||||
strcat(buf, list[i]);
|
|
||||||
}
|
|
||||||
strbuf = wstrappend(strbuf, buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
strbuf = wstrappend(strbuf, _("\n"));
|
strbuf = wstrappend(strbuf, _("\n"));
|
||||||
#ifdef SOLARIS_XINERAMA
|
#ifdef SOLARIS_XINERAMA
|
||||||
|
|||||||
Reference in New Issue
Block a user