From e4946559dece440b68b27bdd876ece8ef1061e64 Mon Sep 17 00:00:00 2001 From: Sanjay Madan Date: Sat, 13 Feb 2021 21:46:20 -0800 Subject: [PATCH] Replace asset catalog with code --- .../AddTabButton.imageset/AddButton.png | Bin 177 -> 0 bytes .../AddTabButton.imageset/AddButton@2x.png | Bin 248 -> 0 bytes .../AddTabButton.imageset/AddButtonDark.png | Bin 198 -> 0 bytes .../AddButtonDark@2x.png | Bin 280 -> 0 bytes .../AddTabButton.imageset/Contents.json | 40 --------------- .../CloseTabButton.imageset/CloseButton.png | Bin 153 -> 0 bytes .../CloseButton@2x.png | Bin 238 -> 0 bytes .../CloseButtonDark.png | Bin 220 -> 0 bytes .../CloseButtonDark@2x.png | Bin 375 -> 0 bytes .../CloseTabButton.imageset/Contents.json | 40 --------------- src/MacVim/Assets.xcassets/Contents.json | 6 --- .../ScrollLeftButton.imageset/Contents.json | 40 --------------- .../ScrollLeftButton.png | Bin 220 -> 0 bytes .../ScrollLeftButton@2x.png | Bin 335 -> 0 bytes .../ScrollLeftButtonDark.png | Bin 275 -> 0 bytes .../ScrollLeftButtonDark@2x.png | Bin 458 -> 0 bytes .../ScrollRightButton.imageset/Contents.json | 40 --------------- .../ScrollRightButton.png | Bin 216 -> 0 bytes .../ScrollRightButton@2x.png | Bin 324 -> 0 bytes .../ScrollRightButtonDark.png | Bin 276 -> 0 bytes .../ScrollRightButtonDark@2x.png | Bin 432 -> 0 bytes .../Tabline.colorset/Contents.json | 38 -------------- .../TablineFill.colorset/Contents.json | 38 -------------- .../TablineSel.colorset/Contents.json | 38 -------------- src/MacVim/MMTabline/MMHoverButton.h | 4 +- src/MacVim/MMTabline/MMHoverButton.m | 37 ++++++++++++++ src/MacVim/MMTabline/MMTab.m | 21 ++++---- src/MacVim/MMTabline/MMTabline.m | 47 +++++++++++++++++- src/MacVim/MacVim.xcodeproj/project.pbxproj | 4 -- 29 files changed, 94 insertions(+), 299 deletions(-) delete mode 100644 src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButton.png delete mode 100644 src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButton@2x.png delete mode 100644 src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButtonDark.png delete mode 100644 src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButtonDark@2x.png delete mode 100644 src/MacVim/Assets.xcassets/AddTabButton.imageset/Contents.json delete mode 100644 src/MacVim/Assets.xcassets/CloseTabButton.imageset/CloseButton.png delete mode 100644 src/MacVim/Assets.xcassets/CloseTabButton.imageset/CloseButton@2x.png delete mode 100644 src/MacVim/Assets.xcassets/CloseTabButton.imageset/CloseButtonDark.png delete mode 100644 src/MacVim/Assets.xcassets/CloseTabButton.imageset/CloseButtonDark@2x.png delete mode 100644 src/MacVim/Assets.xcassets/CloseTabButton.imageset/Contents.json delete mode 100644 src/MacVim/Assets.xcassets/Contents.json delete mode 100644 src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/Contents.json delete mode 100644 src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButton.png delete mode 100644 src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButton@2x.png delete mode 100644 src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButtonDark.png delete mode 100644 src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButtonDark@2x.png delete mode 100644 src/MacVim/Assets.xcassets/ScrollRightButton.imageset/Contents.json delete mode 100644 src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButton.png delete mode 100644 src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButton@2x.png delete mode 100644 src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButtonDark.png delete mode 100644 src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButtonDark@2x.png delete mode 100644 src/MacVim/Assets.xcassets/Tabline.colorset/Contents.json delete mode 100644 src/MacVim/Assets.xcassets/TablineFill.colorset/Contents.json delete mode 100644 src/MacVim/Assets.xcassets/TablineSel.colorset/Contents.json diff --git a/src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButton.png b/src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButton.png deleted file mode 100644 index 6467d989f4227e8460a52072d6c3823b5e69e772..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^f*{Pn1|+R>-G2comUKs7M+SzC{oH>NS%LfvPZ!4! z3&G?B3Dzeq4rZ3KCVc(CVEMmM!sRiGk437-goJ|&#nOz;L*(3=cf=RGa1=bp_{kye zK&#=Q4nbGzrsg-3#2pej75;HeRXe51u~>o8Ykotj+cq)o-{Jvpcm?E-Dw%7wsIxHi X&lEI2cYMJmpq&h!u6{1-oD!M<`8YR! diff --git a/src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButton@2x.png b/src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButton@2x.png deleted file mode 100644 index b12b73beb0a72d2b61ef4394dc13477894c679ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;mUKs7M+SzC{oH>NS%LiZo-U3d z5u9&Ba=985c((Q%v)od;mh^;8 z0w-omFj~_lX@2wn%ifaI|RvZxgg;osGk2z uM0i*DQol=mb`hcbdX@q0ZD2fjfcwr_xz!>wyW)UOXYh3Ob6Mw<&;$Uufm+`H diff --git a/src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButtonDark.png b/src/MacVim/Assets.xcassets/AddTabButton.imageset/AddButtonDark.png deleted file mode 100644 index 1c8f20e1b51a557a7bb9307acc84339e113c7c32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^f*{Pn1|+R>-G2comUKs7M+SzC{oH>NS%LgoPZ!4! z3&G?B309T%12;FPZ|2NQIN#ro#Df;*SzrExVM(Ko!lvI6-5o-U3d z8luSw608dZG?M6 diff --git a/src/MacVim/Assets.xcassets/CloseTabButton.imageset/CloseButton@2x.png b/src/MacVim/Assets.xcassets/CloseTabButton.imageset/CloseButton@2x.png deleted file mode 100644 index 0d98b296abed0da3829864f01dbeb406db6a1275..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 238 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX1|+Qw)-3{3Ea{HEjtmSN`?>!lvI6-_JzX3_ zJb2%R+~#aB;L&-v;5UDwc>&A8!Y}U@2YC5jW*0GRY%rU?`^gcj^hCZH%=HBal20=4 z)S9N+7V)iwy)*Ag=aeIn${>!r&kwbA2TgdD1iiPaZQP=%KEc}iciW!hPT~?XXT7)g zvEc}sa$aVI)-_RelF{r5}E)`n^_V7 diff --git a/src/MacVim/Assets.xcassets/CloseTabButton.imageset/CloseButtonDark.png b/src/MacVim/Assets.xcassets/CloseTabButton.imageset/CloseButtonDark.png deleted file mode 100644 index 7b366e8f09bd1a15a973ef0c7cc7fcf93c31db54..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^{2!lvI6;&JzX3_ zG(?jVBv^UU&(G7fE`K-2rYNA{heBbBp}=g;*oKJ{KR(%C|Nk75>5b+m4kjJ^LdOHT z^%|BW>Iw@73kM|2PT(^$GP3IM)eSRT&|B%S{2%MZ2vG)B!#TV`9Hm*Z7gn|^%yz8F zVN1wp%VM#Vd~(H8K`P@w6iDFT|Nr|f1DXxb^eadmVed@dT)U)`ks;_|uoQ#ny!}Au OF?hQAxvX_R#rcd*e5B)+G+ zVUgXLwN!Rs49wq`dG2PhNR|{x3jDePnYKXJbtlv;^E^LPRdti<`@Ua|<9I~Pqps_{ zRGUjllUw4s!N8V-L-hvQvKG!B(Nr)u#e^%o48a{}$y(DRf>o*6?HRnavP(IM90d-+ z8K(+(*iGjbVotJXFo(F?Wmz^%)5P!^PI;rDZ2Ah!2EqY6!wIAffHqe8cS!$L50`I* z+4Pmd=Drd&_7&KXn%fRW?se$2OY~^41GNXK0l2|%@v4R3Q95~`^FfkwAt>W2IA(B6 z&F4#~Qse*Qx7W%$Z|V->iRN`e%*xIl(Nr+HAMlHIPYExIV#iwe9iA*HkQDfH1)il< Vy@V5b+=u`G002ovPDHLkV1hdFq*(v} diff --git a/src/MacVim/Assets.xcassets/CloseTabButton.imageset/Contents.json b/src/MacVim/Assets.xcassets/CloseTabButton.imageset/Contents.json deleted file mode 100644 index 65668a91f2..0000000000 --- a/src/MacVim/Assets.xcassets/CloseTabButton.imageset/Contents.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "images" : [ - { - "idiom" : "mac", - "filename" : "CloseButton.png", - "scale" : "1x" - }, - { - "idiom" : "mac", - "filename" : "CloseButtonDark.png", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "scale" : "1x" - }, - { - "idiom" : "mac", - "filename" : "CloseButton@2x.png", - "scale" : "2x" - }, - { - "idiom" : "mac", - "filename" : "CloseButtonDark@2x.png", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/src/MacVim/Assets.xcassets/Contents.json b/src/MacVim/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596a7..0000000000 --- a/src/MacVim/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/Contents.json b/src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/Contents.json deleted file mode 100644 index 516d59370d..0000000000 --- a/src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/Contents.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "images" : [ - { - "filename" : "ScrollLeftButton.png", - "idiom" : "mac", - "scale" : "1x" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "filename" : "ScrollLeftButtonDark.png", - "idiom" : "mac", - "scale" : "1x" - }, - { - "filename" : "ScrollLeftButton@2x.png", - "idiom" : "mac", - "scale" : "2x" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "filename" : "ScrollLeftButtonDark@2x.png", - "idiom" : "mac", - "scale" : "2x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButton.png b/src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButton.png deleted file mode 100644 index 47fd2aa9bc1b63a2a2a39ee1acee748492eb72f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^f*{Pn1|+R>-G2comUKs7M+SzC{oH>NS%G|u)CkWs zUtb0-Ae)1Mu|1Q41;}CqVksbIU|?Fn1Q!upz>HvnB-ci7v<6cCo-U3d7J|tM60FQ( zOkxhR-v=b^<_-9)uJF%uog$w@Z+ycKdx6QhCyG}viby8$n>;aIs>k>$eFIxk*CCb^ o4vvPT=Ylg_6%V>B{3p0vmO;5oV3U92f*Oz&p00i_>zopr04-lK;Q#;t diff --git a/src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButton@2x.png b/src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButton@2x.png deleted file mode 100644 index 525096d80435099115b44fc9c1295fbae2870d9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 335 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;mUKs7M+SzC{oH>NS%G|u)CkWs zUtb0-Ae)1Mu|1Q41;}CqVksbIU|?Fn1Q$_Sz>HvnBo#L`=K-lho-U3d5u9(Q*>W9n z5O52Z*1givaqqucRELX*pzHgGj3)U9l0GL39+~+}`bXDY73==#IX9++7%4CVkuEcH z+Of5f&pS2$ZhP|Z&h~5T61J%4e_9h;D0AjzsRElI+olCSHJdpYBbf>^9d;!_*m#X?M1-uU!+n{)8+`U&`(89!1)U3T(;tTa21H znGI)1-mFb-G2comUKs7M+SzC{oH>NS%G|u)CkWs zUtb0-Ae)1Mu|1Q41;}CqVksbIU|?Fn1Q!upz>HvnB-ci7v<6abo-U3d7J|tM60FR^ zOzG$6ZM7(Vc1E^l+vW$8S+chM{Qv*InVXwiS+dnHsALbACq7+jhK1ks zKYxFhTLuW4`zYE;E%%-=V}??L-p?j~V;{cdia=fLjck<+qIGSW$6Ozquq-)v;lc-v u3#NGo4%Bv@W>|EzvF*Xuo{VO<2~G_6YUJ-7ySw5$$Yq|celF{r5}E*5MN|&} diff --git a/src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButtonDark@2x.png b/src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/ScrollLeftButtonDark@2x.png deleted file mode 100644 index 93304ac7577bda6c986f22ac91377670635e398b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 458 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;mUKs7M+SzC{oH>NS%G|u)CkWs zUtb0-Ae)1Mu|1Q41;}CqVksbIU|?Fn1Q$_Sz>HvnBo#L`=K&Sldb&7Ha@M=W zLE>1sN~CRzU|@Y?yMWNa1=&|NefeJ&(b4*CQ@a7LkAO|ZOA*0~N-qw+kvwr&t|a{q zqxBx*4&-bS%s0m9wVX$=Io4|aV&&2oeCmZu^`A7ZPAFaGQGjo<)TVe(OjNp{H z<>_Va-`F^t4rp~HF?ML5$l0~@mvU774tpuri-O5-9`Y};uXHal@R+1>yfjvyv2dre zvxd!!%nvf^sgZgM3lx_qO;CC3A#*(a#cvMvDUJnxnG;s65?fJRvGJ55FVjc)sSLUL znF6ub-v|7;Wfrj2t9i$|-+Ujl&xnT#?CCe*(En8X|FFqf=|76+|Ex*kVS0F|?{Q7m ztg`O6mscpn-1)pm|MaG`g0#K*XA<0_5^rzY&wF?Vb6V@qYxnxMJ!(#loaXD!tdLmL fAfv$kubX-QbvAzbP0l+XkK%B-gq diff --git a/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/Contents.json b/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/Contents.json deleted file mode 100644 index 8f067dc907..0000000000 --- a/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/Contents.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "images" : [ - { - "filename" : "ScrollRightButton.png", - "idiom" : "mac", - "scale" : "1x" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "filename" : "ScrollRightButtonDark.png", - "idiom" : "mac", - "scale" : "1x" - }, - { - "filename" : "ScrollRightButton@2x.png", - "idiom" : "mac", - "scale" : "2x" - }, - { - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "filename" : "ScrollRightButtonDark@2x.png", - "idiom" : "mac", - "scale" : "2x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButton.png b/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButton.png deleted file mode 100644 index c2f643e3c90bf5d1302932375328759b2db15991..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^f*{Pn1|+R>-G2comUKs7M+SzC{oH>NS%G|u)CkWs zUtb0-Ae)1Mu|1Q41;}CqVksbIU|?Fn1Q!upz>HvnB-ci7v<6b%o-U3d7J|tM60FQZ zOyv#Rq5`r$`!8Ue-*BT%sM(?I5Bnp1haCTPjt0&SY_^N9OgKMf7mJA6wI{onmb@1f lm>rzN;Gr+Pl&vS^FN4BMf%V_NZGHwa-qY33Wt~$(69Dj(H4p#* diff --git a/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButton@2x.png b/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButton@2x.png deleted file mode 100644 index 0f76e9dd41e612f1720575b17425c70daab7f42c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 324 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;mUKs7M+SzC{oH>NS%G|u)CkWs zUtb0-Ae)1Mu|1Q41;}CqVksbIU|?Fn1Q$_Sz>HvnBo#L`=K-nho-U3d5u9(Q9^`6r z5OGyE-*&=)`~QFctYD2Pt$Ke1zCWw&c2GIkc<}WjzB_lT^Uuv`lzhG=#eofo?#S_# zMSr-!^r%fGX9gcb{F6qRnFjU(&6*RZuo|-&&Jdqun6ONN?X#m^_TfLwhBMesUT>KR zq)&;fe9Dc8xUav4JIE}3$+41OSNAX$@)h~?D+Vk3f0<|Vt9fdlBbU!o`;2mjfcX`_ szpOjKxNzN!UAxVuGfGZqTq`BPaLCa{_D#X7Qjk|XUHx3vIVCg!03N(&Bme*a diff --git a/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButtonDark.png b/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButtonDark.png deleted file mode 100644 index 04fd66e76dde5ec09655f2d9f8a6feacf0e06501..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^f*{Pn1|+R>-G2comUKs7M+SzC{oH>NS%G|u)CkWs zUtb0-Ae)1Mu|1Q41;}CqVksbIU|?Fn1Q!upz>HvnB-ci7v<6b`o-U3d7J|tM60BeN z8;#S?J(+7;UH0++|Nk>T-aOahFQjpt*F@pjot?#}8%((MwzlvvzGjvZU^B@Oy^y-* z29MGyfeCI492Js{1*aJy6|VS&y$1(4G`UHx3vIVCg!06&XPn*aa+ diff --git a/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButtonDark@2x.png b/src/MacVim/Assets.xcassets/ScrollRightButton.imageset/ScrollRightButtonDark@2x.png deleted file mode 100644 index 2e125f073f5b80af4120608064f48617d17318aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;mUKs7M+SzC{oH>NS%G|u)CkWs zUtb0-Ae)1Mu|1Q41;}CqVksbIU|?Fn1Q$_Sz>HvnBo#L`=K&Qfd%8G=L~y>Hda%36 zL8RS1P$)%p+KVe!n+5dVBqsXD-g0*QpD%b-m%}Gq%<;p6rOx7!F+wbc)tj&E&6E@Q zc+XYl-k*EN&3la8T-i=ANGdS*EX~X^@m-v-BOujjlMZ*y{rIDWf0QO4{_fSN(RGPg zxp|RBn&+elBZDA?=?57;&wT#VhNJ0Qs_&OhrXsmtf!Dt(bu9`Hkf0-#{?boFyt=akR{ E0BH)Fp#T5? diff --git a/src/MacVim/Assets.xcassets/Tabline.colorset/Contents.json b/src/MacVim/Assets.xcassets/Tabline.colorset/Contents.json deleted file mode 100644 index 52cda972ce..0000000000 --- a/src/MacVim/Assets.xcassets/Tabline.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "mac", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "0xDD", - "alpha" : "1.000", - "blue" : "0xDD", - "green" : "0xDD" - } - } - }, - { - "idiom" : "mac", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "0x33", - "alpha" : "1.000", - "blue" : "0x33", - "green" : "0x33" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/Assets.xcassets/TablineFill.colorset/Contents.json b/src/MacVim/Assets.xcassets/TablineFill.colorset/Contents.json deleted file mode 100644 index a5b9b01bf8..0000000000 --- a/src/MacVim/Assets.xcassets/TablineFill.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "mac", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "0xC3", - "alpha" : "1.000", - "blue" : "0xC3", - "green" : "0xC3" - } - } - }, - { - "idiom" : "mac", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "0x33", - "alpha" : "1.000", - "blue" : "0x33", - "green" : "0x33" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/Assets.xcassets/TablineSel.colorset/Contents.json b/src/MacVim/Assets.xcassets/TablineSel.colorset/Contents.json deleted file mode 100644 index cafe3fed62..0000000000 --- a/src/MacVim/Assets.xcassets/TablineSel.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "mac", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "0xFF", - "alpha" : "1.000", - "blue" : "0xFF", - "green" : "0xFF" - } - } - }, - { - "idiom" : "mac", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "0x66", - "alpha" : "1.000", - "blue" : "0x66", - "green" : "0x66" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/MMTabline/MMHoverButton.h b/src/MacVim/MMTabline/MMHoverButton.h index b5ebdad246..df3322b8a9 100644 --- a/src/MacVim/MMTabline/MMHoverButton.h +++ b/src/MacVim/MMTabline/MMHoverButton.h @@ -4,6 +4,8 @@ @interface MMHoverButton : NSButton -@property (nonatomic) NSColor *fgColor; +@property (nonatomic, retain) NSColor *fgColor; + ++ (NSImage *)imageNamed:(NSString *)name; @end diff --git a/src/MacVim/MMTabline/MMHoverButton.m b/src/MacVim/MMTabline/MMHoverButton.m index 75760dfc73..c21fe5559f 100644 --- a/src/MacVim/MMTabline/MMHoverButton.m +++ b/src/MacVim/MMTabline/MMHoverButton.m @@ -6,6 +6,43 @@ @implementation MMHoverButton NSBox *_circle; } ++ (NSImage *)imageNamed:(NSString *)name +{ + CGFloat size = [name isEqualToString:@"CloseTabButton"] ? 15 : 17; + return [NSImage imageWithSize:NSMakeSize(size, size) flipped:NO drawingHandler:^BOOL(NSRect dstRect) { + NSBezierPath *p = [NSBezierPath new]; + if ([name isEqualToString:@"AddTabButton"]) { + [p moveToPoint:NSMakePoint( 8.5, 4.5)]; + [p lineToPoint:NSMakePoint( 8.5, 12.5)]; + [p moveToPoint:NSMakePoint( 4.5, 8.5)]; + [p lineToPoint:NSMakePoint(12.5, 8.5)]; + [p setLineWidth:1.2]; + [p stroke]; + } + else if ([name isEqualToString:@"CloseTabButton"]) { + [p moveToPoint:NSMakePoint( 4.5, 4.5)]; + [p lineToPoint:NSMakePoint(10.5, 10.5)]; + [p moveToPoint:NSMakePoint( 4.5, 10.5)]; + [p lineToPoint:NSMakePoint(10.5, 4.5)]; + [p setLineWidth:1.2]; + [p stroke]; + } + else if ([name isEqualToString:@"ScrollLeftButton"]) { + [p moveToPoint:NSMakePoint( 5.0, 8.5)]; + [p lineToPoint:NSMakePoint(10.0, 4.5)]; + [p lineToPoint:NSMakePoint(10.0, 12.5)]; + [p fill]; + } + else if ([name isEqualToString:@"ScrollRightButton"]) { + [p moveToPoint:NSMakePoint(12.0, 8.5)]; + [p lineToPoint:NSMakePoint( 7.0, 4.5)]; + [p lineToPoint:NSMakePoint( 7.0, 12.5)]; + [p fill]; + } + return YES; + }]; +} + - (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; diff --git a/src/MacVim/MMTabline/MMTab.m b/src/MacVim/MMTabline/MMTab.m index 18ca3e1413..7e865a8b59 100644 --- a/src/MacVim/MMTabline/MMTab.m +++ b/src/MacVim/MMTabline/MMTab.m @@ -28,7 +28,7 @@ - (instancetype)initWithFrame:(NSRect)frameRect tabline:(MMTabline *)tabline _tabline = tabline; _closeButton = [MMHoverButton new]; - _closeButton.image = [NSImage imageNamed:@"CloseTabButton"]; + _closeButton.image = [MMHoverButton imageNamed:@"CloseTabButton"]; _closeButton.target = self; _closeButton.action = @selector(closeTab:); _closeButton.translatesAutoresizingMaskIntoConstraints = NO; @@ -100,25 +100,25 @@ - (void)setState:(MMTabState)state // DO NOT animate so that UX feels snappier. if (state == MMTabStateSelected) { _closeButton.alphaValue = 1; - _titleLabel.textColor = _tabline.tablineSelFgColor ?: NSColor.controlTextColor; - self.fillColor = _tabline.tablineSelBgColor ?: [NSColor colorNamed:@"TablineSel"]; + _titleLabel.textColor = _tabline.tablineSelFgColor; + self.fillColor = _tabline.tablineSelBgColor; self.shadow = _shadow; } else if (state == MMTabStateUnselected) { if (_state == MMTabStateSelected) { _closeButton.alphaValue = 0; - _titleLabel.textColor = _tabline.tablineFgColor ?: NSColor.disabledControlTextColor; - self.fillColor = _tabline.tablineBgColor ?: [NSColor colorNamed:@"Tabline"]; + _titleLabel.textColor = _tabline.tablineFgColor; + self.fillColor = _tabline.tablineBgColor; } else { _closeButton.animator.alphaValue = 0; - _titleLabel.animator.textColor = _tabline.tablineFgColor ?: NSColor.disabledControlTextColor; - self.animator.fillColor = _tabline.tablineBgColor ?: [NSColor colorNamed:@"Tabline"]; + _titleLabel.animator.textColor = _tabline.tablineFgColor; + self.animator.fillColor = _tabline.tablineBgColor; } self.shadow = nil; } else { // state == MMTabStateUnselectedHover _closeButton.animator.alphaValue = 1; - _titleLabel.animator.textColor = _tabline.tablineSelFgColor ?: NSColor.controlTextColor; + _titleLabel.animator.textColor = _tabline.tablineSelFgColor; self.animator.fillColor = self.unselectedHoverColor; self.animator.shadow = _shadow; } @@ -128,12 +128,9 @@ - (void)setState:(MMTabState)state - (NSColor *)unselectedHoverColor { // stackoverflow.com/a/52516863/111418 - NSColor *tablineSelBgColor = _tabline.tablineSelBgColor ?: [NSColor colorNamed:@"TablineSel"]; - NSColor *tablineBgColor = _tabline.tablineBgColor ?: [NSColor colorNamed:@"Tabline"]; - NSColor *c; NSAppearance *currentAppearance = NSAppearance.currentAppearance; NSAppearance.currentAppearance = self.effectiveAppearance; - c = [tablineSelBgColor blendedColorWithFraction:0.6 ofColor:tablineBgColor]; + NSColor *c = [_tabline.tablineSelBgColor blendedColorWithFraction:0.6 ofColor:_tabline.tablineBgColor]; NSAppearance.currentAppearance = currentAppearance; return c; } diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m index 2f7a95966b..7857369a67 100644 --- a/src/MacVim/MMTabline/MMTabline.m +++ b/src/MacVim/MMTabline/MMTabline.m @@ -1,6 +1,7 @@ #import #import #import "MMTabline.h" +#import "Miscellaneous.h" typedef struct TabWidth { CGFloat width; @@ -13,7 +14,7 @@ MMHoverButton* MakeHoverButton(MMTabline *tabline, NSString *imageName, SEL action, BOOL continuous) { MMHoverButton *button = [MMHoverButton new]; - button.image = [NSImage imageNamed:imageName]; + button.image = [MMHoverButton imageNamed:imageName]; button.translatesAutoresizingMaskIntoConstraints = NO; button.target = tabline; button.action = action; @@ -42,6 +43,12 @@ @implementation MMTabline id _scrollWheelEventMonitor; } +@synthesize tablineBgColor = _tablineBgColor; +@synthesize tablineFgColor = _tablineFgColor; +@synthesize tablineSelBgColor = _tablineSelBgColor; +@synthesize tablineSelFgColor = _tablineSelFgColor; +@synthesize tablineFillFgColor = _tablineFillFgColor; + - (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; @@ -118,7 +125,12 @@ - (BOOL)wantsUpdateLayer { return YES; } - (void)updateLayer { - self.layer.backgroundColor = (self.tablineFillFgColor ?: [NSColor colorNamed:@"TablineFill"]).CGColor; + self.layer.backgroundColor = self.tablineFillFgColor.CGColor; +} + +- (void)viewDidChangeEffectiveAppearance +{ + for (MMTab *tab in _tabs) tab.state = tab.state; } #pragma mark - Accessors @@ -171,24 +183,48 @@ - (void)setShowsTabScrollButtons:(BOOL)showsTabScrollButtons } } +- (NSColor *)tablineBgColor +{ + return _tablineBgColor ?: getCurrentAppearance(self.effectiveAppearance) + ? [NSColor colorWithWhite:0.2 alpha:1] + : [NSColor colorWithWhite:0.8 alpha:1]; +} + - (void)setTablineBgColor:(NSColor *)color { _tablineBgColor = color; for (MMTab *tab in _tabs) tab.state = tab.state; } +- (NSColor *)tablineFgColor +{ + return _tablineFgColor ?: NSColor.disabledControlTextColor; +} + - (void)setTablineFgColor:(NSColor *)color { _tablineFgColor = color; for (MMTab *tab in _tabs) tab.state = tab.state; } +- (NSColor *)tablineSelBgColor +{ + return _tablineSelBgColor ?: getCurrentAppearance(self.effectiveAppearance) + ? [NSColor colorWithWhite:0.4 alpha:1] + : NSColor.whiteColor; +} + - (void)setTablineSelBgColor:(NSColor *)color { _tablineSelBgColor = color; for (MMTab *tab in _tabs) tab.state = tab.state; } +- (NSColor *)tablineSelFgColor +{ + return _tablineSelFgColor ?: NSColor.controlTextColor; +} + - (void)setTablineSelFgColor:(NSColor *)color { _tablineSelFgColor = color; @@ -198,6 +234,13 @@ - (void)setTablineSelFgColor:(NSColor *)color for (MMTab *tab in _tabs) tab.state = tab.state; } +- (NSColor *)tablineFillFgColor +{ + return _tablineFillFgColor ?: getCurrentAppearance(self.effectiveAppearance) + ? [NSColor colorWithWhite:0.2 alpha:1] + : [NSColor colorWithWhite:0.8 alpha:1]; +} + - (void)setTablineFillFgColor:(NSColor *)color { _tablineFillFgColor = color; diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj index c0f781417c..c4681598f9 100644 --- a/src/MacVim/MacVim.xcodeproj/project.pbxproj +++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj @@ -71,7 +71,6 @@ 907FF7512521BCE200BADACB /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF74F2521BCE200BADACB /* MainMenu.xib */; }; 907FF7542521BDA600BADACB /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7522521BDA600BADACB /* Preferences.xib */; }; 907FF7572521BDC300BADACB /* FindAndReplace.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7552521BDC200BADACB /* FindAndReplace.xib */; }; - 9218149D254D105F00E48243 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9218149C254D105F00E48243 /* Assets.xcassets */; }; 925B55D5254B604A006B047E /* MMHoverButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 925B55D1254B604A006B047E /* MMHoverButton.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; 925B55D7254B61AC006B047E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 925B55D6254B61AB006B047E /* QuartzCore.framework */; }; 92C6F6E825587E1C007AE21E /* MMTab.m in Sources */ = {isa = PBXBuildFile; fileRef = 92C6F6E325587E1C007AE21E /* MMTab.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; @@ -431,7 +430,6 @@ 90F84F312521F8760000268B /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/MainMenu.strings; sourceTree = ""; }; 90F84F322521F87F0000268B /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/MainMenu.strings; sourceTree = ""; }; 90F84F332521F8880000268B /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/MainMenu.strings; sourceTree = ""; }; - 9218149C254D105F00E48243 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = ""; }; 925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = ""; }; 925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; @@ -615,7 +613,6 @@ 907FF7552521BDC200BADACB /* FindAndReplace.xib */, 907FF7522521BDA600BADACB /* Preferences.xib */, 907FF74F2521BCE200BADACB /* MainMenu.xib */, - 9218149C254D105F00E48243 /* Assets.xcassets */, ); name = Resources; sourceTree = ""; @@ -977,7 +974,6 @@ 1D384A0E100D671700D3C22F /* KeyBinding.plist in Resources */, 907FF7542521BDA600BADACB /* Preferences.xib in Resources */, 907FF7512521BCE200BADACB /* MainMenu.xib in Resources */, - 9218149D254D105F00E48243 /* Assets.xcassets in Resources */, 907FF7572521BDC300BADACB /* FindAndReplace.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0;