diff options
author | culler <culler> | 2019-06-29 18:28:48 (GMT) |
---|---|---|
committer | culler <culler> | 2019-06-29 18:28:48 (GMT) |
commit | fc77051b61693815b705692a1a84b09bc138c782 (patch) | |
tree | fd1b65c865a4ac04455a5c4ac1b96b4ebf150668 /macosx | |
parent | ffd1fafe9e6704cfa4eedd0e469c7461176c00bc (diff) | |
download | tk-fc77051b61693815b705692a1a84b09bc138c782.zip tk-fc77051b61693815b705692a1a84b09bc138c782.tar.gz tk-fc77051b61693815b705692a1a84b09bc138c782.tar.bz2 |
Adjust minimum thumb size
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXScrlbr.c | 16 | ||||
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 3 |
2 files changed, 12 insertions, 7 deletions
diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 06fb2b7..c0fd704 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -25,7 +25,7 @@ * always easy to grab with the mouse). */ -#define MIN_SLIDER_LENGTH 8 +#define MIN_SLIDER_LENGTH 18 #define MIN_GAP 4 /* @@ -161,7 +161,14 @@ TkpCreateScrollbar( *-------------------------------------------------------------- */ -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +#if MAC_OS_X_VERSION_MAX_ALLOWED > 1080 + +/* + * This stand-alone drawing function is used on macOS 10.9 and newer because + * the HIToolbox does not draw the scrollbar thumb at the expected size on + * those systems. The thumb is drawn too large, causing a mouse click on the + * thumb to be interpreted as a mouse click in the trough. + */ static void drawMacScrollbar( TkScrollbar *scrollPtr, @@ -170,11 +177,8 @@ static void drawMacScrollbar( { MacDrawable *macWin = (MacDrawable *) Tk_WindowId(scrollPtr->tkwin); NSView *view = TkMacOSXDrawableView(macWin); - NSColorSpace *deviceRGB = [NSColorSpace deviceRGBColorSpace]; CGPathRef path; CGPoint inner[2], outer[2]; - NSColor *troughColor, *thumbColor; - CGFloat *rgba; CGRect troughBounds = msPtr->info.bounds, thumbBounds; troughBounds.origin.y = [view bounds].size.height - (troughBounds.origin.y + troughBounds.size.height); @@ -296,7 +300,7 @@ TkpDisplayScrollbar( HIThemeDrawTrack(&msPtr->info, 0, dc.context, kHIThemeOrientationNormal); } else { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +#if MAC_OS_X_VERSION_MAX_ALLOWED > 1080 /* * Switch back to NSView coordinates and draw a modern scrollbar. diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 7ea9448..2c2c266 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -2347,7 +2347,8 @@ static void ThumbElementSize( int orientation = TTK_ORIENT_HORIZONTAL; Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); - *minHeight = *minWidth = 8; + *minHeight = 18; + *minWidth = 8; } static void ThumbElementDraw( |