Commit Graph

583 Commits

Author SHA1 Message Date
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
Allan Odgaard
b00f01a992 Fix potential exception when deleting rows that show the field editor
The issue is that we call NSWindow’s makeFirstResponder: with the old field editor, but there is no guarantee that the old field editor is still part of the window’s view hierarchy.
2018-10-28 00:28:02 +07:00
Allan Odgaard
cff93ee2cb Do not bypass the type checker when forwarding methods to file browser 2018-10-15 06:11:39 +02:00
Allan Odgaard
a012f4357a Change ‘url’ property to ‘URL’
This seems to follow Apple’s style of uppercasing abbreviations even when they are the first part of a method/property.
2018-10-12 19:38:11 +02:00
Allan Odgaard
866d1f16c3 Go through OakFileBrowser to create new files in directory
This avoids having to support editURL: as public API for the file browser and limits the use of OakFileManager to OakFileBrowser (except for the “deleted item” notification being observed by the document window).
2018-10-12 19:28:01 +02:00
Allan Odgaard
f6fa273912 Update coding style for where to place colon after dictionary keys
This follows the Swift style and also makes it possible to align dictionary values using TextMate’s Align Assignments command.
2018-10-07 09:54:45 +02:00
Allan Odgaard
3d497e9634 Take precautions to make TextMate stay active after opening a document
See comment in the code for further details.
2018-10-05 18:15:11 +02:00
Allan Odgaard
e70791ee89 Rename a bunch of constants to fix deprecation warnings (10.12) 2018-06-16 22:55:30 +02:00
Allan Odgaard
a623b8b6ec Fix typo: NSLeftMouseDown → NSLeftMouseDownMask 2018-06-16 22:42:12 +02:00
Allan Odgaard
c11b81b9da Use MBCreateMenu for a few pop-up menus 2018-04-30 15:30:48 +07:00
Ryan Schmidt
bade4054dc Mark strong properties as strong
Versions of the OS X 10.11 SDK prior to 10.11.4 require this to
be done explicitly. This fixes the build on OS X 10.10 when
using the OS X 10.11 SDK from Xcode 7.2.1 and earlier.
2018-02-06 17:23:26 +07:00
Allan Odgaard
503d493f47 Move OakTabBarView into its own framework
The motivation is to get an OakAppKit that does not include hundres of image resources.
2017-10-07 13:58:35 +02:00
Jake Kirshner
9f1cec343e Add basic touch-bar support 2017-10-03 21:56:54 +02:00
Allan Odgaard
4d86258e47 Use new alert style enumeration names (10.12) 2017-05-31 21:58:31 +02:00
Ronald Wampler
30891b1a62 Remove OakShowAlertForWindow wrapper (10.9) 2017-05-31 10:03:41 +02:00
Archuthan Vijayaratnam
4b844e2769 Update DocumentWindowController.mm
Fixed typo when comparing
2017-03-10 12:22:35 +07:00
Jake Kirshner
d380e7ab0c Added ability to customize document’s title shown in tabs
To change the title, set `tabTitle` in `.tm_properties` to something other than `$TM_DISPLAYNAME`.
2017-03-10 12:22:28 +07:00
Allan Odgaard
944ad3ea5d Rename API: add_callback → push_callback
This makes it clear what is actually done.
2016-11-11 15:47:19 +07:00
Allan Odgaard
f28faeafcb Do not pass bundle items by reference
When executing a bundle item without any default document open, we may first “load” the document, which is done via a callback (for when the document is loaded), and at that time, the bundle item reference has become invalid.
2016-11-04 19:22:39 +07:00
Allan Odgaard
c92e0c42d8 Provide save dialog with document’s file type for encoding settings
Previously the save dialog would update encoding settings solely based on the path, but the user could set different line endings or character set for a file type (rather than extension).
2016-11-02 23:02:18 +07:00
Allan Odgaard
26da9c7e15 Show “add license” titlebar buttons after one hour of use 2016-10-17 10:07:29 +02:00
Allan Odgaard
dc1406e32e Use AND/OR/NOT with NSPredicate instead of the C equivalents
The BNF for NSCompoundPredicate only lists the former keywords, not the C syntax (not that it has caused any problems to use it).
2016-10-10 22:38:05 +02:00
Allan Odgaard
6b93c00371 Tweak how we create the output pop-up menu for Filter Through Command… 2016-10-10 22:38:00 +02:00
Allan Odgaard
2feb4a497a Use crash_reporter_info_t’s convenience constructor
Also change most ‘crashInfo’ variable names to just ‘info’ to be consistent.
2016-10-07 22:14:33 +02:00
Allan Odgaard
37b417f769 Add diagnostics to track down KVO issue
I see the following exception from macOS 10.12 users: Cannot update for observer <DocumentWindowController 0xhhh…> for the key path "selectedDocument.documentEdited" from <DocumentWindowController 0xhhh…>, most likely because the value for the key "selectedDocument" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the DocumentWindowController class.
2016-10-07 22:14:33 +02:00