Commit Graph

607 Commits

Author SHA1 Message Date
Allan Odgaard
d63f12993f Use class properties for general, find, and replace pasteboard instances 2020-04-14 12:58:10 +07:00
Allan Odgaard
61ec959b37 Change data type of file browser state from dictionary to opaque object
This gives us more flexibility in how we wish to represent the state, although the state should be a property list object.
2020-04-14 12:58:10 +07:00
Allan Odgaard
4013020b14 Use dot syntax for NSNumber’s boolValue property 2020-04-14 12:58:10 +07:00
Allan Odgaard
6c692099ff Change OakTabBarView to use tab item’s identifier in drag’n’drop API
This is instead of passing instances of the “internal” OakTabItem class.
2020-04-14 12:58:10 +07:00
Allan Odgaard
3cde965415 Make OakTabBarView’s selectedTabIndex a r/w property but no KVO support
The property returns NSNotFound when there is no selection. This seems to be consistent with NSArrayController’s selectionIndex (but inconsistent with many other views, like NSTableView, which return -1 when there is no selection).
2020-04-14 12:58:10 +07:00
Allan Odgaard
e3bd910e8c Change type of tab identifier from NSString to NSUUID
While AppKit identifiers are generally strings, which have more flexibility, I think this is mainly because NSUUID was introduced later, and for tab items, identifiers must be unique, which is not enforced (or implied) when using strings.
2020-04-14 12:58:10 +07:00
Allan Odgaard
67694d1b5a Use OakCreateNSBoxSeparator() in main (document) window 2020-04-14 12:58:10 +07:00
Allan Odgaard
d7ec9e6690 Use OakCreateNSBoxSeparator() for live search and grammar installation
This is instead of the more opaque OakCreateHorizontalLine(OakBackgroundFillViewStyleDivider).
2020-03-29 10:21:30 +07:00
Allan Odgaard
3428c5cdfb Fix missing default folder location for new file browser windows 2020-03-20 15:06:23 +07:00
Allan Odgaard
66bfb817d6 Set NSWindowAnimationBehaviorDocumentWindow for our document window 2020-02-29 13:18:55 +07:00
Allan Odgaard
aff1273d53 Context menu items for tabs would be disabled in full screen mode
Apparently the window’s delegate is not used for context menu actions in full screen mode, although NSApp’s targetForAction: does find the receiver, so this appears to be a framework bug.
2019-10-27 15:20:14 +01:00
Allan Odgaard
079377ed49 Require macOS 10.12 and remove compatibility checks 2019-10-07 21:28:16 +02:00
Allan Odgaard
3c7895f578 Simplify code by using NSOffsetRect 2019-10-06 10:35:55 +02:00
Allan Odgaard
36dc1374f9 Revert "Add debug output when TextMate is activated via mate"
This reverts the following 3 commits:

- commit 306d46ec71
- commit eecfe6e619
- commit 2ffc74ad8b
2019-08-26 21:19:17 +02:00
Allan Odgaard
306d46ec71 Add even more debug output for when TextMate is activated via mate 2019-08-21 11:51:26 +02:00
Allan Odgaard
dae1103728 Update LINK declarations 2019-07-16 19:42:29 +02:00
Allan Odgaard
eecfe6e619 Add more debug output for when TextMate is activated via mate
Related to 2ffc74ad8b
2019-07-16 08:33:05 +02:00
Allan Odgaard
2ffc74ad8b Add debug output when TextMate is activated via mate
Some users report a significant delay from executing mate until the TextMate window is brought to front.

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

    log show --predicate 'subsystem = "com.macromates.TextMate" && category = "BringToFront"'

Alternatively use `stream` instead of `log` to get a live stream of debug output.

See `man log` for options such as `--start date/time` (to limit the query to e.g. the last 10 minutes)
2019-07-13 10:20:09 +02:00
Ronald Wampler
b1fdd4377b Allow customization of DocumentWindowController touch bar items 2019-06-30 10:32:45 +02:00
Ronald Wampler
2294d369d0 Add accessibility support for DocumentWindowController's touch bar 2019-06-29 19:21:45 -04:00
Ronald Wampler
d8b17a1f06 Let DocumentWindowController's touch bar support nested touch bars 2019-06-29 19:21:45 -04: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
b5b36a558b Add missing framework dependencies 2019-06-26 13:21:11 +02:00
Allan Odgaard
1a1a910c92 Introduce find dialog delegate instead of using project identifier 2018-12-06 22:00:22 +07:00
Allan Odgaard
7030b0041e Update documents array and selected document inside animation group 2018-12-02 18:08:38 +07:00
Allan Odgaard
f244e223fd Rename a few menu items 2018-11-20 22:21:50 +07:00
Allan Odgaard
180dfb971f Make document window controller’s document array a read only property
This is because we may sometimes want to enable implicit animations when updating this property, by making it read-only we limit places from where it can be updated, to make it easier to audit the code.

