From 136fc32e1e7aba61f4606ff104e619e71f8b9290 Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Sun, 17 Jul 2022 22:39:39 +0200 Subject: [PATCH] don't show pause button when not synced --- MareSynchronos/UI/CompactUI.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/MareSynchronos/UI/CompactUI.cs b/MareSynchronos/UI/CompactUI.cs index 46650e6..2b4b13d 100644 --- a/MareSynchronos/UI/CompactUI.cs +++ b/MareSynchronos/UI/CompactUI.cs @@ -245,15 +245,18 @@ namespace MareSynchronos.UI } UiShared.AttachToolTip("Hold CTRL and click to unpair permanently from " + entry.OtherUID); - ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X - ImGui.GetStyle().ItemSpacing.X - trashButtonSize.X); - ImGui.SetCursorPosY(originalY); - if (ImGuiComponents.IconButton(pauseIcon)) + if (entry.IsSynced) { - _ = _apiController.SendPairedClientPauseChange(entry.OtherUID, !entry.IsPaused); + ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X - ImGui.GetStyle().ItemSpacing.X - trashButtonSize.X); + ImGui.SetCursorPosY(originalY); + if (ImGuiComponents.IconButton(pauseIcon)) + { + _ = _apiController.SendPairedClientPauseChange(entry.OtherUID, !entry.IsPaused); + } + UiShared.AttachToolTip(!entry.IsPaused + ? "Pause pairing with " + entry.OtherUID + : "Resume pairing with " + entry.OtherUID); } - UiShared.AttachToolTip(entry.IsPaused - ? "Pause pairing with " + entry.OtherUID - : "Resume pairing with " + entry.OtherUID); } private void DrawPairList()