Previously we would still perform layout on the tabs to the left since with tabs having equal width, the layout should result in the same. Now that we compress tabs, the layout can change.
In theory the user could close a tab, have the mouse remain inside the tab bar, and then perform an action that changes the underlying tabs, which would then leave us with tab item views that need layout.
This seems appropriate given that label font is used below toolbar icons and the tick marks on a slider. Here we use it below the available colors.
We also use it for OakCreateSmallLabel() which is only used for status messages in the registration window.
We now center most things and baseline align text controls. Previously we would stretch all controls to full height which wouldn’t guarantee that e.g. pop-up buttons would properly align with the text fields.
We now use the control content font as this seems to be meant for content shown in tables. We use the standard size (of 12 points) for the headings and set the result rows to use 11 point.
The number of matches is shown with the label font as that is semantically a small font used for placing labels next to things.
This way when asking for a fitting size we get back the minimum size with all but the centering constraint met (and minimized).
In theory the compression resistance for the text field only need to be NSLayoutPriorityFittingSizeCompression+1 but for reasons I do not yet understand, we need to set it higher than NSLayoutPriorityDefaultLow, otherwise the fitting width will occasionally be 64.
Until the 10.10 SDK we could use the compiler’s synthesized getter for our ‘tag’ property, but NSView.h in the 10.10 SDK declares ‘tag’ via the @property syntax and it is effectively unsupported to redeclare a readonly property as readwrite in a subclass (clang will not synthesize getter/setter methods in the subclass).
When we close a tab with the mouse we “freeze” the layout rectangle of the tabs before the one closed, however, if this group contains non-visible tabs during close (as is mostly the case when showing the overflow button) then one of those would be made visible (since we closed a tab that took up space) and this new tab would be squeezed into the saved layout rectangle.
This worked previously because selected tab was stored using an index and we were only changing it (before reload) when closing tabs, so the new index would be valid both before and after reload.
With the new OakTabBarView the index of selected tab is instantly converted into a reference to a tab item.
This workaround is to avoid a couple of undesired behaviors in the `HTMLOutputWindow` when the web page implements keyboard commands such as Git → Browse Annotated File (Blame). Namely, when using the keyboard commands, we would always receive an NSBeep. Also, fixed an issue when these key commands may conflict with menu keys. See comment in the commit for details.