summaryrefslogtreecommitdiffstats
path: root/generic/tkPanedWindow.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-09-30 09:15:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-09-30 09:15:44 (GMT)
commitcf0b763ae6169a3440a7be0f9aa2b756955b6eb4 (patch)
tree2af4e7f9eab89ed7a6836d20e7b0dd64b02be000 /generic/tkPanedWindow.c
parent310e0cb8c6d028661e1b9b3cc7644386d0f6e25d (diff)
downloadtk-cf0b763ae6169a3440a7be0f9aa2b756955b6eb4.zip
tk-cf0b763ae6169a3440a7be0f9aa2b756955b6eb4.tar.gz
tk-cf0b763ae6169a3440a7be0f9aa2b756955b6eb4.tar.bz2
Bring panedwindow proxy behavior in line with TIP #437 description.
Diffstat (limited to 'generic/tkPanedWindow.c')
-rw-r--r--generic/tkPanedWindow.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 7919728..8699ac3 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -147,9 +147,10 @@ typedef struct PanedWindow {
GC gc; /* Graphics context for copying from
* off-screen pixmap onto screen. */
int proxyx, proxyy; /* Proxy x,y coordinates. */
- Tk_3DBorder proxyBackground;/* Background color used to draw proxy. */
+ Tk_3DBorder proxyBackground;/* Background color used to draw proxy. If NULL, use background. */
+ Tcl_Obj *proxyBorderWidthPtr; /* Tcl_Obj rep for proxyBorderWidth, if NULL then use borderWitdh */
int proxyBorderWidth; /* Borderwidth used to draw proxy. */
- int proxyRelief; /* Relief used to draw proxy. */
+ int proxyRelief; /* Relief used to draw proxy, if TK_RELIEF_NULL then use relief. */
Slave **slaves; /* Pointer to array of Slaves. */
int numSlaves; /* Number of slaves. */
int sizeofSlaves; /* Number of elements in the slaves array. */
@@ -302,14 +303,14 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient),
0, (ClientData) orientStrings, GEOMETRY},
{TK_OPTION_BORDER, "-proxybackground", "proxyBackground", "ProxyBackground",
- DEF_PANEDWINDOW_PROXYBACKGROUND, -1, Tk_Offset(PanedWindow, proxyBackground), 0,
+ 0, -1, Tk_Offset(PanedWindow, proxyBackground), TK_OPTION_NULL_OK,
(ClientData) DEF_PANEDWINDOW_BG_MONO},
{TK_OPTION_PIXELS, "-proxyborderwidth", "proxyBorderWidth", "ProxyBorderWidth",
- DEF_PANEDWINDOW_PROXYBORDERWIDTH, -1, Tk_Offset(PanedWindow, proxyBorderWidth),
- 0, 0, GEOMETRY},
+ 0, Tk_Offset(PanedWindow, proxyBorderWidthPtr), Tk_Offset(PanedWindow, proxyBorderWidth),
+ TK_OPTION_NULL_OK, 0, GEOMETRY},
{TK_OPTION_RELIEF, "-proxyrelief", "proxyRelief", "Relief",
- DEF_PANEDWINDOW_PROXYRELIEF, -1, Tk_Offset(PanedWindow, proxyRelief),
- 0, 0, 0},
+ 0, -1, Tk_Offset(PanedWindow, proxyRelief),
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
DEF_PANEDWINDOW_RELIEF, -1, Tk_Offset(PanedWindow, relief), 0, 0, 0},
{TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor",
@@ -2781,9 +2782,11 @@ DisplayProxyWindow(
* Redraw the widget's background and border.
*/
- Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->proxyBackground, 0, 0,
- Tk_Width(tkwin), Tk_Height(tkwin), pwPtr->proxyBorderWidth,
- pwPtr->proxyRelief);
+ Tk_Fill3DRectangle(tkwin, pixmap,
+ pwPtr->proxyBackground ? pwPtr->proxyBackground : pwPtr->background,
+ 0, 0, Tk_Width(tkwin), Tk_Height(tkwin),
+ pwPtr->proxyBorderWidthPtr ? pwPtr->proxyBorderWidth : pwPtr->borderWidth,
+ (pwPtr->proxyRelief != TK_RELIEF_NULL) ? pwPtr->proxyRelief : pwPtr->relief);
#ifndef TK_NO_DOUBLE_BUFFERING
/*