windowswitcher: show 's' as "state" for shaded views

While at it sorted the code to show 'm' before 's' and 's' before 'M'
- from the least visible to the most visible state.
This commit is contained in:
Tomi Ollila 2025-07-07 00:53:36 +03:00 committed by Consolatis
parent 77a11568a7
commit c78a0fe1b4
2 changed files with 9 additions and 6 deletions

View file

@ -111,10 +111,12 @@ static void
field_set_win_state(struct buf *buf, struct view *view, const char *format)
{
/* custom type conversion-specifier: s */
if (view->maximized) {
buf_add(buf, "M");
} else if (view->minimized) {
if (view->minimized) {
buf_add(buf, "m");
} else if (view->shaded) {
buf_add(buf, "s");
} else if (view->maximized) {
buf_add(buf, "M");
} else if (view->fullscreen) {
buf_add(buf, "F");
} else {
@ -127,6 +129,7 @@ field_set_win_state_all(struct buf *buf, struct view *view, const char *format)
{
/* custom type conversion-specifier: S */
buf_add(buf, view->minimized ? "m" : " ");
buf_add(buf, view->shaded ? "s" : " ");
buf_add(buf, view->maximized ? "M" : " ");
buf_add(buf, view->fullscreen ? "F" : " ");
/* TODO: add always-on-top and omnipresent ? */