Commit Graph

756 Commits

Author SHA1 Message Date
Allan Odgaard
a9e0b3583f Fix missing open / modified status in file chooser
This only worked for untitled files since we no longer keep document UUIDs for documents with a path.
2013-01-28 12:42:28 +01:00
Allan Odgaard
80b27f0b28 Add method for searching file browser folder 2013-01-28 12:42:27 +01:00
Allan Odgaard
25cfc61f9f Fix “Go to Favorites” (wrong URL used)
The URL constant for the favorites location was setup using oak::application_support() but done before the app support folder was initialized (due to the setup function being marked as a constructor).
2013-01-28 12:42:27 +01:00
Allan Odgaard
4dccc12945 Add method to move focus to document or file browser 2013-01-28 12:42:27 +01:00
Allan Odgaard
164aef5323 Use horizontal/vertical line creators 2013-01-28 12:42:27 +01:00
Allan Odgaard
a1a2e23ca9 Add helpers to create lines
With this we can create either a horizontal or vertical line, and don’t need to manually set a constraint for its width/height.
2013-01-28 12:42:27 +01:00
Allan Odgaard
61fd5d04df Position file chooser relative to text view
This is instead of placing it relative to the entire window. The main motivation is that with the file browser on the right, I want the file chooser closer to the left edge of the window.
2013-01-25 17:44:17 +01:00
Allan Odgaard
ece57c79b8 Tab bar collapsing now disabled by default 2013-01-25 17:44:17 +01:00
Allan Odgaard
7a5294936c QuickLook preview panel now zooms in/out 2013-01-25 17:44:17 +01:00
Allan Odgaard
a935aff340 Going to SCM status has the groups expanded
Previously these would not initially be expanded but the expansion state remembered. Now that we regularly clear cache of expanded URLs, it’s more tedious regularly having to expand these two groups.

It also introduce new API for having data sources return what items should be initially expanded, which probably makes sense for some data sources.
2013-01-25 13:49:16 +01:00
Allan Odgaard
5c1eb0ae3e Use command name as title for output windows
The command can set a custom title so this is only for commands that doesn’t do that.
2013-01-25 13:15:36 +01:00
Allan Odgaard
694b6defd8 Handle untitled documents when filtering on path
These would previously be prefixed with the project folder path. Now they get no prefix (and disappear when the path-part of the filter string is non-empty).
2013-01-25 13:15:35 +01:00
Allan Odgaard
5adc29189e Drop other expanded folders when revealing item
We probably should only drop expanded folders which descend from the current root, but that’s more code and the implemented behavior could be seen as “garbage collection” (keeping the memory of expanded folders low).
2013-01-25 13:15:16 +01:00
Steven Clukey
c7035ded44 Added force open in TextMate and fixed confusion when opening an alias.
Any file should be able to be opened within TextMate, so
Option-DblClick will always do that. I first noticed this with .xib
files.
Because of the order of the if statements, opening an alias to a
package or binary file (or .xib) would not have the previous if
statements applied to it.
2013-01-25 13:15:16 +01:00
Michael Sheets
a7564b924c Add inactive state coloring for dividers. 2013-01-25 06:00:09 -06:00
Michael Sheets
7e472b5162 Enable focus ring when 'Full Keyboard Access' is enabled.
For aesthetic reasons the focus ring is disabled as there is no other control that can be active, however this is not the case with full keyboard access enabled as you can tab through the scope bar as well.
2013-01-25 04:18:11 -06:00
Allan Odgaard
065e9a0f13 Also use primary color when window is key
Windows like the file chooser never becomes main, so testing if window is main alone is not enough.
2013-01-25 11:01:57 +01:00
Allan Odgaard
3aea7c991a Don’t play sound when renaming files 2013-01-25 11:01:57 +01:00
Allan Odgaard
2ae9463e6e Lowercase icon file name
This corresponds to how it is spelled in the file type bindings file (although nothing actually uses this icon).
2013-01-25 11:01:57 +01:00
Allan Odgaard
4b87e3cafe Fallback on main bundle for svn_status.xslt
Ideally we would use something like “inSameBundleAsClass:’, but as we don’t have any classes in the SCM framework, that is not possible.
2013-01-25 11:01:57 +01:00
Allan Odgaard
7d02a67870 Remove unused graphics 2013-01-25 11:01:57 +01:00
Allan Odgaard
8821794e3e Remove unused category methods
Long-term I want to get rid of all category methods. Adding methods to system classes is bad.
2013-01-25 11:01:56 +01:00
Allan Odgaard
fe08871c45 Inline deselectExtension code in OakSavePanel
The code is tweaked a bit compared to the category method we inlined.
2013-01-25 11:01:56 +01:00
Allan Odgaard
a7a6f29f3f Add HTML URL field to bundle_t 2013-01-25 11:01:56 +01:00
Allan Odgaard
f8fa69d8b4 Calling setting_t::set with NULL_STR restores the default 2013-01-25 11:01:56 +01:00
Steven Clukey
d25c07f3a4 Added ability to set default type to use for unknown documents. 2013-01-24 12:13:24 +01:00
Allan Odgaard
c467e9ab97 Our divider line view can now handle secondary color
This is used when the window is not main (if provided).
2013-01-24 11:42:33 +01:00
Allan Odgaard
54eb357eb9 Opening folders is added to recent menu
This behavior was lost while reworking the document window class, closes #701.
2013-01-24 11:39:03 +01:00
Allan Odgaard
3026480a0d Clear file chooser filter string
Now that we re-use the window we need to manually clear the filter string (from last use).
2013-01-23 21:18:32 +01:00
Allan Odgaard
a67866ddb7 Provide singleton API for FileChooser
You can still create multiple instances, but would generally not want to.
2013-01-23 18:56:33 +01:00
Allan Odgaard
0467ce6bb4 Make file chooser a floating panel
Also disable our “render as active” code for the table view when the window is not key.
2013-01-23 18:56:33 +01:00
Allan Odgaard
8e7de5e4ad Only underline matched characters
We now drawn the full string with same color and font.

