fix TLW borders width in mono theme
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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;
|
||||
|
@@ -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 )
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user