]> git.saurik.com Git - wxWidgets.git/commitdiff
fix TLW borders width in mono theme
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 25 Sep 2006 11:24:42 +0000 (11:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 25 Sep 2006 11:24:42 +0000 (11:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/univ/stdrend.h
src/univ/stdrend.cpp
src/univ/themes/mono.cpp

index 9aad13670f31557cc4faa4852f06782e378218d0..f46b25792c846f827fda0581c0b5264524d8ae6f 100644 (file)
@@ -332,6 +332,14 @@ protected:
     // return the frame icon bitmap
     virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type) = 0;
 
+    // get the width of either normal or resizeable frame border depending on
+    // whether flags contains wxTOPLEVEL_RESIZEABLE bit
+    //
+    // notice that these methods only make sense with standard border drawing
+    // code which uses the borders of the same width on all sides, this is why
+    // they are only present here and not in wxRenderer itself
+    virtual int GetFrameBorderWidth(int flags) const;
+
 #if wxUSE_TEXTCTRL
     // return the width of the border around the text area in the text control
     virtual int GetTextBorderWidth(const wxTextCtrl *text) const;
index d29a4dc89b0e9cebf72a63bc9c793fa2649433e2..54c31778833b579a1254785416fc8167c40b30a0 100644 (file)
@@ -38,8 +38,6 @@
 // constants
 // ----------------------------------------------------------------------------
 
-static const int FRAME_BORDER_THICKNESS            = 3;
-static const int RESIZEABLE_FRAME_BORDER_THICKNESS = 4;
 static const int FRAME_TITLEBAR_HEIGHT             = 18;
 static const int FRAME_BUTTON_WIDTH                = 16;
 static const int FRAME_BUTTON_HEIGHT               = 14;
@@ -1415,6 +1413,11 @@ void wxStdRenderer::DrawFrameButton(wxDC& dc,
     dc.DrawBitmap(bmp, rectBmp.CentreIn(rectBtn).GetPosition(), true);
 }
 
+int wxStdRenderer::GetFrameBorderWidth(int flags) const
+{
+    return flags & wxTOPLEVEL_RESIZEABLE ? 4 : 3;
+}
+
 
 wxRect wxStdRenderer::GetFrameClientArea(const wxRect& rect, int flags) const
 {
@@ -1422,10 +1425,7 @@ wxRect wxStdRenderer::GetFrameClientArea(const wxRect& rect, int flags) const
 
     if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
     {
-        int border = flags & wxTOPLEVEL_RESIZEABLE
-                        ? RESIZEABLE_FRAME_BORDER_THICKNESS
-                        : FRAME_BORDER_THICKNESS;
-        r.Inflate(-border);
+        r.Inflate(-GetFrameBorderWidth(flags));
     }
 
     if ( flags & wxTOPLEVEL_TITLEBAR )
@@ -1444,11 +1444,7 @@ wxStdRenderer::GetFrameTotalSize(const wxSize& clientSize, int flags) const
 
     if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
     {
-        int border = flags & wxTOPLEVEL_RESIZEABLE
-                        ? RESIZEABLE_FRAME_BORDER_THICKNESS
-                        : FRAME_BORDER_THICKNESS;
-        s.x += 2*border;
-        s.y += 2*border;
+        s.IncBy(2*GetFrameBorderWidth(flags));
     }
 
     if ( flags & wxTOPLEVEL_TITLEBAR )
@@ -1463,11 +1459,7 @@ wxSize wxStdRenderer::GetFrameMinSize(int flags) const
 
     if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) )
     {
-        int border = (flags & wxTOPLEVEL_RESIZEABLE) ?
-                        RESIZEABLE_FRAME_BORDER_THICKNESS :
-                        FRAME_BORDER_THICKNESS;
-        s.x += 2*border;
-        s.y += 2*border;
+        s.IncBy(2*GetFrameBorderWidth(flags));
     }
 
     if ( flags & wxTOPLEVEL_TITLEBAR )
index a4ffd5f06dc280ef11146ea6cb271e1b3728aa9f..b2d51f8ff6e1a09992da50dc13115582c93798fb 100644 (file)
@@ -232,6 +232,7 @@ protected:
         { return GetIndicator(IndicatorType_Radio, flags); }
 
     virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type);
+    virtual int GetFrameBorderWidth(int flags) const;
 
 private:
     // the bitmaps returned by GetIndicator()
@@ -1030,6 +1031,11 @@ void wxMonoRenderer::DrawScrollbarShaft(wxDC& dc,
 // top level windows
 // ----------------------------------------------------------------------------
 
+int wxMonoRenderer::GetFrameBorderWidth(int WXUNUSED(flags)) const
+{
+    // all our borders are simple
+    return 1;
+}
 
 // ----------------------------------------------------------------------------
 // wxMonoArtProvider