diff options
author | treectrl <treectrl> | 2005-11-18 22:47:49 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2005-11-18 22:47:49 (GMT) |
commit | f7721e1a276fa31e0f6443c3ba5c33607e9bc8f0 (patch) | |
tree | bf9416c505d6eed7f72f33bc2faf8f4d59a18dd5 /generic | |
parent | 135af9fa0bc1d74ae9c9b19e8c102fce1ecab02e (diff) | |
download | tktreectrl-f7721e1a276fa31e0f6443c3ba5c33607e9bc8f0.zip tktreectrl-f7721e1a276fa31e0f6443c3ba5c33607e9bc8f0.tar.gz tktreectrl-f7721e1a276fa31e0f6443c3ba5c33607e9bc8f0.tar.bz2 |
Improve appearance of list header under OSX/Aqua. [Patch 1356447]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkTreeTheme.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/generic/tkTreeTheme.c b/generic/tkTreeTheme.c index 3056e22..6c0b48e 100644 --- a/generic/tkTreeTheme.c +++ b/generic/tkTreeTheme.c @@ -5,7 +5,7 @@ * * Copyright (c) 2005 Tim Baker * - * RCS: @(#) $Id: tkTreeTheme.c,v 1.10 2005/07/07 03:17:14 treectrl Exp $ + * RCS: @(#) $Id: tkTreeTheme.c,v 1.11 2005/11/18 22:47:49 treectrl Exp $ */ #ifdef WIN32 @@ -687,6 +687,8 @@ int TreeTheme_Init(Tcl_Interp *interp) #include <Carbon/Carbon.h> #include "tkMacOSXInt.h" +static RgnHandle oldClip = NULL, boundsRgn = NULL; + int TreeTheme_DrawHeaderItem(TreeCtrl *tree, Drawable drawable, int state, int arrow, int x, int y, int width, int height) { @@ -718,12 +720,30 @@ int TreeTheme_DrawHeaderItem(TreeCtrl *tree, Drawable drawable, int state, SetGWorld(destPort, 0); TkMacOSXSetUpClippingRgn(drawable); + /* Save the old clipping region because we are going to modify it. */ + if (oldClip == NULL) + oldClip = NewRgn(); + GetClip(oldClip); + + /* Create a clipping region as big as the header. */ + if (boundsRgn == NULL) + boundsRgn = NewRgn(); + RectRgn(boundsRgn, &bounds); + + /* Set the clipping region to the intersection of the two regions. */ + SectRgn(oldClip, boundsRgn, boundsRgn); + SetClip(boundsRgn); + + /* Draw the left edge outside of the clipping region. */ + bounds.left -= 1; + (void) DrawThemeButton(&bounds, kThemeListHeaderButton, &info, NULL, /*prevInfo*/ NULL, /*eraseProc*/ NULL, /*labelProc*/ NULL); /*userData*/ - + + SetClip(oldClip); SetGWorld(saveWorld,saveDevice); return TCL_OK; |