4600 Commits

Author SHA1 Message Date
Allan Odgaard
a3a6b2ac88 No longer use drawer for properties in bundle editor
The drawer interface component is deprecated and does not fully support Dark Mode.
2021-02-09 11:15:51 +01:00
Allan Odgaard
0695ec5a5b Rename property from indent to labelWidth
The latter is a more appropriate description of the property.
2021-02-09 11:15:51 +01:00
Allan Odgaard
8d63cfb5c8 Create bundle editor window in code
When building on macOS 10.15, the split view will show the NSBrowser split as collapsed and not allow the user to resize it, though only when running the build on macOS 10.14 or earlier.
2021-02-09 11:15:51 +01:00
Allan Odgaard
c6a92b2407 Revert "Fix truncated text in tool tips using Dark Mode on macOS 10.15"
The problem has disappeared. I have no idea what changed, though I did not notice the issue until 2-3 weeks ago, and the problem disappeared around the time of last macOS security update, though comparing my machine’s uptime with the time of the commit being reverted, there has been no reboot since that commit.

This reverts commit f74aa3fde8.
2021-02-09 11:15:51 +01:00
Allan Odgaard
f74aa3fde8 Fix truncated text in tool tips using Dark Mode on macOS 10.15
We add a border to the NSTextField in Dark Mode to match the system tool tips, but it appears that the frame returned by “fittingSize” does not take that into account, so it returns a frame 1-2 points too small to fit the text, resulting in the last line missing.

This appears to be a fairly new problem, so might depend on the SDK that we link with.
2021-02-04 22:33:04 +01:00
Allan Odgaard
7e69f5bb2c Fix compiler warnings by initializing struct members in correct order 2021-02-04 09:35:27 +01:00
Allan Odgaard
a02b95ce7b Use public modifier when logging exception name/reason 2021-02-04 09:35:27 +01:00
Allan Odgaard
9393ef61b5 The encoding pop-up button could create an NSMenuItem with nil as title
This would happen when the encoding property was nil (no selection).

Reworked code slightly while also fixing this issue.
2021-02-04 09:35:27 +01:00
Allan Odgaard
fa2077b3c8 Remove non-matching tests/resources definitions from build files
The resources directory was removed when we introduced CP_InfoPlist. The tests were removed in fcee7b38ab.
2021-02-04 09:35:27 +01:00
Allan Odgaard
4d1aa7cba8 Define missing BSTR macro in test source 2021-02-04 09:35:27 +01:00
Allan Odgaard
8e6c60d013 build: Remove Info.plist files from frameworks
These were previously required when we built frameworks as dynamically linked, but the files are now explicitly ignored by our build system.
2021-01-24 10:37:22 +01:00
Ronald Wampler
5168278b2a Set Preferences window toolbar style to NSWindowToolbarStylePreference
This is necessary when linking with the macOS 11.0 SDK.
2021-01-17 14:11:41 +01:00
Allan Odgaard
6b6ff32e99 Avoid compiler warning by typecasting anonymous enum
The warning only appears when the anonymous enum is used in a conditional, hence why we do not need this change for all calls to NSFileTypeForHFSTypeCode.
2021-01-17 14:06:36 +01:00
Allan Odgaard
a7406b832d Use tertiary label color for shortcuts and tab triggers on macOS 10.16
For bundle items we have to decorate the menu items ourselves with shortcut keys and tab triggers, which were previously rendered with the system text color, but starting with Big Sur, it appears to use the tertiary label color, which we now match.
2021-01-15 16:03:03 +01:00
Allan Odgaard
4468362b40 Add leading/trailing padding for the save dialog’s encoding options
On Big Sur, using the compact view, these would extend to the left/right borders of the sheet.
2021-01-15 16:03:03 +01:00
Allan Odgaard
eb59a21ccd Do not set NSWindowStyleMaskFullSizeContentView for clipboard history
Setting this flag means the content view spans the full window size, thus is rendered “behind” the window chrome, which is how we have designed these windows, which hold a scroll view as the main content.

