summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-02-15 18:30:17 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-02-15 18:30:17 (GMT)
commit760c682c426b6ad44b6812ce3521c76be97f6afe (patch)
tree56b5b40803d79bc706f2b359208de34e2821de7f
parent1513b4ab07a88891ffb85c3158da19e3d576f4f8 (diff)
downloadtk-760c682c426b6ad44b6812ce3521c76be97f6afe.zip
tk-760c682c426b6ad44b6812ce3521c76be97f6afe.tar.gz
tk-760c682c426b6ad44b6812ce3521c76be97f6afe.tar.bz2
Better alingment of notebook tabs in Cocoa; thanks to Marc Culler for patch
-rw-r--r--macosx/ttkMacOSXTheme.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index 3f507b0..cfa6ef9 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -294,22 +294,12 @@ 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);
}
static void TabElementDraw(
@@ -327,7 +317,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
@@ -365,8 +354,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