Commit Graph

133 Commits

Author SHA1 Message Date
Jacob Bandes-Storch
fa4d14732b Improve tooltip positioning for multiple screens 2013-03-21 11:41:31 +01:00
Allan Odgaard
04e8eb44a2 Introduce updateTitle: for NSMenuItem
Since we create an attributed title when the menu item has a tab trigger or “inactive” key equivalent, we can’t later update the title via the title property.
2013-03-16 17:49:48 +01:00
Allan Odgaard
8313dcb407 Remove status bar graphics
This is no longer used since the OakStatusBar class has already been deleted.
2013-03-16 17:49:48 +01:00
Allan Odgaard
6ac4aab910 Use custom menu item title for key equivalents
The rendering doesn’t mimic the system 100%, for example the key equivalents are not centered on the split between modifiers and the key, nor are F-keys rendered using a smaller font / menu glyph.

On the plus side though, now all keys are rendered. Previously keys shared with other (non bundle) menu items would only be shown for one of the items sharing the key, and some keys would simply not be shown (e.g. ⌃#).

Also, bundle menu items no longer “eclipse” regular menu items, which could previously happen even when the bundle menu item wouldn’t fire (as it was scoped for something else than the current context).

Fixes #894.
2013-03-14 10:14:46 +01:00
Allan Odgaard
d8cf1e3591 Gather UI construction code and harmonize fonts 2013-03-13 12:38:11 +01:00
Allan Odgaard
46fc5430c7 Remove Objective-C smart pointer
Not necessary now that we have ARC.
2013-03-10 16:11:26 +01:00
Allan Odgaard
96784e9fee ARC: Update OakAppKit framework 2013-03-10 16:11:26 +01:00
Allan Odgaard
694b670413 Remove OakStatusBar 2013-03-10 16:11:26 +01:00
Allan Odgaard
2b0acf9677 Remove isDark NSColor category method 2013-03-10 16:11:25 +01:00
Allan Odgaard
13edc6d131 Use O_CLOEXEC when opening files
This avoids leaking file descriptors into child processes, which would otherwise happen if another thread forks while the file descriptor is open.
2013-03-10 16:07:10 +01:00
Allan Odgaard
d92a4ee286 Range check for ⌘1-n should include ⌘0 2013-03-10 16:07:09 +01:00
Adam Strzelecki
6ed3c93872 Lighter tab bar background for better readibility 2013-03-04 10:22:54 +01:00
Allan Odgaard
8041b71d98 fixup! Exclude file browser width from new windows’ width 2013-02-22 15:51:03 +01:00
Allan Odgaard
cbb0a7864d Drop ‘ng’ namespace for scm 2013-02-21 17:39:55 +01:00
Allan Odgaard
0d8ccd17f0 Exclude file browser width from new windows’ width
Closes #679.
2013-02-19 22:08:13 +01:00
Allan Odgaard
63beedc6f4 Handle ⌥⌘⇠ / ⌥⌘⇢ in main menu subclass
This means they work (as alternatives for ⌘[ / ⌘]) in all windows with tabs.

We now also trigger menu-flashing for when pressing the keys.
2013-02-18 15:38:26 +01:00
Allan Odgaard
f0523c3b43 Only update Go To Tab on ⌘1-n
It’s expensive to update this menu since we use (uncached) file icons. Always updating it had a noticeable performance effect on caret movement.
2013-02-18 15:38:26 +01:00
Allan Odgaard
0277e82b5c Ensure proper ‘isDirectory’ flag for NSURL objects
This is important when we wish to select or edit the URL (in the file browser) as URLs with different values for this flag will not compare as equal, and URL objects created before there is a file on disk will always have this flag set to NO.
2013-02-18 15:38:25 +01:00
Allan Odgaard
52ba0cb5c2 Add file manager support for ‘new file’ 2013-02-15 15:27:57 +01:00
Allan Odgaard
72d0b9757b Post OakFileManagerWillDeleteItemAtPath 2013-02-15 15:27:55 +01:00
Allan Odgaard
a4dc3bf977 OakFileManagerDirectoryKey → OakFileManagerPathKey
This allows us to use the same key for more than just directories. The notification name itself should indicate if the ‘path’ refers only to directories or files.
2013-02-15 15:27:54 +01:00
Allan Odgaard
b37b56075a Call super in viewWillMoveToWindow: 2013-02-14 11:31:20 +01:00
Allan Odgaard
8987a7528f Use generic file/folder icon when OakFileIconImage.path == nil 2013-02-11 14:21:20 +01:00
Michael Sheets
a9d80f5a0d Increase tab bar size one pixel
This is to match the minimum allowed size for the sidebar header when the tabs above document is enabled, also matches the height of the forthcoming tab redesign.
2013-02-09 16:34:24 +01:00
Allan Odgaard
9c994af1e0 Tweak OakGradientView
- Accept two NSGradient objects instead of four colors.
- Call designated initializer on super instead of self since subclass is likely calling us from its designated initializer
- Make class public
2013-02-09 16:34:23 +01:00
Allan Odgaard
b139ac5097 Change push_back → emplace_back (C++11)
This is mainly motivated by readability, so I only did a few select replacements.
2013-02-08 11:20:35 +01:00
Allan Odgaard
67af1bc7fe Make divider lines opaque
Without this, it is possible to move the window when clicking directly on the line (since none of the parent views are opaque).
2013-02-06 16:43:40 +01:00
Allan Odgaard
22465873ac Handle case changes on insensitive file systems
NSFileManager only provide a move function which fails with “file exists” if we make case changes on a case-insensitive file system, therefor we now explicitly test for that error and use <x-man-page://2/rename> if the source and destination refer to the same file, but the path differ.

Fixes #769.
2013-02-06 14:50:05 +01:00
Allan Odgaard
63c0300ed8 Post “directory did change” notifications
This is both to speedup file browser updates (as there is a bit of lag waiting for fs-events) and to work with file systems that doesn’t support fs-events (issue #745).
2013-02-06 14:50:04 +01:00
Allan Odgaard
37f130fe42 Don’t set gradient view as opaque
This is so that a potential NSTextField will correctly render itself as inactive when using NSBackgroundStyleRaised.
2013-02-06 14:50:04 +01:00
Michael Sheets
a6f0b75d4c Use correct syntax for including local headers 2013-02-05 08:36:04 +01:00
Allan Odgaard
e42d84fa4c Missing files still get SCM badge 2013-02-04 19:38:32 +01:00
Allan Odgaard
748558c5d3 SCM API: Update OakFileIconImage
Since the created image is a “dumb” object that can’t provoke redrawing itself, we require that SCM info is already cached for the repository containing the file for which we are creating an image. If not, there will be no SCM badge, so most users of this API should setup their own SCM info and recreate the image when SCM status changes.
2013-02-04 19:38:32 +01:00
Allan Odgaard
cef6a74df2 Make code safe against ‘nil’ clipboard entries
Should never happen in practice though.
2013-02-04 19:38:30 +01:00
Allan Odgaard
151c800239 File icon images now default to ‘existing’ 2013-02-03 10:48:34 +01:00
Allan Odgaard
044cd72c10 Use system icons for Open With menu
Previously we used our own icon image class which support SCM status, custom images for known file types, and more. This is however is unnecessary, as we know the Open With menu contains only applications, and each should use their standard icon.

This should also fix issue #510, although the issue was never diagnosed beyond git stalling while trying to get SCM status for the application icons in this menu.
2013-02-03 10:48:33 +01:00
Bob Rockefeller
0f41c946f0 Bind the grid icon to .less files
Added .less files to the OakAppKit .plist bindings file as another grid icon, to go along with the existing .css, .sass and .scss definitions.

Signed-off-by: Bob Rockefeller <bob@bobrockefeller.com>
2013-02-02 08:49:15 +01:00
Allan Odgaard
342152ea71 Remove light gray line above tabs 2013-01-30 18:55:30 +01:00
Adam Strzelecki
5f69592a1f Fixed control/tab bar label shadows
NSShadowAttributeName has no effect when using CTFrame. Use
CGContextSetShadowWithColor instead.
2013-01-30 13:20:06 +01:00
Allan Odgaard
904348d489 Add OakGradientView
This simply draws a gradient background but supports alternate colors for when the window is inactive.
2013-01-28 15:44:28 +01:00
Allan Odgaard
d68be42546 Initial divider colors were wrong for inactive windows 2013-01-28 12:42:28 +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
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
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
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
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
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