From 6f585bfce6e7b04638f2518a12e538bc06b57af7 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 10 Oct 2024 02:34:18 -0500 Subject: [PATCH] GUI: release to open --- src/gui/tutorial.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/gui/tutorial.cpp b/src/gui/tutorial.cpp index e6dce3562..a15769a2b 100644 --- a/src/gui/tutorial.cpp +++ b/src/gui/tutorial.cpp @@ -32,19 +32,21 @@ #endif #ifndef IS_MOBILE -#define CLICK_TO_OPEN(t) ImGui::TextColored(uiColors[GUI_COLOR_ACCENT_PRIMARY],t);\ -if (ImGui::IsItemHovered()) {\ - ImGui::SetTooltip("click to open");\ - ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);\ -}\ -if (ImGui::IsItemClicked()) SDL_OpenURL(t); \ -ImGui::SameLine();\ -ImGui::Text(ICON_FA_CLIPBOARD);\ -if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort)) ImGui::SetTooltip("click to copy");\ -if (ImGui::IsItemClicked()) {\ - ImGui::SetClipboardText(t);\ - tutorial.popupTimer=0;\ -} +#define CLICK_TO_OPEN(t) ImGui::TextColored(uiColors[GUI_COLOR_ACCENT_PRIMARY],t); \ + if (ImGui::IsItemHovered()) { \ + ImGui::SetTooltip("click to open"); \ + ImGui::SetMouseCursor(ImGuiMouseCursor_Hand); \ + if (ImGui::IsMouseReleased(ImGuiMouseButton_Left)) { \ + SDL_OpenURL(t); \ + } \ + } \ + ImGui::SameLine(); \ + ImGui::Text(ICON_FA_CLIPBOARD); \ + if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort)) ImGui::SetTooltip("click to copy"); \ + if (ImGui::IsItemClicked()) { \ + ImGui::SetClipboardText(t); \ + tutorial.popupTimer=0; \ + } #else #define CLICK_TO_OPEN(t) ImGui::TextColored(uiColors[GUI_COLOR_ACCENT_PRIMARY],t); if (ImGui::IsItemClicked()) SDL_OpenURL(t); #endif