However, starting with macOS 10.16 (Big Sur) the scroll view doesn’t automatically set the top inset to adjust for the title bar (and auxiliary view), at least it has not yet been set, when we adjust the bottom inset, and disable further (automatic) changes of the scroll view insets.

By not setting the full size flag, the content view’s size is limited to the “visible are” of the window, but there seems to be some special detection of full size scroll views, so this one still gets the “full size” effect with content behind window chrome.
2021-01-15 16:03:03 +01:00
Allan Odgaard
bcd44a8d14 Ensure we are running on the main thread when updating property
Since we bind the disabled state of the “Check Now” button (in preferences) to this property, we cannot update the property in a background thread, as the UI can only be updated from the main thread.
2021-01-13 22:59:11 +01:00
Allan Odgaard
8ed4b43b63 Remove “Add License” button from window chrome 2021-01-13 22:59:11 +01:00
Allan Odgaard
53897ce4d5 Improve “estimated time remaining” code for software update
Use int64_t instead of NSUInteger, check against NSURLSessionTransferSizeUnknown, and ensure that completedUnitCount is the last thing we set on the NSProgress object, so that there is no potential race condition with a progress object being completed, but still having a non-zero estimated time remaining value.
2021-01-11 12:09:02 +01:00
Allan Odgaard
f032db7aeb Set lineBreakMode for text fields in OakChooser windows
We already setup proper line break mode for the strings displayed (via paragraph attributes), but having good defaults makes sense, so subclasses can forego setting it.
2020-12-29 15:57:09 +01:00
Allan Odgaard
2c528c31f3 Do not use ‘new metadata only’ option with replaceItemAtURL:…
We want to preserve the existing file’s metadata, although we manually take steps to do so, but no reason to disable the system’s functionality for this.
2020-12-29 15:57:09 +01:00
Ronald Wampler
a52383a099 Set the frame size via NSTitlebarAccessoryViewController's view property
When linking against the macos 11.0 SDK, the view size fails to update.
2020-12-29 15:57:09 +01:00
Jordan Rose
ea09ac026b Add "Close Tabs to the Left" as alternate of "Close Tabs to the Right"
This is useful when working with one set of files in a project, then moving to another set without closing the original set first.

Alternate menu items are pretty subtle, but there are already a lot of ways to close tabs, and I didn't want to clutter the menu further.
2020-12-29 15:57:09 +01:00
Allan Odgaard
b5293ad1df Use Security framework to decode license keys (instead of libressl)
This avoids a third party dependency.
2020-12-28 10:08:40 +01:00
Allan Odgaard
e4e54440b5 Selections from regexp searches would be “anchored”
Normally a selection done via search or double-click will be unanchored, so that the first use of shift-left/right will always extend the selection, as opposed to a selection done with keyboard, where shift-left/right moves the ending of the selection.
2020-09-27 13:57:34 +02:00
Allan Odgaard
0f4a857fd7 Leave out kCTUnderlinePatternSolid because of warning mixing enums
The value of this constant is zero, so it is unnecessary to include.
2020-09-27 13:57:34 +02:00
Allan Odgaard
127f05f6cf Use os_log_error instead of custom debug output macro 2020-09-27 13:57:34 +02:00
Allan Odgaard
cb5d81deef Remove commented debug output lines 2020-09-27 13:57:34 +02:00
Allan Odgaard
0967e31696 Send ‘length’ to attributed string instead of via string property 2020-09-27 13:57:34 +02:00
Allan Odgaard
746b9aba08 Do not declare a few ‘auto’ loop variables as also being ‘const’
This produces a warning with latest Xcode, stating that it produces a copy, as the variable is already const. This does seem a little strange, so it could be a problem with the analyzer, but not marking these variables const shouldn’t affect anything.
2020-09-27 13:57:34 +02:00
Allan Odgaard
7baf2b1ba5 Improve how we add styles when syntax highlighting find/replace strings
We only set underline and strikethrough when those are enabled, and use applyFontTraits:range: instead of explicitly setting the font.

