Commit Graph

86 Commits

Author SHA1 Message Date
Allan Odgaard
c874a81246 Indicate cell prefersTrackingUntilMouseUp
Not really sure if there is any difference, but at least with this, the table view should expect trackMouse:inRect:ofView:untilMouseUp: to run a local event loop (until NSLeftMouseUp).
2013-01-21 15:03:52 +01:00
Michael Sheets
6970031245 Restyle navigation bar to be more in line with Lion.
- The shading is a combination of the scope bar and textured button used in Lion/Mountain Lion.
- Add an inactive state.
- Increase click area of the forward/back buttons while decreasing the image size.
- Switch popup menu cell to NSBackgroundStyleLight, previously the text would go to gray when inactive this prevents that though it does lose the drop shadow.
- Various tweaks to alignment and spacing.
2013-01-21 00:38:26 -06:00
Allan Odgaard
19030a7586 Use file’s existing icon when zooming it 2013-01-20 12:49:33 +01:00
Allan Odgaard
0562d22716 Ensure we remove ourself from all observing
The file browser was still observing FSItemDidReloadNotification in its dealloc. Prior to ARC we used ‘self.outlineView = nil’ which removed us as observer, but after ARC we no longer execute that line.
2013-01-20 12:49:28 +01:00
Allan Odgaard
4f4a56fd7a Make OFBPathInfoCell a public class
This is temporary — if it should remain public, we should rename it and move it to the OakAppKit framework.
2013-01-18 15:45:43 +01:00
Allan Odgaard
701e26997e Fix typo in enum value 2013-01-18 15:45:43 +01:00
Allan Odgaard
d40a1fa431 Switch to generated properties 2013-01-18 15:45:43 +01:00
Allan Odgaard
3564746260 Add folder’s display name to menu items
This is only for the menu which shows when there is no selection.
2013-01-17 09:16:04 +01:00
Allan Odgaard
af8d8d3dbb Show in Finder works for multiple selected items 2013-01-17 09:16:04 +01:00
Caleb Land
cca891d74c Add “Show in Finder” context menu when no items are selected
When you control-click the empty part of the file browser and select “Show in Finder” a Finder window will open showing the currently selected folder.

You can go about this other ways, but I find that this feature complements the already existing "New Folder" menu item in the no-items-selected context menu of the file browser.

This patch is public domain.
2013-01-17 08:39:00 +01:00
Allan Odgaard
d7661fc7bb Picking “Other…” in file browser would stick
Issue #673.
2013-01-16 04:42:51 +01:00
Allan Odgaard
69904bef75 Improve look of navigation bar 2013-01-16 04:40:20 +01:00
Allan Odgaard
cd153b6605 Let selectURLs:expandChildren: deselect all
It also clears the history of non-visible items that was left selected.
2013-01-13 11:56:07 +01:00
Allan Odgaard
64f0f209da Using Go → Enclosing Folder selects the child
This is consistent with how Finder works and I think this is desired behavior to sort of track where we came from.
2013-01-13 11:56:07 +01:00
Allan Odgaard
c78c758c4a Remember current file browser selection in session data
This ensures that we restore the selection for the currently visible folder on relaunch. Selections in other folders is lost, see previous commit for more info.
2013-01-13 11:56:06 +01:00
Allan Odgaard
06fea983fc Don’t keep selected items in defaults
This means the set of selected file browser items is reset on relaunch — I’ve found that restoring selection when navigating to a folder was often not really desired.
2013-01-13 11:56:06 +01:00
Allan Odgaard
9167035ad9 Don’t reload file browser for non-visible files
Previously we would reload the changed entries, if they were all visible, falling back on a full reload if not.

If items are not visible there should be no reason to do a full reload — I imagine the thinking was that the NSOutlineView may have previously fetched (and cached) one of the non-visible items (since one of its ancestors could just be collapsed). Since this is just a display attribute, it shouldn’t matter, even if the NSOutlineView would work like this.
2013-01-13 11:56:06 +01:00
Allan Odgaard
65a279802d Rename function name
We not only convert between NSArray and NSSet, but also the type of the contained object (NSURL ⇔ NSString).
2013-01-13 11:56:05 +01:00
Allan Odgaard
8be514ccb2 Rename byExpandingAncestors: → expandChildren:
We are expanding the children of the root item to select the provided URLs.
2013-01-13 11:56:05 +01:00
Allan Odgaard
5e291d8a22 Improve QuickLook support
Preview can now be initiated with multiple items and while the preview panel is showing, one can use arrow up/down to switch to other items (in the file browser).
2013-01-12 13:09:19 +01:00
Allan Odgaard
d6759dc9df Tidy up OakFileBrowser 2013-01-12 13:09:19 +01:00
Allan Odgaard
be1cfeb458 Improve file browser API
We now expose the root URL and allows mutating it.

