90 Commits

Author SHA1 Message Date
Allan Odgaard
4b4e5fca8b Remove code required for compatibility with 10.10 and earlier 2019-10-07 21:28:16 +02:00
Allan Odgaard
5e96d41a3d Look for numeric prefix when duplicating a file and increase it if found
For example if we have a directory with files named 001-foo.txt, 002-bar.txt, and 003-fud.txt, duplicating one of these will result in the duplicate starting with 004.

Also improve support for finding dates in file names being duplicated. Previously we only looked for YYYY-MM-DD but now we also support YYYY_MM_DD and YYYYMMDD. If a date is found in the file name being duplicated, it is replaced with the current date in the duplicate.
2019-08-08 21:37:42 +02:00
Allan Odgaard
f33ba968a8 Don’t ignore result from writeObjects: 2019-08-02 21:07:04 +02:00
Allan Odgaard
454b1b4644 Use availableTypeFromArray: instead of checking types array directly 2019-08-02 21:06:21 +02:00
Allan Odgaard
8f685ff25c Use std::clamp instead of oak::cap (C++17) 2019-08-01 10:23:55 +02:00
Allan Odgaard
dae1103728 Update LINK declarations 2019-07-16 19:42:29 +02:00
Allan Odgaard
1c1358bcce Workaround for missing content when expanding file browser items
The workaround is untested, as I have not found a way to reproduce the issue, but there is some debug output that can be reviewed and hopefully give some idea as to what is causing the issue.

The debug information can be collected by running the following in a terminal:

    log show --predicate 'process = "TextMate" AND eventMessage CONTAINS "loadChildrenForItem:expandChildren:"'
2019-07-06 18:18:56 +02:00
Allan Odgaard
11d67f3a22 Avoid NSString’s deprecated percent encoding methods 2019-06-30 10:32:45 +02:00
Allan Odgaard
1ef78b3af7 Rename symbols to what’s expected by the 10.14 SDK 2019-06-29 20:14:15 +02:00
Allan Odgaard
5aa58e5543 Do not include $APP_NAME in framework’s bundle identifier
Since we have multiple application targets, it doesn’t make sense with a global APP_NAME variable.

Though if building the frameworks as standalone bundles and embedding them in different applications, we may need some sort of unique component in the bundle identifier, but we currently do not do this (they are all statically linked, so the Info.plist is currently unused).
2019-06-26 23:32:54 +02:00
Allan Odgaard
b8017b9f22 Do not set NSBackgroundStyleRaised for controls and text in status bars
It appears to be ignored on 10.14 but earlier versions of macOS rendered the elements with a shadow, which is probably not a good fit for our current design.
2018-12-06 22:00:22 +07:00
Ronald Wampler
ca80254b80 Refactor finder tags to use catalog colors
Also, reworked the OFBFinderTagsChooser to have a similar look as on 10.14.
2018-12-05 21:16:54 +07:00
Allan Odgaard
9e3b1d6028 Set wantsLayer to YES for all NSVisualEffectView subclasses
This is required when using NSVisualEffectBlendingModeWithinWindow although on macOS 10.13 and later a view is layer backed by default.
2018-12-04 15:43:15 +07:00
Allan Odgaard
42cdb1c430 Add URL escaping for the path component of SCM URLs 2018-11-22 16:24:17 +07:00
Allan Odgaard
60a3690bef Use NSPasteboard’s writeObjects: when copying items from file browser 2018-11-21 16:24:51 +07:00
Allan Odgaard
892fc536f8 Move outlineView:writeItems:toPasteboard: to view controller 2018-11-21 16:24:51 +07:00
Allan Odgaard
aad3fdaca8 Implement outlineView:pasteboardWriterForItem: for file browser dragging
This is the “modern” API that supports multiple items on the clipboard and gives us a badge to show how many items are being dragged.

