The NSImageNameRemoveTemplate looks bad in 10.14, and while there is some duplication in this commit, it’s so few lines that sharing this functionality would result in an increase of total number of lines.
I was unable to update the CSS from Objective-C (using evaluateJavaScript:) which is why the content has to request the styles from the exposed TextMate object.
It would be best if this was implicit (which I know is easy with WKWebView, so better just migrate to WKWebView than fight more with WebView).
Though it is probably better to have separate style sheets for light and dark, eventually we may even be able to rely on media queries for the appearance.
This is to avoid issues with AppKit when changing OakChooser to be a subclass of NSWindowController, as NSWindowController already has a document property and makes some assumptions about this.
I picked TMDocument over oakDocument only because I wasn’t sure how to capitalize the latter for getter/setter.
On 10.14 we use the “behind window” blending mode as we’d prefer the background to differ from that of the text view itself, though I am not seeing much of a difference here.
This is limited to hidden items that have a key equivalent assigned to them, although if they don’t, there is probably no harm in enabling this option.
This makes the title bar render in the same color as it did prior to building on 10.14, so that the current tab colors match.
It does however make sheets appear from “above” the title bar and makes the Dark Mode style darker, so this is just an intermediate fix until the tab bar gets revamped for 10.14.
On macOS 10.14 this image doesn’t always render, so this is a temporary workaround.
The main advantage of using OakFileIconImage is the added SCM badge and custom icon for known file types.
The purpose was to render text with a shadow and fade the text when the window is inactive, but the former has not been used since 10.10 and the latter doesn’t actually seem to work.
Not too fond of how this looks in Dark Mode but I think it’s better than the previous colors, which stem from back when the window had more of a 3D look.
When building on 10.14 the textured window look does not provide a borderless title bar look as the window content is lighter than the title bar.
The solution is to move the search controls to the title bar, which is possible starting with 10.10.
Ideally I would like to have the FileItem class be the public API, as that will then take care of updating the icon’s SCM status etc., current commit is just a temporary fix for missing document icons on 10.14.