X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1bf0be0bcb74c67c35556138b891fd907b1d59f..04b2b47a4e817fb32a78316b8b50efd0612509b9:/src/ribbon/art_aui.cpp diff --git a/src/ribbon/art_aui.cpp b/src/ribbon/art_aui.cpp index 37293f9078..a8fd9c2b34 100644 --- a/src/ribbon/art_aui.cpp +++ b/src/ribbon/art_aui.cpp @@ -642,6 +642,27 @@ wxSize wxRibbonAUIArtProvider::GetPanelClientSize( return size; } +wxRect wxRibbonAUIArtProvider::GetPanelExtButtonArea(wxDC& dc, + const wxRibbonPanel* wnd, + wxRect rect) +{ + wxRect true_rect(rect); + RemovePanelPadding(&true_rect); + + true_rect.x++; + true_rect.width -= 2; + true_rect.y++; + + dc.SetFont(m_panel_label_font); + wxSize label_size = dc.GetTextExtent(wnd->GetLabel()); + int label_height = label_size.GetHeight() + 5; + wxRect label_rect(true_rect); + label_rect.height = label_height - 1; + + rect = wxRect(label_rect.GetRight()-13, label_rect.GetBottom()-13, 13, 13); + return rect; +} + void wxRibbonAUIArtProvider::DrawPanelBackground( wxDC& dc, wxRibbonPanel* wnd, @@ -705,6 +726,19 @@ void wxRibbonAUIArtProvider::DrawPanelBackground( #endif dc.GradientFillLinear(gradient_rect, colour, gradient, wxSOUTH); } + + if(wnd->HasExtButton()) + { + if(wnd->IsExtButtonHovered()) + { + dc.SetPen(m_panel_hover_button_border_pen); + dc.SetBrush(m_panel_hover_button_background_brush); + dc.DrawRoundedRectangle(label_rect.GetRight() - 13, label_rect.GetBottom() - 13, 13, 13, 1.0); + dc.DrawBitmap(m_panel_extension_bitmap[1], label_rect.GetRight() - 10, label_rect.GetBottom() - 10, true); + } + else + dc.DrawBitmap(m_panel_extension_bitmap[0], label_rect.GetRight() - 10, label_rect.GetBottom() - 10, true); + } } void wxRibbonAUIArtProvider::DrawMinimisedPanel(