Currently no-one outside the class actually uses the property, so we could (and may) make it private.
2018-11-19 09:42:33 +07:00
Allan Odgaard
79172d552e Set controlSize on NSControl instead of its cell 2018-11-17 20:20:55 +07:00
Allan Odgaard
f95c68475d Use systemFontSizeForControlSize: when changing button’s control size 2018-11-17 11:35:40 +07:00
Allan Odgaard
efde68385f Remove unnecessary property 2018-11-15 16:17:21 +07:00
Allan Odgaard
162c499e91 No need to set view’s next responder to its view controller (10.10) 2018-11-10 15:31:54 +07:00
Allan Odgaard
38f892b496 Use values from NSWindow to calculate the cascade offset for new windows 2018-11-07 15:28:43 +07:00
Allan Odgaard
e830f6600c Hide tab bar view using the view controller’s hidden property (10.12)
For users on an OS earlier than 10.12, the tab bar will always be visible, even when configured to not show for windows with only a single document (tab).
2018-11-07 15:28:43 +07:00
Allan Odgaard
1e71ce0855 Use hypot function to calculate mouse drag distance
Also update the threshold from 1.0 to 2.5 pixels, as that was already used a few other places, and a single pixel’s threshold seems low.
2018-11-06 17:27:07 +07:00
Allan Odgaard
1d41f708e0 Move tabs to title bar 2018-11-05 19:16:24 +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
d8b0801a63 Update selected tab index when tab bar has no selected tab
Currently OakTabBarView defaults to selecting first tab, but we shouldn’t assume that.
2018-11-05 19:16:24 +07:00
Allan Odgaard
1350c4c904 Send performClose: to window delegate instead of to OakTabBarView
This is in preparation of moving the tab bar view out of the window content view and into the titlebar.
2018-11-05 19:16:24 +07:00
Allan Odgaard
a03c2afd66 Add missing include 2018-11-05 19:16:24 +07:00
Allan Odgaard
10ef832b37 Rename setSelectedTab: → setSelectedTabIndex: 2018-11-05 19:16:24 +07:00
Allan Odgaard
e2b0d44ce2 Do not open document in existing project if option key is down 2018-11-01 11:49:01 +07:00
Allan Odgaard
1cbaf05615 Set titlebarAppearsTransparent for main window
This makes the title bar render in the same color as it did prior to building on 10.14, so that the current tab colors match.

It does however make sheets appear from “above” the title bar and makes the Dark Mode style darker, so this is just an intermediate fix until the tab bar gets revamped for 10.14.
2018-11-01 00:10:20 +07:00
Allan Odgaard
4e5f5f71a2 Use beginSheetModalForWindow:completionHandler: over deprecated API 2018-10-31 23:10:31 +07:00
Allan Odgaard
0d75927528 Update OakFileBrowserDelegate protocol to new file browser controller 2018-10-28 13:36:33 +07:00
Allan Odgaard
7cf482fe25 Rename notification constants 2018-10-28 13:32:14 +07:00
Allan Odgaard
c822943b93 Move OakFileBrowser delegate protocol and constants to new file browser 2018-10-28 13:15:39 +07:00
Ronald Wampler
e64b09b688 Introduce overloads for the new divider styles
Also, switch to use the new divider styles in most places. The remaining usage of the old "OakCreateLine" functions are in the OakChooser windows. These will be refactor for better dark mode support next.
2018-10-28 11:07:03 +07:00
Allan Odgaard
83a0d66563 Add some additional defaults for Filter Through Command
The ‘seq 100’ command is useful with columns selections / multiple insertion points to enumerate items.
2018-10-28 10:15:56 +07:00
Allan Odgaard
e26b8ea868 Switch to new file browser 2018-10-28 10:15:56 +07:00
Allan Odgaard
fcf9ae3aa2 Don’t move focus to text view by default when opening/closing documents
For example when implicitly opening documents because we are duplicating the active document in the file browser, or closing a document because its file got deleted in the file browser, we want focus to stay in the file browser.

Previously we refocused the file browser when closing documents as a result of deleting files.

For duplicating files, this seemed to work because the file browser would not start editing the new file name until it had detected disk changes, thus it would happen after a slight delay.
2018-10-28 00:28:02 +07:00