X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb29dcac01af849053d8f85b69aae7e7ca8c7d26..9941ff2d65e13d3de3e0e4d452118df34a168455:/src/unix/taskbarx11.cpp diff --git a/src/unix/taskbarx11.cpp b/src/unix/taskbarx11.cpp index 1d01758c9f..52d44d68a2 100644 --- a/src/unix/taskbarx11.cpp +++ b/src/unix/taskbarx11.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "taskbarx11.h" #endif @@ -34,6 +34,7 @@ #include "wx/frame.h" #include "wx/bitmap.h" #include "wx/statbmp.h" +#include "wx/sizer.h" #ifdef __VMS #pragma message disable nosimpint @@ -188,6 +189,15 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) wxBitmap bmp; bmp.CopyFromIcon(icon); wxTaskBarIconArea *area = new wxTaskBarIconArea(this, m_iconWnd, bmp); + + // make a sizer to keep the icon centered, in case it is smaller than the + // alotted space. + wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); + sizer->Add(0,0,1); + sizer->Add(area, 0, wxALIGN_CENTER); + sizer->Add(0,0,1); + m_iconWnd->SetSizer(sizer); + m_iconWnd->SetClientSize(area->GetSize()); #if wxUSE_TOOLTIPS if (!tooltip.empty())