]> git.saurik.com Git - wxWidgets.git/commitdiff
Better close button placement on tabs, especially for bottom tab alignment
authorJulian Smart <julian@anthemion.co.uk>
Thu, 19 Aug 2010 12:12:59 +0000 (12:12 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 19 Aug 2010 12:12:59 +0000 (12:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65362 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/auibook.cpp

index 9796ad4c732be9b0d049e56fdf07ce8467488050..1c38e29e9909b2714038e3aa2acbcbc9022d354e 100644 (file)
@@ -590,10 +590,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);