X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cbe13a1f09becec432dc9c4a519a767bca348ed4..76ea1664980282b58c01a5c3a833839a6c0d1bf9:/src/unix/taskbarx11.cpp diff --git a/src/unix/taskbarx11.cpp b/src/unix/taskbarx11.cpp index e5081d684c..52d44d68a2 100644 --- a/src/unix/taskbarx11.cpp +++ b/src/unix/taskbarx11.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(__APPLE__) +#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())