Improve layout symbol functions

This commit is contained in:
Alex Kotov 2021-11-15 04:12:53 +05:00
parent e93ff551de
commit ee0c5ec71e
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -30,7 +30,7 @@ void layouts_symbol_monocle(
if (buffer == NULL) return; if (buffer == NULL) return;
char tmp[TMP_BUFFER_SIZE]; char tmp[TMP_BUFFER_SIZE];
sprintf(tmp, "[%u]", visible_clients); sprintf(tmp, "[%u/%u]", clients_in_master, visible_clients);
tmp[(buffer_size > TMP_BUFFER_SIZE ? TMP_BUFFER_SIZE : buffer_size) - 1] = '\0'; tmp[(buffer_size > TMP_BUFFER_SIZE ? TMP_BUFFER_SIZE : buffer_size) - 1] = '\0';
strncpy(buffer, tmp, buffer_size); strncpy(buffer, tmp, buffer_size);
} }
@ -45,7 +45,7 @@ void layouts_symbol_floating(
if (buffer == NULL) return; if (buffer == NULL) return;
char tmp[TMP_BUFFER_SIZE]; char tmp[TMP_BUFFER_SIZE];
strcpy(tmp, "><>"); sprintf(tmp, "<%u/%u>", clients_in_master, visible_clients);
tmp[(buffer_size > TMP_BUFFER_SIZE ? TMP_BUFFER_SIZE : buffer_size) - 1] = '\0'; tmp[(buffer_size > TMP_BUFFER_SIZE ? TMP_BUFFER_SIZE : buffer_size) - 1] = '\0';
strncpy(buffer, tmp, buffer_size); strncpy(buffer, tmp, buffer_size);
} }
@ -60,7 +60,7 @@ void layouts_symbol_tile(
if (buffer == NULL) return; if (buffer == NULL) return;
char tmp[TMP_BUFFER_SIZE]; char tmp[TMP_BUFFER_SIZE];
sprintf(tmp, "[%u]=", clients_in_master); sprintf(tmp, "{%u/%u}=", clients_in_master, visible_clients);
tmp[(buffer_size > TMP_BUFFER_SIZE ? TMP_BUFFER_SIZE : buffer_size) - 1] = '\0'; tmp[(buffer_size > TMP_BUFFER_SIZE ? TMP_BUFFER_SIZE : buffer_size) - 1] = '\0';
strncpy(buffer, tmp, buffer_size); strncpy(buffer, tmp, buffer_size);
} }
@ -75,7 +75,7 @@ void layouts_symbol_centeredmaster(
if (buffer == NULL) return; if (buffer == NULL) return;
char tmp[TMP_BUFFER_SIZE]; char tmp[TMP_BUFFER_SIZE];
sprintf(tmp, "=[%u]=", clients_in_master); sprintf(tmp, "={%u/%u}=", clients_in_master, visible_clients);
tmp[(buffer_size > TMP_BUFFER_SIZE ? TMP_BUFFER_SIZE : buffer_size) - 1] = '\0'; tmp[(buffer_size > TMP_BUFFER_SIZE ? TMP_BUFFER_SIZE : buffer_size) - 1] = '\0';
strncpy(buffer, tmp, buffer_size); strncpy(buffer, tmp, buffer_size);
} }