From 92a4e4de68d3bcc812c01b853c1a8d0f6ddadab6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Jul 2004 11:20:44 +0000 Subject: [PATCH] don't set font unless necessary (patch 984853) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 9 ++++++--- src/generic/treectlg.cpp | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index b7143eaa85..00af514ac0 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1668,11 +1668,13 @@ wxListHeaderWindow::wxListHeaderWindow( wxWindow *win, wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes(); SetOwnForegroundColour( attr.colFg ); SetOwnBackgroundColour( attr.colBg ); - SetOwnFont( attr.font ); + if (!m_hasFont) + SetOwnFont( attr.font ); #else SetOwnForegroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); SetOwnBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - SetOwnFont( wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT )); + if (!m_hasFont) + SetOwnFont( wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT )); #endif } @@ -2214,7 +2216,8 @@ wxListMainWindow::wxListMainWindow( wxWindow *parent, wxVisualAttributes attr = wxGenericListCtrl::GetClassDefaultAttributes(); SetOwnForegroundColour( attr.colFg ); SetOwnBackgroundColour( attr.colBg ); - SetOwnFont( attr.font ); + if (!m_hasFont) + SetOwnFont( attr.font ); } wxListMainWindow::~wxListMainWindow() diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 4ca9560a5e..2883e57b14 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -793,7 +793,8 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent, wxVisualAttributes attr = GetDefaultAttributes(); SetOwnForegroundColour( attr.colFg ); SetOwnBackgroundColour( attr.colBg ); - SetOwnFont(attr.font); + if (!m_hasFont) + SetOwnFont(attr.font); // m_dottedPen = wxPen( "grey", 0, wxDOT ); too slow under XFree86 m_dottedPen = wxPen( wxT("grey"), 0, 0 ); -- 2.45.2