FullscreenUI: Make ResetFocusHere() return a boolean

pull/3754/head
Stenzek 1 month ago
parent fa167cab85
commit b3e8543ba5
No known key found for this signature in database

@ -1839,15 +1839,15 @@ void FullscreenUI::CancelResetFocus()
s_state.focus_reset_queued = FocusResetType::None; s_state.focus_reset_queued = FocusResetType::None;
} }
void FullscreenUI::ResetFocusHere() bool FullscreenUI::ResetFocusHere()
{ {
if (s_state.focus_reset_queued == FocusResetType::None) if (s_state.focus_reset_queued == FocusResetType::None)
return; return false;
// don't take focus from dialogs // don't take focus from dialogs
ImGuiWindow* window = ImGui::GetCurrentWindow(); ImGuiWindow* window = ImGui::GetCurrentWindow();
if (ImGui::FindBlockingModal(window)) if (ImGui::FindBlockingModal(window))
return; return false;
// Set the flag that we drew an active/hovered item active for a frame, because otherwise there's one frame where // Set the flag that we drew an active/hovered item active for a frame, because otherwise there's one frame where
// there'll be no frame drawn, which will cancel the animation. Also set the appearing flag, so that the default // there'll be no frame drawn, which will cancel the animation. Also set the appearing flag, so that the default
@ -1876,6 +1876,7 @@ void FullscreenUI::ResetFocusHere()
s_state.focus_reset_queued = FocusResetType::None; s_state.focus_reset_queued = FocusResetType::None;
ResetMenuButtonFrame(); ResetMenuButtonFrame();
return true;
} }
bool FullscreenUI::IsFocusResetQueued() bool FullscreenUI::IsFocusResetQueued()

@ -342,7 +342,7 @@ enum class FocusResetType : u8
}; };
void QueueResetFocus(FocusResetType type); void QueueResetFocus(FocusResetType type);
void CancelResetFocus(); void CancelResetFocus();
void ResetFocusHere(); bool ResetFocusHere();
bool IsFocusResetQueued(); bool IsFocusResetQueued();
bool IsFocusResetFromWindowChange(); bool IsFocusResetFromWindowChange();
FocusResetType GetQueuedFocusResetType(); FocusResetType GetQueuedFocusResetType();

Loading…
Cancel
Save