Skip to content

Commit 452dcfb

Browse files
committed
Display count on console log filter buttons
1 parent 589c02e commit 452dcfb

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/Editor/Windows/ConsoleWindow.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using ImGuiNET;
2-
using System.Numerics;
1+
using System.Numerics;
32

43
using static ImGuiNET.ImGui;
54

@@ -22,15 +21,19 @@ protected override void Draw()
2221

2322
SameLine();
2423

25-
Checkbox("Messages", ref showMessages);
24+
25+
var messageCount = Logs.Where(x => x.Type == LogType.Message).Count();
26+
Checkbox(string.Format("Messages ({0})", messageCount), ref showMessages);
2627

2728
SameLine();
2829

29-
Checkbox("Warnings", ref showWarnings);
30+
var warningCount = Logs.Where(x => x.Type == LogType.Warning).Count();
31+
Checkbox(string.Format("Warnings ({0})", warningCount), ref showWarnings);
3032

3133
SameLine();
3234

33-
Checkbox("Errors", ref showErrors);
35+
var errorCount = Logs.Where(x => x.Type == LogType.Error).Count();
36+
Checkbox(string.Format("Errors ({0})", errorCount), ref showErrors);
3437

3538
if (BeginChild("logList", GetWindowSize() - (GetCursorPos() + new Vector2(0, 8))))
3639
{

0 commit comments

Comments
 (0)