We also provide the selectURL:withParentURL: method instead of the two showURL: and revealURL:.
2013-01-12 13:09:19 +01:00
Allan Odgaard
0ed119122f Refactor “reveal file” methods
Both methods are now based on selectURL:withParentURL: which contain the necessary checks (file already visible? parent actually valid?).
2013-01-12 13:09:18 +01:00
Allan Odgaard
15409e2eec Rename pushURL: → goToURL:
Also change showURL: calls into using goToURL: (when we know the URL is not a non-directory file URL that should be selected).
2013-01-12 13:09:18 +01:00
Allan Odgaard
10ef2f1034 Rename property (location → path) 2013-01-12 13:09:18 +01:00
Allan Odgaard
c323486250 Merge history controller into OakFileBrowser 2013-01-12 13:09:18 +01:00
Allan Odgaard
49c587e6bd Do not track recent locations 2013-01-12 13:09:18 +01:00
Allan Odgaard
b4066afc9a Omit recent items from file browser menu
This is a feature I have never used myself and it was somewhat limited by having the recent locations unique for each window.

If the feature should be revived it should be via a globally shared list of recent locations (and should persist across relaunch).
2013-01-12 13:09:18 +01:00
Allan Odgaard
5224d0b89c Refactor OFBHeaderView 2013-01-12 13:09:17 +01:00
Allan Odgaard
73e18d30db Merge OFBView into main controller
Using an NSView subclass wasn’t justified.
2013-01-12 13:09:17 +01:00
Allan Odgaard
87f1c109d3 Proper delegate/datasource removal 2013-01-12 13:09:17 +01:00
Allan Odgaard
3427639993 Switch to generated properties
Also remove implementation details from public header.
2013-01-12 13:09:17 +01:00
Allan Odgaard
f3f0f577bf ARC: Update OakFileBrowser framework 2013-01-12 13:09:17 +01:00
Allan Odgaard
f3c8b589b5 Replace OakStatusBar with OFBHeaderView
Presently this is non-functional but removing the OakStatusBar.h dependency makes it easier to convert to ARC, so that’ll be the next step, before actually making OFBHeaderView functional.
2013-01-12 13:09:17 +01:00
Allan Odgaard
f5ac423ecf Remove instance data from interface 2013-01-12 13:09:16 +01:00
Allan Odgaard
772e7ae1b4 Use weak pointer for file browser’s delegate 2013-01-09 02:59:18 +01:00
Allan Odgaard
293d9a8e46 Ensure DisplayName doesn’t return nil
Although I don’t know when it would return nil, issue #649 indicates that it sometimes does. We now fallback on the full URL in this case (and returning ‘«nil»’ if the url itself is nil). This should give a hint about what file system entries would fail to return a display name.
2013-01-08 22:48:06 +01:00
Jacob Bandes-Storch
b277613ecd Add "Reveal Current Document" command
This reveals the current document in the file browser, by expanding directories to reach it, rather than changing the root directory of the browser.
2013-01-08 22:48:06 +01:00
Jacob Bandes-Storch
2162082f37 Move FS utility funcs from OFB to a separate file 2013-01-05 04:21:17 +01:00
Allan Odgaard
47fa0f040c Use Objective-C literals for YES/NO 2013-01-02 01:46:48 +01:00
Allan Odgaard
33e11aedb0 Add copyWithZone: to OFBPathInfoCell
This is mainly to manually copy-construct the C++ instance counter that we use (in debug mode) to track leaks (or an erroneous extra release).

For good measure we also set the spinTimer instance variable to nil. Though this functionality isn’t presently used, so hasn’t actually caused a problem.
2012-12-28 02:47:19 +01:00
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Joachim Mårtensson
b03ee2f6ee Use same mechanism to limit redraw in modifiedURLs 2012-12-14 18:03:37 +01:00
Joachim Mårtensson
417ecef624 Refactored calculations of touched filebrowser items into its own method 2012-12-14 18:03:36 +01:00
Joachim Mårtensson
d983d5a5d2 Limit file browser refresh on open/close
If changes are limited to visible rows, we only reload these.
2012-12-11 17:52:16 +01:00
Allan Odgaard
c995b758c8 fixup! Allow disabling document status in file browser
If ‘location’ was nil, we would implicitly create a std::string from that, which is not allowed (and crashes).
2012-11-14 11:18:51 +07:00
Josh Goebel
dc34d5c9d9 Allow disabling document status in file browser
Disabling this is achieved by setting `fileBrowserDocumentStatus` to `false` in `.tm_properties`.

Disabling it should remove potential delays after opening, closing, and saving files when file browser is showing a lot of files. It is meant as a temporary workaround until the performance issues are addressed.
2012-11-12 13:28:34 +07:00
Allan Odgaard
e1fc3993f0 Improve editor performance when file browser show lots of stuff
Delays may still be experienced when a file is opened or its “modified” state is changed but general edits should no longer be affected by how much is showing in the file browser.

This addresses issue #463.
2012-09-26 00:26:01 +02:00
Allan Odgaard
a0c4af64bd Remove trailing whitespace
Only removed from non-empty lines.
2012-09-25 14:16:50 +02:00
Allan Odgaard
56ec46e1f9 fixup! Avoid using objc_ptr 2012-09-21 01:32:41 +02:00