diff --git a/src/slic3r/GUI/Widgets/Label.cpp b/src/slic3r/GUI/Widgets/Label.cpp index 4a541f3478..23279ff956 100644 --- a/src/slic3r/GUI/Widgets/Label.cpp +++ b/src/slic3r/GUI/Widgets/Label.cpp @@ -95,16 +95,19 @@ Label::Label(wxWindow *parent, wxFont const &font, wxString const &text, long st this->font = font; SetFont(font); SetBackgroundColour(StaticBox::GetParentBackgroundColor(parent)); - Bind(wxEVT_ENTER_WINDOW, [this](auto &e) { - if (GetWindowStyle() & LB_HYPERLINK) { - SetFont(this->font.Underlined()); - Refresh(); - } - }); - Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { - SetFont(this->font); - Refresh(); - }); +} + +void Label::SetLabel(const wxString& label) +{ + if (GetLabel() == label) + return; + wxStaticText::SetLabel(label); +#ifdef __WXOSX__ + if ((GetWindowStyle() & LB_HYPERLINK)) { + SetLabelMarkup(label); + return; + } +#endif } void Label::SetWindowStyleFlag(long style) @@ -115,10 +118,21 @@ void Label::SetWindowStyleFlag(long style) if (style & LB_HYPERLINK) { this->color = GetForegroundColour(); static wxColor clr_url("#00AE42"); + SetFont(this->font.Underlined()); SetForegroundColour(clr_url); + SetCursor(wxCURSOR_HAND); +#ifdef __WXOSX__ + SetLabelMarkup(GetLabel()); +#endif } else { SetForegroundColour(this->color); SetFont(this->font); + SetCursor(wxCURSOR_ARROW); +#ifdef __WXOSX__ + auto label = GetLabel(); + wxStaticText::SetLabel({}); + wxStaticText::SetLabel(label); +#endif } Refresh(); } diff --git a/src/slic3r/GUI/Widgets/Label.hpp b/src/slic3r/GUI/Widgets/Label.hpp index 1d3d387fb7..65f10d009a 100644 --- a/src/slic3r/GUI/Widgets/Label.hpp +++ b/src/slic3r/GUI/Widgets/Label.hpp @@ -13,6 +13,8 @@ public: Label(wxWindow *parent, wxFont const &font, wxString const &text = {}, long style = 0); + void SetLabel(const wxString& label) override; + void SetWindowStyleFlag(long style) override; private: