From f40a10330672c3ac64076fbc30767edb633a1df6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 8 Sep 2000 15:12:49 +0000 Subject: [PATCH] fixed internal border drawing for listbox in GTK theme git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8302 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/univ/window.h | 12 ++++++------ src/univ/renderer.cpp | 13 +++++++++++++ src/univ/themes/gtk.cpp | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/include/wx/univ/window.h b/include/wx/univ/window.h index 22ec654856..18f3629cba 100644 --- a/include/wx/univ/window.h +++ b/include/wx/univ/window.h @@ -118,6 +118,12 @@ public: // operations virtual void SetCurrent(bool doit = TRUE); + // get the scrollbar (may be NULL) for the given orientation + wxScrollBar *GetScrollbar(int orient) const + { + return orient & wxVERTICAL ? m_scrollbarVert : m_scrollbarHorz; + } + // methods used by wxColourScheme to choose the colours for this window // -------------------------------------------------------------------- @@ -185,12 +191,6 @@ protected: // adjust the size of the window to take into account its borders wxSize AdjustSize(const wxSize& size) const; - // get the scrollbar (may be NULL) for the given orientation - wxScrollBar *GetScrollbar(int orient) const - { - return orient & wxVERTICAL ? m_scrollbarVert : m_scrollbarHorz; - } - // put the scrollbars along the edges of the window void PositionScrollbars(); diff --git a/src/univ/renderer.cpp b/src/univ/renderer.cpp index 07f2838434..22e998287b 100644 --- a/src/univ/renderer.cpp +++ b/src/univ/renderer.cpp @@ -324,6 +324,19 @@ void wxControlRenderer::DrawBorder() { int flags = m_window->GetStateFlags(); + // if the scrollbars are outside the border, we must adjust the rect to + // exclude them + if ( !m_renderer->AreScrollbarsInsideBorder() ) + { + wxScrollBar *scrollbar = m_window->GetScrollbar(wxVERTICAL); + if ( scrollbar ) + m_rect.width -= scrollbar->GetSize().x; + + scrollbar = m_window->GetScrollbar(wxHORIZONTAL); + if ( scrollbar ) + m_rect.height -= scrollbar->GetSize().y; + } + // draw outline m_renderer->DrawBorder(m_dc, m_window->GetBorder(), m_rect, flags, &m_rect); diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index f7254d57e0..e2a085f73c 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -621,7 +621,7 @@ void wxGTKRenderer::DrawBorder(wxDC& dc, { case wxBORDER_SUNKEN: DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); - DrawAntiShadedRect(dc, &rect, m_penBlack, m_penLightGrey); + DrawShadedRect(dc, &rect, m_penBlack, m_penLightGrey); break; case wxBORDER_STATIC: