X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..11e720751c4645c7e7fbe298640ac72a60fb8a2b:/src/unix/taskbarx11.cpp diff --git a/src/unix/taskbarx11.cpp b/src/unix/taskbarx11.cpp index 841786b04b..52d44d68a2 100644 --- a/src/unix/taskbarx11.cpp +++ b/src/unix/taskbarx11.cpp @@ -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())