Though the default drag image does not resemble Finder nor does it seem to support flocking out of the box (where multiple items are collapsed into a single proxy image).
2018-11-21 16:24:51 +07:00
Allan Odgaard
19f15f97fc Use NSPasteboard’s writeObjects: for file browser’s service menu support 2018-11-21 16:24:51 +07:00
Allan Odgaard
942b962ce5 The gear shown for action pop-up buttons was clipped on 10.14
We wrap the button in view to clip some of the excessive left margin but on 10.14 the dimensions changed so we would also clip some of the gear.
2018-11-20 22:21:50 +07:00
Allan Odgaard
89404715f3 Tweak layout of action buttons in file browser
Avoid setting explicit size of the image buttons and do not stretch the buttons to full height, except for reload, as that image seems to use a different size as our other buttons, and therefor doesn’t align properly.
2018-11-15 16:42:55 +07:00
Allan Odgaard
930619d6e7 Make NSVisualEffectView the superview of our status bars
The result is the same though with the NSVisualEffectView being a superview, a subview can query the interiorBackgroundStyle to affect rendering.
2018-11-15 12:58:06 +07:00
Allan Odgaard
7f794f618d Remove drawRect: overload as we no longer change contentBorderThickness 2018-11-15 12:58:06 +07:00
Allan Odgaard
414e516ea9 Do not use NSBackgroundStyleRaised for views in file browser header
It does not appear to have any effect and is probably (semantically) wrong now that buttons are placed on “header” material (on 10.14).
2018-11-15 11:31:14 +07:00
Allan Odgaard
77280a8ebf Since we center views in file browser header there is no need to stretch
Previously we stretched the views to full height (minus bottom divider) and relied on the views to then center their content, but the back/forward images were not properly aligned (at least on 10.14).
2018-11-15 11:31:14 +07:00
Allan Odgaard
21d003ebc8 File browser view was only observing changes to user defaults on 10.14 2018-11-15 11:31:14 +07:00
Allan Odgaard
c235a61eca Do not enable blending of file browser header until 10.14 2018-11-15 11:31:14 +07:00
Ronald Wampler
444c17f7bf Check the correct return value (-1) when item is not found 2018-11-14 09:23:27 +07:00
Allan Odgaard
b1ae800fdc Show an alert if version control information is unavailable 2018-11-12 19:58:48 +07:00
Allan Odgaard
d27c779c60 Use window color behind file browser (instead of blur)
At least on 10.14 the window color is neither black (in dark mode) nor white (in light mode) and thus works well to give some contrast to the main text view.
2018-11-12 19:30:05 +07:00
Allan Odgaard
c725d60b6c Delay centering selected file browser row till next event loop cycle
Without this, it would sometimes fail when the outline view had to reload and expand items, presumably because updating the frame of the outline view (after reloading/expanding items) is not “instant”.
2018-11-12 19:19:01 +07:00
Allan Odgaard
58aaf36225 Provide a default include glob for file browser
This is not relevant for TextMate, but when the file browser is used in other contexts, it would previously show hidden files, as there was no default include pattern to limit files to only those matching `*`.
2018-11-12 19:16:14 +07:00
Allan Odgaard
663a9a638a Do not blend file browser content with header on 10.11 and earlier
Also disable the blurred background as it is mainly for dark mode, which was introduced in 10.14.
2018-11-06 19:26:08 +07:00
Allan Odgaard
5f63ee096b Remove ability to have file browser header in the tab bar
This style is not easily compatible with moving the tab bar view to the window title.
2018-11-05 19:16:24 +07:00
Allan Odgaard
f242bd67e5 Use NSIsEmptyRect instead of comparing size to NSZeroSize 2018-11-05 19:16:24 +07:00
Allan Odgaard
477d906399 Change accessibility label of folder pop-up button to “Current folder”
The system file dialog has this labelled as “where” but I think “current folder” is more appropriate.
2018-11-05 19:16:24 +07:00
Allan Odgaard
892a6072ae Move OakTabBarStyle to own header
This allows us to make OakTabItemView.h a private header.
2018-11-03 11:17:08 +07:00
Allan Odgaard
4c339ada62 Let file browser scroll view extend behind its header 2018-11-02 10:49:56 +07:00
Allan Odgaard
14ae6019bf Update all instances of accessibilitySetOverrideValue:forAttribute: 2018-11-02 08:40:39 +07:00
Allan Odgaard
80681fc6a4 Add NSVisualEffectView behind file browser when running on 10.11 2018-11-01 14:43:41 +07:00
Allan Odgaard
96d1220e63 Use self.window instead of accessing instance variable of superclass 2018-10-31 23:07:52 +07:00
Allan Odgaard
fa5e3cf869 Remove custom NSCell subclass used for file browser’s folder pop-up
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.
2018-10-30 21:22:13 +07:00
Allan Odgaard
c21387adfb Selecting file outside project (⌃⌘R) would fail 2018-10-30 18:52:30 +07:00
Allan Odgaard
9b70e273d5 Make new file browser’s CreateIconImageForURL public API
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.
2018-10-30 16:10:51 +07:00
Allan Odgaard
fd0ef648e1 Show as many parents as required to disambiguate file browser items 2018-10-30 13:45:38 +07:00
Allan Odgaard
e6ae59976b Remove most of our 10.10 compatibility checks 2018-10-30 12:31:51 +07:00
Allan Odgaard
aa674c08b7 Guard against no file browser root item when updating modified/open URLs 2018-10-30 11:53:35 +07:00
Allan Odgaard
bad84bd511 Tweak how we throttle fetching SCM status
When we observe a change on disk we will fetch status after 0.5 seconds if we are active, otherwise 3 seconds.

If we become active and have a pending update, we update immediately.

The reason for the delay is that the change on disk could be the version control system working, for example performing a rebase, and not all systems can gracefully handle requesting status when in the midst of such operation.
2018-10-29 21:31:56 +07:00
Allan Odgaard
0eb5250c26 Pass directory with changes to FSEvents observer 2018-10-29 19:49:28 +07:00
Allan Odgaard
85d5bb3fbe Fix indentation 2018-10-29 13:34:08 +07:00
Allan Odgaard
493620710b Avoid copying full status map for each file observer 2018-10-29 11:05:00 +07:00