From ddb44248a69593e4b12e4fb08dee7aae217c8c9a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Sep 2009 16:43:30 +0000 Subject: [PATCH] Fixed wxDataViewCtrl::Set{Foreground,Background}Colour() to work under GTK too. Implement DoApplyWidgetStyle() in wxGTK version of wxDataViewCtrl to propagate the main window style to the GtkTreeView which is what the user mostly sees. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + include/wx/gtk/dataview.h | 2 ++ src/gtk/dataview.cpp | 15 +++++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index b7f057c3db..a4f77f279b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -413,6 +413,7 @@ All (GUI): - wxHTML: add support for table borders width (Laurent Humbertclaude). - Added wxMouseEventsManager. - Building OpenGL library is now enabled by default. +- Fixed wxDataViewCtrl::Set{Foreground,Background}Colour(). - Improve wxTreeCtrl::ScrollTo() in generic version (Raanan Barzel). - Added wxFont::[Make]{Bold,Italic,Smaller,Larger} and Scale[d]() methods. - Added wxDC::CopyAttributes() and use it in wxBufferedDC. diff --git a/include/wx/gtk/dataview.h b/include/wx/gtk/dataview.h index dacccb9f18..486da22cdc 100644 --- a/include/wx/gtk/dataview.h +++ b/include/wx/gtk/dataview.h @@ -447,6 +447,8 @@ protected: virtual void DoSetExpanderColumn(); virtual void DoSetIndent(); + virtual void DoApplyWidgetStyle(GtkRcStyle *style); + private: friend class wxDataViewCtrlDCImpl; friend class wxDataViewColumn; diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 15855368b1..7f03b9f813 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -4643,6 +4643,10 @@ void wxDataViewCtrl::GtkEnableSelectionEvents() G_CALLBACK (wxdataview_selection_changed_callback), this); } +// ---------------------------------------------------------------------------- +// visual attributes stuff +// ---------------------------------------------------------------------------- + // static wxVisualAttributes wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) @@ -4650,9 +4654,12 @@ wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) return GetDefaultAttributesFromGTKWidget(gtk_tree_view_new); } +void wxDataViewCtrl::DoApplyWidgetStyle(GtkRcStyle *style) +{ + wxDataViewCtrlBase::DoApplyWidgetStyle(style); + gtk_widget_modify_style(m_treeview, style); +} -#endif - // !wxUSE_GENERICDATAVIEWCTRL +#endif // !wxUSE_GENERICDATAVIEWCTRL -#endif - // wxUSE_DATAVIEWCTRL +#endif // wxUSE_DATAVIEWCTRL -- 2.45.2