diff options
author | Kevin Walzer <kw@codebykevin.com> | 2015-02-15 18:29:14 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2015-02-15 18:29:14 (GMT) |
commit | 7fbf5fd0be1f6d626c18c964b1ac61449a106945 (patch) | |
tree | f025720e6096c29fa2e63a1c9ee6cdf9ef4811fd /macosx/ttkMacOSXTheme.c | |
parent | fe715ae6afd697b1cbf7fbee91e5d13d712373de (diff) | |
download | tk-7fbf5fd0be1f6d626c18c964b1ac61449a106945.zip tk-7fbf5fd0be1f6d626c18c964b1ac61449a106945.tar.gz tk-7fbf5fd0be1f6d626c18c964b1ac61449a106945.tar.bz2 |
Better alingment of notebook tabs in Cocoa; thanks to Marc Culler for patch
Diffstat (limited to 'macosx/ttkMacOSXTheme.c')
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 64b96cb..747254c 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -294,20 +294,13 @@ static Ttk_StateTable TabPositionTable[] = { * TP30000359-TPXREF116> */ -int TAB_HEIGHT = 0; -int TAB_OVERLAP = 0; static void TabElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - TAB_HEIGHT = 10; - TAB_OVERLAP = 10; - /*Different metrics on 10.10/Yosemite.*/ - if (MAC_OS_X_VERSION_MIN_REQUIRED > 100000) { - TAB_OVERLAP = 5; - } - *heightPtr = TAB_HEIGHT + TAB_OVERLAP - 1; + *heightPtr = kThemeMetricLargeTabHeight; + *paddingPtr = Ttk_MakePadding(0, 0, 0, 2); } @@ -326,7 +319,6 @@ static void TabElementDraw( .position = Ttk_StateTableLookup(TabPositionTable, state), }; - bounds.size.height += TAB_OVERLAP; BEGIN_DRAWING(d) ChkErr(HIThemeDrawTab, &bounds, &info, dc.context, HIOrientation, NULL); END_DRAWING @@ -364,8 +356,8 @@ static void PaneElementDraw( .adornment = kHIThemeTabPaneAdornmentNormal, }; - bounds.origin.y -= TAB_OVERLAP; - bounds.size.height += TAB_OVERLAP; + bounds.origin.y -= kThemeMetricTabFrameOverlap; + bounds.size.height += kThemeMetricTabFrameOverlap; BEGIN_DRAWING(d) ChkErr(HIThemeDrawTabPane, &bounds, &info, dc.context, HIOrientation); END_DRAWING |