The latter should avoid breaking font substitution, although to be safe, we still call fixFontAttributeInRange:.
2020-09-18 09:27:18 +02:00
Allan Odgaard
b3afd947cf Copying search results are again stored on clipboard as a single string
I have not found it advantageous to get multiple carets when pasting search results, on the contrary, if we have a significant number of results, the multiple carets may impact performance.

This reverts the change that was made in 82593c8824.
2020-09-18 09:27:18 +02:00
Allan Odgaard
4e4d8ff352 File browser’s field editor (rename) would stay after pressing return
This problem started after f1a1e1920f (handling key equivalents in performKeyEquivalent: instead of keyDown:).

It does however not appear that it is necessary to manually handle the return key to activate editing, therefore we have removed handling of this key.

Most likely it was required before view-based table views.
2020-06-12 21:34:40 +07:00
Allan Odgaard
a11625421a Add “Create Link to Items” file browser context menu action
This will create symbolic links to the files on the clipboard.

It is equivalent to holding down control (⌃) when dropping files on the file browser.
2020-06-09 16:48:37 +07:00
Allan Odgaard
621e275b52 Begin-of-line zero-width search results would not show any content
This would happen if searching for an anchor that would match at the beginning of a line, e.g. ‘\A’ or ‘^’, with zero actual characters matched.
2020-06-09 16:48:37 +07:00
Allan Odgaard
0f219bae4b Set (visible) key equivalents for file browser context menu
Some of the items require the key equivalent to be set as “inactive” as menu item keys are “global” and thus need to be unique, and can be triggered even when the view containing the context menu is not active.
2020-06-09 16:48:37 +07:00
Allan Odgaard
6e35cb98e1 Only update file browser menu item titles when it is the explicit target
Previously “Paste Next” in the Edit → Paste submenu could have its title updated to “Move Item Here”, which would never be restored back to “Paste Next”, similarly for regular paste.

This commit also drops the wrappers for the cut:, copy:, paste:, and delete: methods, as these wrappers resulted in a bit of redundancy related to menu item validation.
2020-06-09 16:48:37 +07:00
Allan Odgaard
b0228b9aff Remove redundant target setting from file browser context menu
We set target for all items in the menu during post-processing.
2020-06-09 16:48:37 +07:00
Allan Odgaard
f97946244a Let file browser call copyAsPathname: when seeing ⌥⌘C
We cannot do this via a menu item because this key equivalent is already used for Ignore Case in the Edit → Find → Find Options menu.
2020-06-09 16:48:37 +07:00
Allan Odgaard
f1a1e1920f Handle file browser shortcuts in performKeyEquivalent:
This is called before the main menu acts on keys, and thus allows us to catch keys that are otherwise assigned to menu items.

We only do this when the file browser is first responder, so it should be acceptable to have a few menu keys change behavior in that case.
2020-06-09 16:48:37 +07:00
Allan Odgaard
75a08d141b Use os_log_error when assertions fail 2020-06-07 16:50:18 +07:00
Allan Odgaard
da04968f17 Change target file for OakDebug to not link as a bundle
This was from back when each framework was built independently.
2020-06-05 21:22:50 +07:00
Allan Odgaard
249f365e70 Remove majority of code from OakDebug framework 2020-06-05 21:22:50 +07:00
Allan Odgaard
e141a97d26 Remove include of <oak/debug/OakDebugLog.h> 2020-06-05 21:22:50 +07:00
Allan Odgaard
066acad708 Remove use of WATCH_LEAKS (C++) 2020-06-05 21:22:50 +07:00
Allan Odgaard
e80ef1d0b7 Remove use of OBJC_WATCH_LEAKS 2020-06-05 21:22:50 +07:00
Allan Odgaard
b63441b648 Remove commented debug statements 2020-06-05 21:22:50 +07:00
Allan Odgaard
95655fbe18 Move BSTR macro to crash/info.h 2020-06-05 21:22:50 +07:00
Allan Odgaard
44fbea7dc6 Avoid using BSTR macro in OakDocument.mm
This is a debug macro that shouldn’t be used by non-debug code.
2020-06-05 21:22:50 +07:00
Allan Odgaard
bfd1bcf3f0 Remove ‘to_s’ functions previously used by log statements 2020-06-05 21:22:50 +07:00