summaryrefslogtreecommitdiff
path: root/vcl/aqua
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-07-01 22:07:20 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-07-01 22:07:20 +0000
commit3eb8199d98f2e9c694021dcec09d321525445e2f (patch)
treed1da2e66c8b4577fd0acf2c839ba686606eff4ea /vcl/aqua
parenta41f3ab89bb4f4a609dbb933690694edb31c05a4 (diff)
INTEGRATION: CWS aquavcl08 (1.13.4); FILE MERGED
2008/06/18 17:16:35 pl 1.13.4.3: #i90063# avoid clipping of focus rings on PushButton 2008/06/18 17:01:27 pl 1.13.4.2: #i90063# correct clipping of spinfield subedit 2008/06/03 17:40:59 pl 1.13.4.1: #i90291# do not invalidate the whole window all the time
Diffstat (limited to 'vcl/aqua')
-rw-r--r--vcl/aqua/source/gdi/salnativewidgets.cxx32
1 files changed, 28 insertions, 4 deletions
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 548277651cdd..f9edd3319c8a 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: salnativewidgets.cxx,v $
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
* This file is part of OpenOffice.org.
*
@@ -630,6 +630,10 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
aPushInfo.kind = kThemePushButtonNormal;
nPaintHeight = PB_Norm_Height;
+ // avoid clipping when focused
+ rc.origin.x += FOCUS_RING_WIDTH/2;
+ rc.size.width -= FOCUS_RING_WIDTH;
+
if( (nState & CTRL_STATE_DEFAULT) != 0 )
{
AquaBlinker::Blink( mpFrame, buttonRect );
@@ -1111,6 +1115,26 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
}
CGContextRestoreGState( mrContext );
+
+ /* #i90291# in most cases invalidating the whole control region instead
+ of just the unclipped part of it is sufficient (and probably faster).
+ However for the window background we should not unnecessarily enlarge
+ the really changed rectangle since the difference is usually quite high
+ (the background is always drawn as a whole since we don't know anything
+ about its possible contents)
+ */
+ if( nType == CTRL_WINDOW_BACKGROUND )
+ {
+ CGRect aRect = { { 0, 0 }, { 0, 0 } };
+ if( mxClipRectsPath )
+ aRect = CGPathGetBoundingBox( mxClipRectsPath );
+ else if( mxClipPolysPath )
+ aRect = CGPathGetBoundingBox( mxClipPolysPath );
+ if( aRect.size.width != 0 && aRect.size.height != 0 )
+ buttonRect.Intersection( Rectangle( Point( aRect.origin.x, aRect.origin.y ),
+ Size( aRect.size.width, aRect.size.height ) ) );
+ }
+
RefreshRect( buttonRect.Left(), buttonRect.Top(), buttonRect.GetWidth(), buttonRect.GetHeight() );
return bOK;
@@ -1319,10 +1343,10 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
else if( nPart == PART_SUB_EDIT ) {
w = rControlRegion.GetBoundRect().GetWidth() - SPIN_BUTTON_SPACE - SPIN_BUTTON_WIDTH;
h = TEXT_EDIT_HEIGHT_NORMAL;
- x += 3; // add an offset for rounded borders
+ x += 4; // add an offset for rounded borders
y += 2; // don't draw into upper border
- w -= 3;
- h -= 4;
+ w -= 8; // offset for left and right rounded border
+ h -= 4; // don't draw into upper or ower border
rNativeContentRegion = Rectangle( Point( x + FOCUS_RING_WIDTH, y + FOCUS_RING_WIDTH ), Size( w - 2* FOCUS_RING_WIDTH, h ) );
rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) );