Space was reserved for the borders even when it wasn't filled, resulting in
visual artefacts. Fix this by virtualizing the function returning the
additional space needed for the borders and only overriding it to return non
zero in wxAuiGtkTabArt.
Closes #14710.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72720
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual int GetBorderWidth(
wxWindow* wnd) = 0;
virtual int GetBorderWidth(
wxWindow* wnd) = 0;
+ virtual int GetAdditionalBorderSpace(
+ wxWindow* wnd) = 0;
+
virtual int GetBestTabCtrlSize(
wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
virtual int GetBestTabCtrlSize(
wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
int GetBorderWidth(
wxWindow* wnd);
int GetBorderWidth(
wxWindow* wnd);
+ int GetAdditionalBorderSpace(
+ wxWindow* wnd);
+
wxSize GetTabSize(
wxDC& dc,
wxWindow* wnd,
wxSize GetTabSize(
wxDC& dc,
wxWindow* wnd,
int GetBorderWidth(
wxWindow* wnd);
int GetBorderWidth(
wxWindow* wnd);
+ int GetAdditionalBorderSpace(
+ wxWindow* wnd);
+
wxSize GetTabSize(
wxDC& dc,
wxWindow* wnd,
wxSize GetTabSize(
wxDC& dc,
wxWindow* wnd,
int GetBestTabCtrlSize(wxWindow* wnd, const wxAuiNotebookPageArray& pages,
const wxSize& required_bmp_size);
int GetBorderWidth(wxWindow* wnd);
int GetBestTabCtrlSize(wxWindow* wnd, const wxAuiNotebookPageArray& pages,
const wxSize& required_bmp_size);
int GetBorderWidth(wxWindow* wnd);
+ int GetAdditionalBorderSpace(wxWindow* wnd);
virtual wxSize GetTabSize(wxDC& dc, wxWindow* wnd, const wxString& caption,
const wxBitmap& bitmap, bool active,
int close_button_state, int* x_extent);
virtual wxSize GetTabSize(wxDC& dc, wxWindow* wnd, const wxString& caption,
const wxBitmap& bitmap, bool active,
int close_button_state, int* x_extent);
for (i = 0; i < page_count; ++i)
{
wxAuiNotebookPage& page = pages.Item(i);
for (i = 0; i < page_count; ++i)
{
wxAuiNotebookPage& page = pages.Item(i);
- int border_width = m_tabs->GetArtProvider()->GetBorderWidth(page.window);
+ int border_space = m_tabs->GetArtProvider()->GetAdditionalBorderSpace(page.window);
- int height = m_rect.height - m_tabCtrlHeight - border_width;
+ int height = m_rect.height - m_tabCtrlHeight - border_space;
if ( height < 0 )
{
// avoid passing negative height to wxWindow::SetSize(), this
if ( height < 0 )
{
// avoid passing negative height to wxWindow::SetSize(), this
if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM)
{
if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM)
{
- page.window->SetSize(m_rect.x + 2 * border_width,
- m_rect.y + 2 * border_width,
- m_rect.width - 4 * border_width,
+ page.window->SetSize(m_rect.x + border_space,
+ m_rect.y + border_space,
+ m_rect.width - 2 * border_space,
height);
}
else //TODO: if (GetFlags() & wxAUI_NB_TOP)
{
height);
}
else //TODO: if (GetFlags() & wxAUI_NB_TOP)
{
- page.window->SetSize(m_rect.x + 2 * border_width,
+ page.window->SetSize(m_rect.x + border_space,
m_rect.y + m_tabCtrlHeight,
m_rect.y + m_tabCtrlHeight,
- m_rect.width - 4 * border_width,
+ m_rect.width - 2 * border_space,
height);
}
// TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
height);
}
// TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
+int wxAuiGenericTabArt::GetAdditionalBorderSpace(wxWindow* WXUNUSED(wnd))
+{
+ return 0;
+}
+
wxSize wxAuiGenericTabArt::GetTabSize(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxString& caption,
wxSize wxAuiGenericTabArt::GetTabSize(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxString& caption,
+int wxAuiSimpleTabArt::GetAdditionalBorderSpace(wxWindow* WXUNUSED(wnd))
+{
+ return 0;
+}
+
wxSize wxAuiSimpleTabArt::GetTabSize(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxString& caption,
wxSize wxAuiSimpleTabArt::GetTabSize(wxDC& dc,
wxWindow* WXUNUSED(wnd),
const wxString& caption,
GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder);
}
GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder);
}
+int wxAuiGtkTabArt::GetAdditionalBorderSpace(wxWindow* wnd)
+{
+ return 2 * GetBorderWidth(wnd);
+}
+
wxSize wxAuiGtkTabArt::GetTabSize(wxDC& dc,
wxWindow* wnd,
const wxString& caption,
wxSize wxAuiGtkTabArt::GetTabSize(wxDC& dc,
wxWindow* wnd,
const wxString& caption,