Преглед изворни кода

bar shows if currently is tiled (Mod1-space) or floating (Mod1-Shift-space) mode

Anselm R. Garbe пре 19 година
родитељ
комит
54775e0b3e
2 измењених фајлова са 7 додато и 1 уклоњено
  1. 5 1
      bar.c
  2. 2 0
      client.c

+ 5 - 1
bar.c

@@ -23,11 +23,15 @@ void
 draw_bar()
 {
 	int i;
+	char *mode = arrange == tiling ? "#" : "~";
+
 	dc.x = dc.y = 0;
 	dc.w = bw;
 	drawtext(NULL, False, False);
 
-	dc.w = 0;
+	dc.w = textw(mode) + dc.font.height;
+	drawtext(mode, True, True);
+
 	for(i = 0; i < TLast; i++) {
 		dc.x += dc.w;
 		dc.w = textw(tags[i]) + dc.font.height;

+ 2 - 0
client.c

@@ -120,6 +120,7 @@ floating(Arg *arg)
 			focus(sel);
 		}
 	}
+	draw_bar();
 }
 
 void
@@ -176,6 +177,7 @@ tiling(Arg *arg)
 			focus(sel);
 		}
 	}
+	draw_bar();
 }
 
 void