feat: add hide option to message context menu

This commit is contained in:
Anna
2022-02-04 05:14:37 -05:00
parent 2d8d7d5ec0
commit 61243096ec
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -90,6 +90,10 @@ internal sealed class PayloadHandler {
ImGui.Checkbox("Screenshot mode", ref this.Ui.ScreenshotMode); ImGui.Checkbox("Screenshot mode", ref this.Ui.ScreenshotMode);
if (ImGui.Selectable("Hide chat")) {
this.Log.UserHide();
}
if (chunk.Message is { } message) { if (chunk.Message is { } message) {
if (ImGui.BeginMenu("Copy")) { if (ImGui.BeginMenu("Copy")) {
var text = message.Sender var text = message.Sender
+5 -1
View File
@@ -487,7 +487,7 @@ internal sealed class ChatLog : IUiComponent {
try { try {
if (ImGui.Selectable("Hide chat")) { if (ImGui.Selectable("Hide chat")) {
this._hideState = HideState.User; this.UserHide();
} }
} finally { } finally {
ImGui.PopStyleColor(); ImGui.PopStyleColor();
@@ -517,6 +517,10 @@ internal sealed class ChatLog : IUiComponent {
ImGui.End(); ImGui.End();
} }
internal void UserHide() {
this._hideState = HideState.User;
}
private void DrawMessageLog(Tab tab, float childHeight, bool switchedTab) { private void DrawMessageLog(Tab tab, float childHeight, bool switchedTab) {
if (ImGui.BeginChild("##chat2-messages", new Vector2(-1, childHeight))) { if (ImGui.BeginChild("##chat2-messages", new Vector2(-1, childHeight))) {
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, Vector2.Zero); ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, Vector2.Zero);