Path shown in status bar is not marked up at all.
2013-01-23 18:56:32 +01:00
Allan Odgaard
f0f64ccde4 Change some default settings
- File browser placed on right.
- HTML output placed in new window.
- Theme set to Twilight.
2013-01-23 18:56:32 +01:00
Allan Odgaard
b1f9259cec Render table view as having focus 2013-01-23 13:44:51 +01:00
Allan Odgaard
127ef7e9eb Files with no extension open as plain text
This is instead of asking the user.
2013-01-23 12:36:48 +01:00
Allan Odgaard
49bb52c812 Improve scroll when selecting units
When selecting a unit (Edit → Select submenu or e.g. Find Next) then we only scroll if we can make the entire selection visible.

Closes #692.
2013-01-23 12:36:47 +01:00
Allan Odgaard
16da0b5d76 Don’t open documents with a path via UUID
The UUID is a unique reference to a document that trumps the path. However, as we don’t actually keep the documents in the file chooser, we end up with UUIDs from documents that does not exist, and should a new document be created for the same path, it will get another UUID.
2013-01-23 12:36:47 +01:00
Allan Odgaard
67ebb34f23 Fix unreliable tab switching keys
This was broken by 645f8d91e1.

The issue is that if the user press a key not in our managed menu, then the menu delegate will no longer be asked to update the menu for keys not in this (cached) menu.

Example: If there are items for ⌘1-3 in the menu and the user press ⌥⌘N a few times (to create more tabs), then the delegate is asked to update the menu on the first press, but as ⌥⌘N is not in the menu, successive events will not cause the menu to be updated. If the user then press ⌘5 (to go to the 5’th tab), nothing will happen, because our menu only holds 3 items, and the delegate is not asked to update the menu.
2013-01-23 12:36:47 +01:00
Michael Sheets
39ecb522d7 Improve layout and styling of Go to File window.
- Remove focus ring from search field as there is no second target.
- Set top and bottom border widths for the textured window.
- Remove miniaturize and zoom buttons for lack of utility.
- Match name of window to menu command.
- Various color and spacing tweaks.
2013-01-23 05:13:26 -06:00
Allan Odgaard
4f07b95556 Add scope bar to file chooser 2013-01-23 09:33:35 +01:00
Allan Odgaard
c8ab123aaf Move font name/size to theme_t
Since styles_for_scope effectively ignore the font parameters (and instead return styles based on the font parameters used when the cache entry was created) it is a better design to have theme_t own the font. This way, changing it can do the proper cache invalidation.

A minor downside is that we can now change the font of the theme without also changing the layout’s font, which wouldn’t cause proper layout invalidation — since layout_t owns theme_t though, users of a layout should always change font via layout_t (which will then change it in the theme).

Also, themes cannot be shared between views that wish to use different font settings.
2013-01-23 09:33:29 +01:00
Allan Odgaard
30c60ddc34 Accept scope_t instead of context_t
Since styles are applied to the actual content, we only have a single scope, not a left/right scope.
2013-01-23 08:19:39 +01:00
Allan Odgaard
aa71b7ccf0 Adhere to naming convention
Given constraint-based layouts, we’re more likely to create views in code, and as helper functions are often involved, it makes sense to name them so that we can quickly get a list of all helpers (via search), either for copy/paste or for evaluating wether or not it makes sense to move all helpers to a single library.

Since helpers are declared with static storage, they do not pollute the global namespace.
2013-01-23 08:19:39 +01:00
Joachim Mårtensson
2b51ca93bd Don’t use font name / size as key values in style cache
Font name and font size was being used in the cache key as a way to avoid having to do cache invalidation. This comes at a price of a 3X slow down. Instead clear the cache when font size/name changes. Excessive font name/size switching should be deterred IMO, why not with slowdowns? so no real downside. This does not affect themes setting font name/size, as they are handled by another mechanism.
2013-01-23 08:04:17 +01:00
Allan Odgaard
ef012c90f2 Add undo support to file browser
This closes #17.
2013-01-22 19:57:02 +01:00
Allan Odgaard
658c17023b Use menu validation instead of manual disabling items
This is required if some of the menu item targets are not ‘self’ as we do not know if these targets can handle the action method.
2013-01-22 19:56:18 +01:00
Allan Odgaard
f4c42bbd7a Fix double indent 2013-01-22 19:56:18 +01:00
Allan Odgaard
6ca780191b Remove undo/redo methods
This wasn’t functional (and not really in the responder chain).
2013-01-22 19:56:18 +01:00
Allan Odgaard
8cd45626ab Add OakFileManager
This is to be used with file actions done from the UI: Actions are undoable, proper dialogs will be shown for errors or to confirm permanent deletes on volumes without a trashcan (closes #589). Interface sounds will also be played (when moving, trashing, and duplicating items).

I decided not to use the asynchronous file system methods that NSWorkspace offer. Mainly because they can only be used for the initial operation, not during replay, as performing asynchronous operations during replay may cause issues if user moves quickly between items (something that seems to be an actual problem for Finder). The problem though only exist as long as we rely on NSUndoManager to manage the process.

Presently there is no API for batch operations, which leads to suboptimal action titles when performing multiple file system operations in the same undo group.
2013-01-22 19:37:14 +01:00
Allan Odgaard
5799a7c4c4 Add compatibility code for 10.7 2013-01-22 19:23:16 +01:00