X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c3ead1d1513a5eb79091a604f4e42b45d1bdf5d..a70d268a1b43dc8ef2025b2beaeb5a595ba173fc:/src/ribbon/art_aui.cpp diff --git a/src/ribbon/art_aui.cpp b/src/ribbon/art_aui.cpp index bd97d9f211..2c7d56de42 100644 --- a/src/ribbon/art_aui.cpp +++ b/src/ribbon/art_aui.cpp @@ -15,10 +15,9 @@ #pragma hdrstop #endif -#include "wx/ribbon/art.h" - #if wxUSE_RIBBON +#include "wx/ribbon/art.h" #include "wx/ribbon/art_internal.h" #include "wx/ribbon/bar.h" #include "wx/ribbon/buttonbar.h" @@ -26,10 +25,14 @@ #include "wx/ribbon/toolbar.h" #ifndef WX_PRECOMP +#include "wx/dc.h" +#include "wx/settings.h" #endif #ifdef __WXMSW__ #include "wx/msw/private.h" +#elif defined(__WXMAC__) +#include "wx/osx/private.h" #endif wxRibbonAUIArtProvider::wxRibbonAUIArtProvider() @@ -384,9 +387,12 @@ void wxRibbonAUIArtProvider::DrawTab(wxDC& dc, icon = tab.page->GetIcon(); if((m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS) == 0) { + if(icon.IsOk()) + { int x = tab.rect.x + (tab.rect.width - icon.GetWidth()) / 2; dc.DrawBitmap(icon, x, tab.rect.y + 1 + (tab.rect.height - 1 - icon.GetHeight()) / 2, true); + } } } if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS) @@ -631,6 +637,8 @@ wxSize wxRibbonAUIArtProvider::GetPanelClientSize( if(client_offset) *client_offset = wxPoint(3, label_height + 2); } + if (size.x < 0) size.x = 0; + if (size.y < 0) size.y = 0; return size; } @@ -856,7 +864,7 @@ void wxRibbonAUIArtProvider::DrawGalleryBackground( dc.SetPen(m_gallery_border_pen); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); - + DrawGalleryBackgroundCommon(dc, wnd, rect); } @@ -1114,7 +1122,7 @@ void wxRibbonAUIArtProvider::DrawTool( avail_width -= 8; if(is_split_hybrid) { - dc.DrawLine(rect.x + avail_width + 1, rect.y, + dc.DrawLine(rect.x + avail_width + 1, rect.y, rect.x + avail_width + 1, rect.y + rect.height); } dc.DrawBitmap(m_toolbar_drop_bitmap, bg_rect.x + avail_width + 2,