From eeafb3dbb3b3b1f48bf0b33af8520aae8863afda Mon Sep 17 00:00:00 2001 From: Ford Smith Date: Fri, 22 Nov 2019 13:37:51 -0500 Subject: [PATCH] UI: Fix wrong icon if recording stopped while paused --- UI/window-basic-main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 3687510b5..9c589bd84 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5087,6 +5087,9 @@ inline void OBSBasic::OnActivate() } } +extern volatile bool recording_paused; +extern volatile bool replaybuf_active; + inline void OBSBasic::OnDeactivate() { if (!outputHandler->Active() && !ui->profileMenu->isEnabled()) { @@ -5098,8 +5101,10 @@ inline void OBSBasic::OnDeactivate() if (trayIcon) trayIcon->setIcon(QIcon::fromTheme( "obs-tray", QIcon(":/res/images/obs.png"))); - } else { - if (trayIcon) + } else if (trayIcon) { + if (os_atomic_load_bool(&recording_paused)) + trayIcon->setIcon(QIcon(":/res/images/obs_paused.png")); + else trayIcon->setIcon( QIcon(":/res/images/tray_active.png")); } @@ -5507,9 +5512,6 @@ void OBSBasic::RecordingStop(int code, QString last_error) #define RP_NO_HOTKEY_TITLE QTStr("Output.ReplayBuffer.NoHotkey.Title") #define RP_NO_HOTKEY_TEXT QTStr("Output.ReplayBuffer.NoHotkey.Msg") -extern volatile bool recording_paused; -extern volatile bool replaybuf_active; - void OBSBasic::ShowReplayBufferPauseWarning() { auto msgBox = []() {