diff --git a/src/ui/AccessibleLinksFormatter.cpp b/src/ui/AccessibleLinksFormatter.cpp index 65ca3b248..9274eed6e 100644 --- a/src/ui/AccessibleLinksFormatter.cpp +++ b/src/ui/AccessibleLinksFormatter.cpp @@ -15,8 +15,11 @@ #include #include +#ifndef __WXGTK__ #include - +#else +#include +#endif namespace { @@ -108,7 +111,7 @@ void AccessibleLinksFormatter::Populate(ShuttleGui& S) const } // Add hyperlink - +#ifndef __WXGTK__ wxHyperlinkCtrl* hyperlink = safenew wxHyperlinkCtrl( S.GetParent(), wxID_ANY, argument->Value.Translation(), argument->TargetURL); @@ -122,7 +125,18 @@ void AccessibleLinksFormatter::Populate(ShuttleGui& S) const } S.AddWindow(hyperlink, wxALIGN_TOP | wxALIGN_LEFT); +#else + wxStaticText* hyperlink = S.AddVariableText(argument->Value); + hyperlink->SetFont(hyperlink->GetFont().Underlined()); + hyperlink->SetCursor(wxCURSOR_HAND); + hyperlink->Bind(wxEVT_LEFT_UP, [handler = argument->Handler, url = argument->TargetURL](wxEvent&) { + if (handler) + handler(); + else if (!url.empty()) + wxLaunchDefaultBrowser(url); + }); +#endif // Update the currentPostion to the first symbol after the // Placeholder