Improve wxAuiNotebook appearance when using some GTK themes.

Let wxAuiNotebook render the border itself, instead of doing it in dock art
class. This allows the notebook to do it correctly for the current theme.

Closes #14710.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-10-08 12:09:13 +00:00
parent 1bcef6701b
commit 9fa99f045e
6 changed files with 128 additions and 9 deletions

View File

@@ -31,6 +31,8 @@
#include "wx/renderer.h"
#include "wx/aui/auibook.h"
#include "wx/aui/framemanager.h"
#include "wx/aui/dockart.h"
#ifdef __WXMAC__
#include "wx/osx/private.h"
@@ -244,6 +246,18 @@ void wxAuiGenericTabArt::SetSizingInfo(const wxSize& tab_ctrl_size,
}
void wxAuiGenericTabArt::DrawBorder(wxDC& dc, wxWindow* wnd, const wxRect& rect)
{
int i, border_width = GetBorderWidth(wnd);
wxRect theRect(rect);
for (i = 0; i < border_width; ++i)
{
dc.DrawRectangle(theRect.x, theRect.y, theRect.width, theRect.height);
theRect.Deflate(1);
}
}
void wxAuiGenericTabArt::DrawBackground(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxRect& rect)
@@ -584,6 +598,18 @@ int wxAuiGenericTabArt::GetIndentSize()
return 5;
}
int wxAuiGenericTabArt::GetBorderWidth(wxWindow* wnd)
{
wxAuiManager* mgr = wxAuiManager::GetManager(wnd);
if (mgr)
{
wxAuiDockArt* art = mgr->GetArtProvider();
if (art)
return art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
}
return 1;
}
wxSize wxAuiGenericTabArt::GetTabSize(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxString& caption,
@@ -908,6 +934,18 @@ void wxAuiSimpleTabArt::SetActiveColour(const wxColour& colour)
m_selectedBkPen = wxPen(colour);
}
void wxAuiSimpleTabArt::DrawBorder(wxDC& dc, wxWindow* wnd, const wxRect& rect)
{
int i, border_width = GetBorderWidth(wnd);
wxRect theRect(rect);
for (i = 0; i < border_width; ++i)
{
dc.DrawRectangle(theRect.x, theRect.y, theRect.width, theRect.height);
theRect.Deflate(1);
}
}
void wxAuiSimpleTabArt::DrawBackground(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxRect& rect)
@@ -1087,6 +1125,18 @@ int wxAuiSimpleTabArt::GetIndentSize()
return 0;
}
int wxAuiSimpleTabArt::GetBorderWidth(wxWindow* wnd)
{
wxAuiManager* mgr = wxAuiManager::GetManager(wnd);
if (mgr)
{
wxAuiDockArt* art = mgr->GetArtProvider();
if (art)
return art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
}
return 1;
}
wxSize wxAuiSimpleTabArt::GetTabSize(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxString& caption,