From: Vadim Zeitlin Date: Sun, 8 Oct 2006 01:19:31 +0000 (+0000) Subject: use the main frame icon if no icon is explicitely specified X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/cfa643708102b8f50f6251eea0623c57b2de86d3?ds=sidebyside use the main frame icon if no icon is explicitely specified git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index c915bba45d..2bd702fe67 100644 --- a/src/generic/aboutdlgg.cpp +++ b/src/generic/aboutdlgg.cpp @@ -81,8 +81,20 @@ bool wxAboutDialog::Create(const wxAboutDialogInfo& info) wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL); #if wxUSE_STATBMP - if ( info.HasIcon() ) - sizerIconAndText->Add(new wxStaticBitmap(this, wxID_ANY, info.GetIcon())); + wxIcon icon = info.GetIcon(); + if ( !icon.Ok() && wxTheApp ) + { + const wxTopLevelWindow * const + tlw = wxDynamicCast(wxTheApp->GetTopWindow(), wxTopLevelWindow); + if ( tlw ) + icon = tlw->GetIcon(); + } + + if ( icon.Ok() ) + { + sizerIconAndText->Add(new wxStaticBitmap(this, wxID_ANY, icon), + wxSizerFlags().Border(wxRIGHT)); + } #endif // wxUSE_STATBMP sizerIconAndText->Add(m_sizerText, wxSizerFlags(1).Expand());