Merge setting link colours for wxGTK3 wxHyperlinkCtrl

Closes https://github.com/wxWidgets/wxWidgets/pull/249
This commit is contained in:
Vadim Zeitlin
2016-03-07 16:17:11 +01:00
5 changed files with 124 additions and 6 deletions

View File

@@ -13,6 +13,12 @@
#include "wx/generic/hyperlink.h"
#include "wx/scopedptr.h"
#ifdef __WXGTK3__
class wxHyperlinkCtrlColData;
#endif
// ----------------------------------------------------------------------------
// wxHyperlinkCtrl
// ----------------------------------------------------------------------------
@@ -72,6 +78,19 @@ protected:
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const wxOVERRIDE;
private:
enum LinkKind
{
Link_Normal,
Link_Visited
};
void DoSetLinkColour(LinkKind linkKind, const wxColour& colour);
#ifdef __WXGTK3__
wxScopedPtr<wxHyperlinkCtrlColData> m_colData;
#endif
wxDECLARE_DYNAMIC_CLASS(wxHyperlinkCtrl);
};

View File

@@ -14,6 +14,7 @@
#ifdef __WXGTK3__
typedef struct _cairo cairo_t;
typedef struct _GtkStyleProvider GtkStyleProvider;
typedef struct _GtkCssProvider GtkCssProvider;
#define WXUNUSED_IN_GTK2(x) x
#define WXUNUSED_IN_GTK3(x)
#else
@@ -409,7 +410,11 @@ protected:
// Copies m_children tab order to GTK focus chain:
void RealizeTabOrder();
#ifndef __WXGTK3__
#ifdef __WXGTK3__
// Use the given CSS string for styling the widget. The provider must be
// allocated, and remains owned, by the caller.
void ApplyCssStyle(GtkCssProvider* provider, const char* style);
#else // GTK+ < 3
// Called by ApplyWidgetStyle (which is called by SetFont() and
// SetXXXColour etc to apply style changed to native widgets) to create
// modified GTK style with non-standard attributes.