diff options
author | Kevin Walzer <kw@codebykevin.com> | 2018-10-18 11:41:26 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2018-10-18 11:41:26 (GMT) |
commit | 27b3337d4b5ea22889681562e41c2008f31eda87 (patch) | |
tree | 68b18ff771094000915a17c07de48f142a586570 | |
parent | 357905818935c2025461aae78e483ca3a5b51298 (diff) | |
download | tk-27b3337d4b5ea22889681562e41c2008f31eda87.zip tk-27b3337d4b5ea22889681562e41c2008f31eda87.tar.gz tk-27b3337d4b5ea22889681562e41c2008f31eda87.tar.bz2 |
Restore some missing changes stripped out in in merge of Mac scroll code
-rw-r--r-- | macosx/tkMacOSXScrlbr.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index f7f9489..00b0d84 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -279,15 +279,16 @@ TkpComputeScrollbarGeometry( * window, if any). Then arrange for the window to be redisplayed. */ - if (scrollPtr->vertical) { + if (scrollPtr->vertical) { Tk_GeometryRequest(scrollPtr->tkwin, scrollPtr->width + 2*scrollPtr->inset, 2*(scrollPtr->arrowLength + scrollPtr->borderWidth - + scrollPtr->inset)); + + scrollPtr->inset) + metrics.minThumbHeight); } else { Tk_GeometryRequest(scrollPtr->tkwin, 2*(scrollPtr->arrowLength + scrollPtr->borderWidth - + scrollPtr->inset), scrollPtr->width + 2*scrollPtr->inset); + + scrollPtr->inset) + metrics.minThumbHeight, + scrollPtr->width + 2*scrollPtr->inset); } Tk_SetInternalBorder(scrollPtr->tkwin, scrollPtr->inset); } @@ -376,30 +377,30 @@ TkpScrollbarPosition( int x, int y) /* Coordinates within scrollPtr's window. */ { - /* + /* * Using code from tkUnixScrlbr.c because Unix scroll bindings are * driving the display at the script level. All the Mac scrollbar * has to do is re-draw itself. */ - int length, fieldlength, width, tmp; + int length, width, tmp; register const int inset = scrollPtr->inset; - register const int arrowSize = scrollPtr->arrowLength + inset; + if (scrollPtr->vertical) { length = Tk_Height(scrollPtr->tkwin); - fieldlength = length - 2 * arrowSize; + width = Tk_Width(scrollPtr->tkwin); } else { tmp = x; x = y; y = tmp; length = Tk_Width(scrollPtr->tkwin); - fieldlength = length - 2 * arrowSize; + width = Tk_Height(scrollPtr->tkwin); } - fieldlength = fieldlength < 0 ? 0 : fieldlength; + if (x<inset || x>=width-inset || y<inset || y>=length-inset) { return OUTSIDE; @@ -410,19 +411,22 @@ TkpScrollbarPosition( * TkpDisplayScrollbar. Be sure to keep the two consistent. */ + if (y < inset + scrollPtr->arrowLength) { + return TOP_ARROW; + } if (y < scrollPtr->sliderFirst) { return TOP_GAP; } - if (y < scrollPtr->sliderLast) { + if (y < scrollPtr->sliderLast){ return SLIDER; } - if (y < fieldlength){ - return BOTTOM_GAP; - } - if (y < fieldlength + arrowSize) { - return TOP_ARROW; + if (y >= length - (scrollPtr->arrowLength + inset)) { + return BOTTOM_ARROW; } - return BOTTOM_ARROW; + + + + return BOTTOM_GAP; } |