From d551c156c4fde105d241d85ed67e0e6528963fca Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 21 Apr 2020 08:35:07 -0700 Subject: [PATCH] Remove some duplicate code for getting hyperlink color --- src/gtk/hyperlink.cpp | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/gtk/hyperlink.cpp b/src/gtk/hyperlink.cpp index 5a11df73e9..e0379bc976 100644 --- a/src/gtk/hyperlink.cpp +++ b/src/gtk/hyperlink.cpp @@ -27,6 +27,7 @@ #include "wx/hyperlink.h" #ifndef WX_PRECOMP + #include "wx/settings.h" #endif #include "wx/gtk/private.h" @@ -220,28 +221,9 @@ void wxHyperlinkCtrl::SetNormalColour(const wxColour &colour) wxColour wxHyperlinkCtrl::GetNormalColour() const { - wxColour ret; - if ( UseNative() ) - { - GdkColor* link_color; - GdkColor color = { 0, 0, 0, 0xeeee }; - - GtkWidget* widget = gtk_bin_get_child(GTK_BIN(m_widget)); - wxGCC_WARNING_SUPPRESS(deprecated-declarations) - gtk_widget_ensure_style(widget); - gtk_widget_style_get(widget, "link-color", &link_color, NULL); - if (link_color) - { - color = *link_color; - gdk_color_free(link_color); - } - wxGCC_WARNING_RESTORE() - ret = wxColour(color); - } - else - ret = wxGenericHyperlinkCtrl::GetNormalColour(); - - return ret; + return UseNative() + ? wxSystemSettings::GetColour(wxSYS_COLOUR_HOTLIGHT) + : wxGenericHyperlinkCtrl::GetNormalColour(); } void wxHyperlinkCtrl::SetVisitedColour(const wxColour &colour)