Skip to content

Commit bbbdc47

Browse files
authored
Merge pull request #791 from ychin/tabs_dark_mode_and_fixes
Add Mojave-style tabs, which also supports Dark Mode
2 parents b1e26a6 + 6e1489e commit bbbdc47

File tree

18 files changed

+961
-13
lines changed

18 files changed

+961
-13
lines changed

runtime/doc/gui_mac.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,12 @@ prominent bugs/missing features.
726726
then opened in Preview where it may be printed.
727727
- The toolbar looks ugly and is not very useful.
728728

729-
If you find new bugs then please post your findings to the vim_mac mailing
730-
list: *vim_mac_group* >
729+
Other bugs and issues are tracked on Github. If you find new bugs then please
730+
file an issue there: >
731+
https://github.com/macvim-dev/macvim/issues
732+
733+
There is also a vim_mac mailing list. You can also post your findings of bugs
734+
and issues there as well: *vim_mac_group* >
731735
http://groups.google.com/group/vim_mac
732736
733737
This is also the best place for making feature requests as well as for asking

src/MacVim/MMVimView.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,18 @@ - (MMVimView *)initWithFrame:(NSRect)frame
125125
[tabBarControl setDelegate:self];
126126
[tabBarControl setHidden:YES];
127127

128-
if (shouldUseYosemiteTabBarStyle()) {
128+
if (shouldUseYosemiteTabBarStyle() || shouldUseMojaveTabBarStyle()) {
129129
CGFloat screenWidth = [[NSScreen mainScreen] frame].size.width;
130130
int tabMaxWidth = [ud integerForKey:MMTabMaxWidthKey];
131131
if (tabMaxWidth == 0)
132132
tabMaxWidth = screenWidth;
133133
int tabOptimumWidth = [ud integerForKey:MMTabOptimumWidthKey];
134134
if (tabOptimumWidth == 0)
135135
tabOptimumWidth = screenWidth;
136+
137+
NSString* tabStyleName = shouldUseMojaveTabBarStyle() ? @"Mojave" : @"Yosemite";
136138

137-
[tabBarControl setStyleNamed:@"Yosemite"];
139+
[tabBarControl setStyleNamed:tabStyleName];
138140
[tabBarControl setCellMinWidth:[ud integerForKey:MMTabMinWidthKey]];
139141
[tabBarControl setCellMaxWidth:tabMaxWidth];
140142
[tabBarControl setCellOptimumWidth:tabOptimumWidth];

src/MacVim/MacVim.h

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#ifndef MAC_OS_X_VERSION_10_12_2
3333
# define MAC_OS_X_VERSION_10_12_2 101202
3434
#endif
35+
#ifndef MAC_OS_X_VERSION_10_14
36+
# define MAC_OS_X_VERSION_10_14 101400
37+
#endif
3538

3639
#ifndef NSAppKitVersionNumber10_10
3740
# define NSAppKitVersionNumber10_10 1343

src/MacVim/Miscellaneous.h

+1
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,4 @@ NSArray *normalizeFilenames(NSArray *filenames);
155155

156156

157157
BOOL shouldUseYosemiteTabBarStyle();
158+
BOOL shouldUseMojaveTabBarStyle();

src/MacVim/Miscellaneous.m

+10
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,14 @@ - (NSInteger)tag
305305
shouldUseYosemiteTabBarStyle()
306306
{
307307
return floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_10;
308+
}
309+
BOOL
310+
shouldUseMojaveTabBarStyle()
311+
{
312+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
313+
if (@available(macos 10.14, *)) {
314+
return true;
315+
}
316+
#endif
317+
return false;
308318
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "189",
13+
"alpha" : "1.000",
14+
"blue" : "188",
15+
"green" : "189"
16+
}
17+
}
18+
},
19+
{
20+
"idiom" : "universal",
21+
"appearances" : [
22+
{
23+
"appearance" : "luminosity",
24+
"value" : "dark"
25+
}
26+
],
27+
"color" : {
28+
"color-space" : "srgb",
29+
"components" : {
30+
"red" : "40",
31+
"alpha" : "1.000",
32+
"blue" : "42",
33+
"green" : "40"
34+
}
35+
}
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "168",
13+
"alpha" : "1.000",
14+
"blue" : "168",
15+
"green" : "168"
16+
}
17+
}
18+
},
19+
{
20+
"idiom" : "universal",
21+
"appearances" : [
22+
{
23+
"appearance" : "luminosity",
24+
"value" : "dark"
25+
}
26+
],
27+
"color" : {
28+
"color-space" : "srgb",
29+
"components" : {
30+
"red" : "36",
31+
"alpha" : "1.000",
32+
"blue" : "39",
33+
"green" : "37"
34+
}
35+
}
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "209",
13+
"alpha" : "1.000",
14+
"blue" : "208",
15+
"green" : "209"
16+
}
17+
}
18+
},
19+
{
20+
"idiom" : "universal",
21+
"appearances" : [
22+
{
23+
"appearance" : "luminosity",
24+
"value" : "dark"
25+
}
26+
],
27+
"color" : {
28+
"color-space" : "srgb",
29+
"components" : {
30+
"red" : "54",
31+
"alpha" : "1.000",
32+
"blue" : "57",
33+
"green" : "55"
34+
}
35+
}
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "221",
13+
"alpha" : "1.000",
14+
"blue" : "221",
15+
"green" : "221"
16+
}
17+
}
18+
},
19+
{
20+
"idiom" : "universal",
21+
"appearances" : [
22+
{
23+
"appearance" : "luminosity",
24+
"value" : "dark"
25+
}
26+
],
27+
"color" : {
28+
"color-space" : "srgb",
29+
"components" : {
30+
"red" : "30",
31+
"alpha" : "1.000",
32+
"blue" : "33",
33+
"green" : "31"
34+
}
35+
}
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "198",
13+
"alpha" : "1.000",
14+
"blue" : "198",
15+
"green" : "198"
16+
}
17+
}
18+
},
19+
{
20+
"idiom" : "universal",
21+
"appearances" : [
22+
{
23+
"appearance" : "luminosity",
24+
"value" : "dark"
25+
}
26+
],
27+
"color" : {
28+
"color-space" : "srgb",
29+
"components" : {
30+
"red" : "27",
31+
"alpha" : "1.000",
32+
"blue" : "30",
33+
"green" : "28"
34+
}
35+
}
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "246",
13+
"alpha" : "1.000",
14+
"blue" : "246",
15+
"green" : "246"
16+
}
17+
}
18+
},
19+
{
20+
"idiom" : "universal",
21+
"appearances" : [
22+
{
23+
"appearance" : "luminosity",
24+
"value" : "dark"
25+
}
26+
],
27+
"color" : {
28+
"color-space" : "srgb",
29+
"components" : {
30+
"red" : "43",
31+
"alpha" : "1.000",
32+
"blue" : "47",
33+
"green" : "45"
34+
}
35+
}
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "169",
13+
"alpha" : "1.000",
14+
"blue" : "169",
15+
"green" : "169"
16+
}
17+
}
18+
},
19+
{
20+
"idiom" : "universal",
21+
"appearances" : [
22+
{
23+
"appearance" : "luminosity",
24+
"value" : "dark"
25+
}
26+
],
27+
"color" : {
28+
"color-space" : "srgb",
29+
"components" : {
30+
"red" : "96",
31+
"alpha" : "1.000",
32+
"blue" : "99",
33+
"green" : "97"
34+
}
35+
}
36+
}
37+
]
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
},
6+
"colors" : [
7+
{
8+
"idiom" : "universal",
9+
"color" : {
10+
"color-space" : "srgb",
11+
"components" : {
12+
"red" : "210",
13+
"alpha" : "1.000",
14+
"blue" : "210",
15+
"green" : "210"
16+
}
17+
}
18+
},
19+
{
20+
"idiom" : "universal",
21+
"appearances" : [
22+
{
23+
"appearance" : "luminosity",
24+
"value" : "dark"
25+
}
26+
],
27+
"color" : {
28+
"color-space" : "srgb",
29+
"components" : {
30+
"red" : "73",
31+
"alpha" : "1.000",
32+
"blue" : "77",
33+
"green" : "74"
34+
}
35+
}
36+
}
37+
]
38+
}

0 commit comments

Comments
 (0)