mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Merge pull request #357 from macvim-dev/fix/tabwidth
Honor defaults settings of Tab width on Yosemite or later
This commit is contained in:
@@ -181,12 +181,28 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
CFPreferencesSetAppValue(CFSTR("NSRepeatCountBinding"),
|
||||
CFSTR(""),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
|
||||
int tabMinWidthKey;
|
||||
int tabMaxWidthKey;
|
||||
int tabOptimumWidthKey;
|
||||
if (shouldUseYosemiteTabBarStyle()) {
|
||||
tabMinWidthKey = 120;
|
||||
tabMaxWidthKey = 0;
|
||||
tabOptimumWidthKey = 0;
|
||||
} else {
|
||||
tabMinWidthKey = 64;
|
||||
tabMaxWidthKey = 6*64;
|
||||
tabOptimumWidthKey = 132;
|
||||
}
|
||||
|
||||
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithBool:NO], MMNoWindowKey,
|
||||
[NSNumber numberWithInt:64], MMTabMinWidthKey,
|
||||
[NSNumber numberWithInt:6*64], MMTabMaxWidthKey,
|
||||
[NSNumber numberWithInt:132], MMTabOptimumWidthKey,
|
||||
[NSNumber numberWithInt:tabMinWidthKey],
|
||||
MMTabMinWidthKey,
|
||||
[NSNumber numberWithInt:tabMaxWidthKey],
|
||||
MMTabMaxWidthKey,
|
||||
[NSNumber numberWithInt:tabOptimumWidthKey],
|
||||
MMTabOptimumWidthKey,
|
||||
[NSNumber numberWithBool:YES], MMShowAddTabButtonKey,
|
||||
[NSNumber numberWithInt:2], MMTextInsetLeftKey,
|
||||
[NSNumber numberWithInt:1], MMTextInsetRightKey,
|
||||
|
||||
+10
-3
@@ -127,10 +127,17 @@ enum {
|
||||
|
||||
if (shouldUseYosemiteTabBarStyle()) {
|
||||
CGFloat screenWidth = [[NSScreen mainScreen] frame].size.width;
|
||||
int tabMaxWidth = [ud integerForKey:MMTabMaxWidthKey];
|
||||
if (tabMaxWidth == 0)
|
||||
tabMaxWidth = screenWidth;
|
||||
int tabOptimumWidth = [ud integerForKey:MMTabOptimumWidthKey];
|
||||
if (tabOptimumWidth == 0)
|
||||
tabOptimumWidth = screenWidth;
|
||||
|
||||
[tabBarControl setStyleNamed:@"Yosemite"];
|
||||
[tabBarControl setCellMinWidth:120];
|
||||
[tabBarControl setCellMaxWidth:screenWidth];
|
||||
[tabBarControl setCellOptimumWidth:screenWidth];
|
||||
[tabBarControl setCellMinWidth:[ud integerForKey:MMTabMinWidthKey]];
|
||||
[tabBarControl setCellMaxWidth:tabMaxWidth];
|
||||
[tabBarControl setCellOptimumWidth:tabOptimumWidth];
|
||||
} else {
|
||||
[tabBarControl setCellMinWidth:[ud integerForKey:MMTabMinWidthKey]];
|
||||
[tabBarControl setCellMaxWidth:[ud integerForKey:MMTabMaxWidthKey]];
|
||||
|
||||
Reference in New Issue
Block a user