X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd267523d0f95c9b954b8f6d09bc5a96e7fc0db7..0286d08d1453506f9ff9a830d58b3b35817d0b14:/src/univ/themes/gtk.cpp diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index 5715566f5b..0246f9d12a 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -24,10 +24,15 @@ #pragma hdrstop #endif +#include "wx/univ/theme.h" + +#if wxUSE_THEME_GTK + #ifndef WX_PRECOMP #include "wx/intl.h" #include "wx/log.h" #include "wx/dcmemory.h" + #include "wx/dcclient.h" #include "wx/window.h" #include "wx/menu.h" @@ -60,9 +65,8 @@ #include "wx/univ/inpcons.h" #include "wx/univ/inphand.h" #include "wx/univ/colschem.h" -#include "wx/univ/theme.h" -class WXDLLEXPORT wxGTKMenuGeometryInfo; +class wxGTKMenuGeometryInfo; // ---------------------------------------------------------------------------- // constants @@ -81,7 +85,7 @@ public: wxGTKRenderer(const wxColourScheme *scheme); // wxRenderer methods - virtual void DrawFocusRect(wxDC& dc, const wxRect& rect); + virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0); virtual void DrawTextBorder(wxDC& dc, wxBorder border, const wxRect& rect, @@ -194,12 +198,9 @@ public: virtual void AdjustSize(wxSize *size, const wxWindow *window); // geometry and hit testing +#if wxUSE_SCROLLBAR virtual wxSize GetScrollbarArrowSize() const { return m_sizeScrollbarArrow; } -#if wxUSE_SCROLLBAR - virtual wxRect GetScrollbarRect(const wxScrollBar *scrollbar, - wxScrollBar::Element elem, - int thumbPos = -1) const; #endif // wxUSE_SCROLLBAR virtual wxSize GetCheckBitmapSize() const @@ -311,26 +312,6 @@ protected: // draw inner GTK shadow void DrawInnerShadedRect(wxDC& dc, wxRect *rect); -#if wxUSE_SCROLLBAR - // returns the size of the arrow for the scrollbar (depends on - // orientation) - wxSize GetScrollbarArrowSize(const wxScrollBar *scrollbar) const - { - wxSize size; - if ( scrollbar->IsVertical() ) - { - size = m_sizeScrollbarArrow; - } - else - { - size.x = m_sizeScrollbarArrow.y; - size.y = m_sizeScrollbarArrow.x; - } - - return size; - } -#endif // wxUSE_SCROLLBAR - // get the line wrap indicator bitmap wxBitmap GetLineWrapBitmap() const; @@ -368,8 +349,6 @@ protected: } private: - const wxColourScheme *m_scheme; - // data wxSize m_sizeScrollbarArrow; @@ -563,7 +542,7 @@ wxGTKTheme::~wxGTKTheme() { delete m_renderer; delete m_scheme; - wxArtProvider::RemoveProvider(m_artProvider); + delete m_artProvider; } wxRenderer *wxGTKTheme::GetRenderer() @@ -701,6 +680,7 @@ wxColour wxGTKColourScheme::Get(wxGTKColourScheme::StdColour col) const { switch ( col ) { + case FRAME: case WINDOW: return *wxWHITE; case SHADOW_DARK: return *wxBLACK; @@ -833,7 +813,8 @@ void wxGTKRenderer::DrawSunkenBorder(wxDC& dc, wxRect *rect) DrawShadedRect(dc, rect, m_penBlack, m_penLightGrey); } -void wxGTKRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect) +void +wxGTKRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect, int WXUNUSED(flags)) { dc.SetBrush(*wxTRANSPARENT_BRUSH); wxRect rectFocus = rect; @@ -944,7 +925,7 @@ void wxGTKRenderer::DrawFrameWithLabel(wxDC& dc, } // ---------------------------------------------------------------------------- -// check/radion buttons +// check/radio buttons // ---------------------------------------------------------------------------- void wxGTKRenderer::DrawCheckItemBitmap(wxDC& dc, @@ -1592,7 +1573,7 @@ void wxGTKRenderer::DrawSliderThumb(wxDC& dc, // ---------------------------------------------------------------------------- // wxGTKMenuGeometryInfo: the wxMenuGeometryInfo used by wxGTKRenderer -class WXDLLEXPORT wxGTKMenuGeometryInfo : public wxMenuGeometryInfo +class wxGTKMenuGeometryInfo : public wxMenuGeometryInfo { public: virtual wxSize GetSize() const { return m_size; } @@ -2247,24 +2228,6 @@ void wxGTKRenderer::DrawScrollbarShaft(wxDC& dc, DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), rectBar); } -#if wxUSE_SCROLLBAR -wxRect wxGTKRenderer::GetScrollbarRect(const wxScrollBar *scrollbar, - wxScrollBar::Element elem, - int thumbPos) const -{ - // as GTK scrollbars can't be disabled, it makes no sense to remove the - // thumb for a scrollbar with range 0 - instead, make it fill the entire - // scrollbar shaft - if ( (elem == wxScrollBar::Element_Thumb) && !scrollbar->GetRange() ) - { - elem = wxScrollBar::Element_Bar_2; - } - - return wxStdRenderer::GetScrollbarRect(scrollbar, elem, thumbPos); -} - -#endif // wxUSE_SCROLLBAR - // ---------------------------------------------------------------------------- // size adjustments // ---------------------------------------------------------------------------- @@ -2773,3 +2736,5 @@ bool wxGTKTextCtrlInputHandler::HandleKey(wxInputConsumer *control, } #endif // wxUSE_TEXTCTRL + +#endif // wxUSE_THEME_GTK