Commit Graph

322 Commits

Author SHA1 Message Date
Allan Odgaard
e44425e0cd Use thin close button images on 10.10 2014-10-02 20:23:56 +02:00
Allan Odgaard
83e3225826 Add “thin” close button from iTerm2 2014-10-02 20:23:34 +02:00
Allan Odgaard
243d1c8808 Add contentFrame property to OakTabItemView
This should return the content excluding borders and is used to create an image when dragging tabs. Long-term we probably should create a special drag image rather than ask the tab to draw itself.
2014-10-02 19:57:26 +02:00
Allan Odgaard
444df54849 Use different tab background/divider images on 10.10 2014-10-02 19:17:29 +02:00
Allan Odgaard
1a3d76880c Refactor 2014-10-02 19:15:50 +02:00
Allan Odgaard
93624253ce Add left/right padding properties to OakTabBarStyle 2014-10-02 18:56:20 +02:00
Adam Strzelecki
b137014777 Tabs above document file browser header in tab bar
Integrate visually file manager header in tab bar when tabs above document
option in on. If tabs above document are off then use default gradient L&F.

Bottom divider for file browser header view is not integrated in header for
easier control if it is shown or not.
2014-10-02 11:03:41 +02:00
Allan Odgaard
1c3b5c170a Use template image for tab bar overflow button 2014-10-02 11:03:41 +02:00
Allan Odgaard
929d7ed80e Set button background as raised when using a template image 2014-10-02 11:03:41 +02:00
Allan Odgaard
7c05b6c611 Require mouse to be moved 2.5 points before dragging a tab 2014-10-02 11:03:41 +02:00
Allan Odgaard
639f1d282f Remove OakCreateSmallLabel helper since it’s only used once 2014-09-30 17:08:01 +02:00
Allan Odgaard
bb87e6fabe Do not relayout tabs to the left of clicked close button
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.
2014-09-30 17:05:54 +02:00
Allan Odgaard
5de3b2558a Redistribute tab whitespace to minimize title compression 2014-09-30 17:05:53 +02:00
Allan Odgaard
894314592f Enable tab overflow button before doing layout
This is so that we can use fittingSize during layout (i.e. have it include the width of the overflow button when the tab item view shows it).
2014-09-30 17:05:53 +02:00
Allan Odgaard
62e197a310 Close button for modified tab items was initially hidden 2014-09-30 17:05:53 +02:00
Allan Odgaard
c50ec2da34 Doing tab layout with no selected tab would lose overflow menu 2014-09-30 17:05:53 +02:00
Allan Odgaard
9369777aee Hardcode small system font size as 11
This is because the small system font size is actually the tool tip font size which the user may increase (via the NSToolTipsFontSize defaults).
2014-09-30 17:05:53 +02:00
Allan Odgaard
568017fffc Use message font as the control font 2014-09-30 17:05:53 +02:00
Allan Odgaard
42e1b5fdf0 Use label font for color chooser in file browser context menu
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.
2014-09-30 17:05:53 +02:00
Allan Odgaard
6748c28109 Send performCloseTab:/OtherTabs: directly to tab view delegate
When our application is active but another window is key, trying to send to our tab view’s window (via tryToPerform:with:) goes to the key window.
2014-09-30 14:15:11 +02:00
Allan Odgaard
2462bf8037 Use minimum tab size as tab bar’s intrinsic width
This way we can setup compression resistance to the required priority and thereby ensure that the tab bar fits at least one tab.
2014-09-29 18:23:34 +02:00
Allan Odgaard
d9e8a0fc5e Do not setup Y-centering constraint on tab overflow image
This image already has a fixed position so the centering is redundant and could even lead to ambiguous layout.
2014-09-29 18:23:33 +02:00
Allan Odgaard
1266129f0e Don’t layout any tabs when smaller than minimum tab item width 2014-09-29 18:23:33 +02:00
Allan Odgaard
c88b3e3611 Set “center tab labels” constraint below “fitting size” priority
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.
2014-09-29 18:23:33 +02:00
Allan Odgaard
f079f8a917 Avoid redeclaration of “all views” dictionary 2014-09-29 16:21:05 +02:00
Allan Odgaard
10e370319d Use system’s tool tip font for our custom tool tips 2014-09-29 13:47:32 +02:00
Allan Odgaard
a90acdcbe6 Use convenience methods to setup header/status bar backgrounds 2014-09-29 13:24:52 +02:00
Allan Odgaard
3052a2764b Don’t allow tab bar view to expand beyond its intrinsic height
This makes it easier to constrain other views to the height of the tab bar view, without the tab bar view growing to the height of the other view.
2014-09-29 13:02:15 +02:00
Allan Odgaard
d12e0976d6 Remove OakGradientView 2014-09-29 13:02:15 +02:00
Allan Odgaard
eb20fd8746 Add NSGradient support to OakBackgroundFillView 2014-09-29 13:02:15 +02:00
Allan Odgaard
65cfacd054 Fix issue with our tag property override and the 10.10 SDK
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).
2014-09-28 14:31:42 +02:00
Allan Odgaard
244509586b Closing the overflow tab (via mouse) caused suboptimal relayout
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.
2014-09-27 13:02:46 +02:00
Allan Odgaard
94b7114a10 Remove old tab close button images (for non-modified tabs) 2014-09-27 12:04:56 +02:00
Allan Odgaard
6a7c42b775 Revert "Add “create tab” images from MMTabBarView"
This reverts commit 6a81bad1e4.
2014-09-27 12:04:56 +02:00
Allan Odgaard
923ee59534 Use NSImageNameAddTemplate image for “create new tab” button 2014-09-27 12:04:56 +02:00
Allan Odgaard
96c43146dc Remove redundant code 2014-09-27 12:04:05 +02:00
Allan Odgaard
a983643fb8 Workaround for weak pointers to NSWindow crashing on 10.7 2014-09-26 23:10:24 +02:00
Allan Odgaard
13a3ac49ba Update OakTabBarView class to use an NSView per tab item 2014-09-26 23:10:24 +02:00
Allan Odgaard
baff543c47 Add OakTabItemView to be used in upcoming OakTabBarView 2014-09-26 23:10:23 +02:00
Allan Odgaard
6a81bad1e4 Add “create tab” images from MMTabBarView 2014-09-25 22:48:13 +02:00
Allan Odgaard
cba03ff594 Add tab images from Safari 2014-09-25 22:48:13 +02:00
Allan Odgaard
b7088bac3d Add OakRolloverButton 2014-09-25 22:48:13 +02:00
Allan Odgaard
7ebd14876c Introduce OakBackgroundFillView which replaces NSBox for dividers
This view has an active/inactive color or image. The latter is drawn as a pattern color (tiled image).
2014-09-25 19:33:17 +02:00
Allan Odgaard
1f06ac9ff4 Add identifier to OakTabBarViewDataSource 2014-09-25 19:33:16 +02:00
Allan Odgaard
cf3b830610 Make the ‘expanded’ property of OakTabBarView private 2014-09-20 13:47:30 +02:00
Allan Odgaard
8a87ee16e2 Only allow a single history window per clipboard type 2014-09-15 17:41:54 +02:00
Allan Odgaard
3dcd9ba89b Make OakPasteboard’s name property public 2014-09-15 17:37:20 +02:00
Allan Odgaard
5d4fe11e70 Speedup tool-tip fadeout except when closing due to mouse moved 2014-09-10 15:28:19 +02:00
Allan Odgaard
a4f47a7bfc Use Core Animation for the open document animation (zooming icon) 2014-09-10 13:34:11 +02:00
Allan Odgaard
9d39e80044 Hide OakToolTip interface in implementation file
This isn’t actually a public interface.
2014-09-08 14:47:19 +02:00