Add GTKDoApplyWidgetStyle() helper

This allows to call the protected wxWindowGTK::DoApplyWidgetStyle()
method when it's really necessary, e.g. when forwarding to it from
DoApplyWidgetStyle() implementation for another window.
This commit is contained in:
Vadim Zeitlin
2017-12-19 22:07:15 +01:00
parent aa47c15abd
commit 29bd25b757

View File

@@ -206,6 +206,15 @@ public:
virtual void GTKHandleRealized(); virtual void GTKHandleRealized();
void GTKHandleUnrealize(); void GTKHandleUnrealize();
// Apply the widget style to the given window. Should normally only be
// called from the overridden DoApplyWidgetStyle() implementation in
// another window and exists solely to provide access to protected
// DoApplyWidgetStyle() when it's really needed.
static void GTKDoApplyWidgetStyle(wxWindowGTK* win, GtkRcStyle *style)
{
win->DoApplyWidgetStyle(style);
}
protected: protected:
// for controls composed of multiple GTK widgets, return true to eliminate // for controls composed of multiple GTK widgets, return true to eliminate
// spurious focus events if the focus changes between GTK+ children within // spurious focus events if the focus changes between GTK+ children within
@@ -426,8 +435,11 @@ protected:
void GTKApplyWidgetStyle(bool forceStyle = false); void GTKApplyWidgetStyle(bool forceStyle = false);
// helper function to ease native widgets wrapping, called by // Helper function to ease native widgets wrapping, called by
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle // GTKApplyWidgetStyle() and supposed to be overridden, not called.
//
// And if you actually need to call it, e.g. to propagate style change to a
// composite control, use public static GTKDoApplyWidgetStyle().
virtual void DoApplyWidgetStyle(GtkRcStyle *style); virtual void DoApplyWidgetStyle(GtkRcStyle *style);
void GTKApplyStyle(GtkWidget* widget, GtkRcStyle* style); void GTKApplyStyle(GtkWidget* widget, GtkRcStyle* style);