Commit Graph

4625 Commits

Author SHA1 Message Date
Allan Odgaard
3c611f00c9 Autohide scrollbar in file browser
By default, scrollbars are hidden on macOS when using a trackpad, but for mouse users, or people with scrollbars set to always visible, this is probably preferable (all other scrollviews in TextMate use autohiding scrollbars).
2021-03-25 08:25:44 +01:00
Allan Odgaard
7f9fe4cd90 Change NSCompositingOperationSourceOver to NSCompositingOperationCopy
This is when we know the destination is “empty”, so we might as well pick the simpler copy operation.
2021-03-25 08:20:35 +01:00
Allan Odgaard
2b7a30205d Remove OakBackgroundFillView’s support for NSImage
This was used for the gradient/color bar separators many OS versions ago.
2021-03-25 08:17:41 +01:00
Allan Odgaard
a24b0524ad OakTabBarViewController: No implicit animation when re-ordering tabs
This is only relevant when using the binding interface, instead of manual reload.

The tab bar cannot do an animated relayout when tabs are re-ordered. It probably should detect this itself, and skip the animation, though the animation group is setup in the controller, so this would still cause some side-effects.
2021-03-22 21:41:37 +01:00
Allan Odgaard
c723a9f5d2 Fix dependency: OakTextView needs to link with Find framework
This is because we use the Find singleton and FindMatch class.
2021-03-16 21:12:03 +01:00
Allan Odgaard
33f07d7fb4 Remove OakDebug.tmbundle
Majority of this is no longer used.
2021-03-16 21:07:34 +01:00
Allan Odgaard
9dad220cbd Include ‘attr.project.rave’ in scope when project has a ‘default.rave’ 2021-03-16 21:02:58 +01:00
Allan Odgaard
dfff5d27e3 The Open With submenu item is a shortcut for opening with default app
This is only when the default application is not TextMate.

Ideally the regular “Open” item would change to “Open With «application»” when the selected items are not text documents, and there is an application to handle them, but the code changes required for this are non-trivial because what the item does, is not decided until the user triggers it, and it may not treat all selected items the same.
2021-03-08 12:25:54 +01:00
Allan Odgaard
4324aaf341 Rework API for the Open With submenu
The API expose a few more implementation details and require the user retains the delegate for the duration of the menu’s lifecycle.

The upside is that we avoid the global singleton and it is now possible to examine and use the information gathered by the Open With menu delegate.
2021-03-08 12:25:54 +01:00
Allan Odgaard
f533019eaf Better property names for Open With application info 2021-03-08 12:25:54 +01:00
Allan Odgaard
3453bddac6 Ensure ⌘⌫ / [⌥]⌘V are not sent to file browser with focused text view
Due to the high priority menus have in the responder chain, we effectively cannot have context menus with key equivalents, if these menu items have explicit targets.

We need the explicit targets so that the context menu works when the application is not the active application.
2021-03-08 08:23:54 +01:00
Allan Odgaard
b2b4d12009 Add some left padding to icons in bundle editor 2021-03-07 13:44:43 +01:00
Allan Odgaard
20e3444d16 Clip NSBrowser border in bundle editor on macOS 10.15 and earlier 2021-03-07 13:44:43 +01:00
Allan Odgaard
eb2c26a88f Collapse the browser in the bundle editor when its height gets below 50 2021-03-07 12:14:34 +01:00
Allan Odgaard
8496e62f3a Use split view in bundle editor between properties and editor 2021-03-07 12:12:43 +01:00
Allan Odgaard
fed09bd6dc Add bundle editor views directly to the properties container view
There was no reason for the extra subview.
2021-03-07 11:47:58 +01:00
Allan Odgaard
ae34471c95 Set default split view position after restoring window frame size
We set the default position to a fraction of the split view height (rather than absolute value), so this is only if scaling is not done proportionally, and only when there is no saved split view size.
2021-03-07 11:42:26 +01:00
Allan Odgaard
f043952b4b Use “pane splitter divider” between bundle editor text view and browser 2021-03-07 11:39:57 +01:00
Allan Odgaard
9a416e5386 Ensure we do not mutate array while performing fast enumeration 2021-03-07 11:37:46 +01:00
Allan Odgaard
651db91d05 Update resizing mask for bundle editor nibs
They are now all set to have resizable width.
2021-03-07 10:01:47 +01:00
Allan Odgaard
b5c7170d9a Implement cancelOperation: for HTML output window (close via escape key) 2021-03-07 07:55:07 +01:00
Allan Odgaard
52d5239537 Change HTML output window back from NSPanel to NSWindow
The problem is that if another panel opens, that panel is not tied to our HTML output window, for example opening the Find dialog does not allow us to press return to search in the HTML output, and if we open a modal dialog, when that modal dialog is disposed, the *main window* will be brought to front (not the previously focused panel).

This effectively reverts commit 92953099e6.
2021-03-07 07:39:50 +01:00
Allan Odgaard
4d7eeeb383 Ensure ⌘Z / ⇧⌘Z are not sent to file browser when it does not have focus
Since the context menu is outside the normal view/responder hierarchy, it can receive key events even when file browser is not the active view.
2021-02-25 21:23:50 +01:00
Allan Odgaard
94d3b9b670 Remove old build files 2021-02-15 16:01:50 +01:00
Allan Odgaard
f7d765ba0e Add build files (for new build system) 2021-02-15 16:01:50 +01:00
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