X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5482ee0766d86c79f82733780d5d4833070bf064..ce7208d49d5ce2ca1dc0b3b83f14f1d04f29c4bf:/src/msw/notebook.cpp?ds=sidebyside diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 6f9d82c34c..bfc98f9e01 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -799,7 +799,9 @@ bool wxNotebook::InsertPage(size_t nPage, // so the first panel gets the correct themed background if ( m_pages.empty() ) { +#if wxUSE_UXTHEME UpdateBgBrush(); +#endif // wxUSE_UXTHEME } // succeeded: save the pointer to the page @@ -909,6 +911,9 @@ void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event)) wxBitmap bmp(rc.right, rc.bottom); memdc.SelectObject(bmp); + const wxLayoutDirection dir = dc.GetLayoutDirection(); + memdc.SetLayoutDirection(dir); + // if there is no special brush just use the solid background colour #if wxUSE_UXTHEME HBRUSH hbr = (HBRUSH)m_hbrBackground; @@ -926,7 +931,10 @@ void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event)) MSWDefWindowProc(WM_PAINT, (WPARAM)memdc.GetHDC(), 0); - dc.Blit(0, 0, rc.right, rc.bottom, &memdc, 0, 0); + // For some reason in RTL mode, source offset has to be -1, otherwise the + // right border (physical) remains unpainted. + const wxCoord ofs = dir == wxLayout_RightToLeft ? -1 : 0; + dc.Blit(ofs, 0, rc.right, rc.bottom, &memdc, ofs, 0); } #endif // USE_NOTEBOOK_ANTIFLICKER