From 49e97b25325dc7a94075f9aa57f8ac277c8a66a1 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 19 Aug 2010 12:12:51 +0000 Subject: [PATCH] Better close button placement on tabs, especially for bottom tab alignment git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@65361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index f73fd1048d..d682723772 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -693,10 +693,15 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc, bmp = m_active_close_bmp; } + int offsetY = tab_y-1; + if (m_flags & wxAUI_NB_BOTTOM) + offsetY = 1; + wxRect rect(tab_x + tab_width - close_button_width - 1, - tab_y + (tab_height/2) - (bmp.GetHeight()/2), + offsetY + (tab_height/2) - (bmp.GetHeight()/2), close_button_width, tab_height); + IndentPressedBitmap(&rect, close_button_state); dc.DrawBitmap(bmp, rect.x, rect.y, true);