mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-07 16:07:44 +02:00
Change the link color to the default color of wxHyperlinkCtrl
This commit is contained in:
parent
9a07826cd2
commit
b28533328f
@ -14,10 +14,11 @@
|
|||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#ifndef __WXGTK__
|
|
||||||
#include <wx/hyperlink.h>
|
#include <wx/hyperlink.h>
|
||||||
#else
|
|
||||||
|
#ifdef __WXGTK__
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -73,6 +74,16 @@ void AccessibleLinksFormatter::Populate(ShuttleGui& S) const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
// Non empty label is required, as wxHyperlinkCtrl would assert otherwise
|
||||||
|
std::unique_ptr<wxHyperlinkCtrl> tempHyperlink
|
||||||
|
= std::make_unique<wxHyperlinkCtrl>(S.GetParent(), wxID_ANY, wxT("temp"), wxString());
|
||||||
|
|
||||||
|
const wxColour hyperlinkColour = tempHyperlink->GetNormalColour();
|
||||||
|
|
||||||
|
tempHyperlink.reset();
|
||||||
|
#endif
|
||||||
|
|
||||||
wxString translated = mMessage.Translation();
|
wxString translated = mMessage.Translation();
|
||||||
|
|
||||||
std::vector<ProcessedArgument> processedArguments =
|
std::vector<ProcessedArgument> processedArguments =
|
||||||
@ -129,7 +140,9 @@ void AccessibleLinksFormatter::Populate(ShuttleGui& S) const
|
|||||||
wxStaticText* hyperlink = S.AddVariableText(argument->Value);
|
wxStaticText* hyperlink = S.AddVariableText(argument->Value);
|
||||||
|
|
||||||
hyperlink->SetFont(hyperlink->GetFont().Underlined());
|
hyperlink->SetFont(hyperlink->GetFont().Underlined());
|
||||||
|
hyperlink->SetForegroundColour(hyperlinkColour);
|
||||||
hyperlink->SetCursor(wxCURSOR_HAND);
|
hyperlink->SetCursor(wxCURSOR_HAND);
|
||||||
|
|
||||||
hyperlink->Bind(wxEVT_LEFT_UP, [handler = argument->Handler, url = argument->TargetURL](wxEvent&) {
|
hyperlink->Bind(wxEVT_LEFT_UP, [handler = argument->Handler, url = argument->TargetURL](wxEvent&) {
|
||||||
if (handler)
|
if (handler)
|
||||||
handler();
|
handler();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user