Commit Graph

254 Commits

Author SHA1 Message Date
Allan Odgaard
36cfb177a5 Leverage the default implementation of bindings 2014-07-10 23:43:20 +02:00
Allan Odgaard
4f19370458 Let key equivalent field pass unused key down events to super 2014-07-10 23:43:20 +02:00
Allan Odgaard
01fe210895 Key equivalent field no longer activate recording on return
This is to allow using the control in windows with a “default” button (which gets the return key).
2014-07-10 23:43:20 +02:00
Allan Odgaard
96b8b00df7 Implement intrinsicContentSize for OakKeyEquivalentView
This will allow it to be used with constraint based layouts.
2014-07-09 17:03:45 +02:00
Boris Dušek
eea001f5d5 Fix build error on clear rebuild
When rebuilding textmate from scratch:

git clean -xffd; git reset --hard HEAD; rm -rf ~/build/TextMate/; ./configure; ninja

This error appears:

Frameworks/OakAppKit/src/OakTabBarView.mm:7:9: fatal error: 'OakAppKit/OakFileIconImage.h' file not found

After one issues "ninja" again, textmate continues building fine.

I guess this might be because perhaps OakAppKit's headers are being copied
to the build include directory (~/build/TextMate/include) in parallel when
building OakTabBarView.mm. No matter what actually is the case, this patch
fixes building during clean build.
2014-06-29 21:40:33 +02:00
Boris Dušek
900ee1f523 Use NSAccessibilitySharedFocusElementsAttribute in OakChooser
This new 10.10 API allows one to mark, for some UI element, a set of UI
elements to track selection. VoiceOver (and other accessibility clients)
will then track and announce selection (cursor) changes not only in the
currently focused element, but also for all elements contained in its
"shared focus elements" array. This is a perfect fit for search field
with a table of results. In fact it is used for new 10.10 Spotlight -
its search field's shared focus element is the table containing the results.

As NSAccessibilitySharedFocusElementsAttribute is available only in the 10.10 SDK,
so make a way to use its value with previous SDKs (with which TextMate
is currently compiled).

We also retain the kind-of-hacky solution for pre-10.10 OSes introduced in
and instead use NSAccessibilitySharedFocusElementsAttribute.

This code was tested in all 6 fields of a 3×2 matrix:
* compiled with 10.8, 10.9 and 10.10 SDK
* run on 10.9 and 10.10 (DP2)

For user, this means more standard behavior (says the same "completion selected"
thing as with Spotlight) and a bit more correctness (no extra space
before beginning / after end of search field on braille display).

For developer, this means once we stop supporting 10.9, we will be ready to
drop a lot of code which, while serving us well to make the choosers more
user friendly on pre-10.10, will no longer be needed.
2014-06-29 11:01:58 +02:00
Adam Strzelecki
59a699c078 Tune tab label inset shadow
Now it matches more way other OSX elements are inset both on Retina and
non-Retina displays.
2014-06-28 18:02:00 +02:00
Adam Strzelecki
56cfc1a3e0 Reworked OakTabBarView layout plist
Now it supports properly Retina using Cocoa rounded corner rendering instead
pixel patches. All colors are now references by name.
2014-06-28 18:02:00 +02:00
Adam Strzelecki
2ef711ad97 Define color names for OakTabBarView
This lets layout file refer to color names instead hardcoding color hex values.

Also colors referenced by name can return different values depending on OSX
version, which will in future solve problems with OSX 10.10 Yosemite L&F.
2014-06-28 17:59:27 +02:00
Adam Strzelecki
53943e4409 Extend layer_t with cornerRadius & borderColor
This allows drawing rounded layers with border in resolution independent
manner. Also it reduces number of layers needed to certain UI elements.
2014-06-28 17:56:50 +02:00
Allan Odgaard
0ae6782d80 Remove support for custom views in OakControl 2014-06-28 17:42:23 +02:00
Ronald Wampler
6dd2dc1c5e Use document icons in overflow menu 2014-06-28 17:42:22 +02:00
Ronald Wampler
2dbd0d601f OakTabBarView datasource now sends the unabbreviated path 2014-06-28 17:42:22 +02:00
Ronald Wampler
c5d801cca9 Adjust click target for tab overflow button 2014-06-28 17:42:22 +02:00
Ronald Wampler
28e58bf4a4 Add effect when the tab overflow button is clicked 2014-06-28 17:42:21 +02:00
Ronald Wampler
673f5a4b73 Adjust appearance of the TabOverflow image 2014-06-28 17:42:21 +02:00
Ronald Wampler
0b3cf27cfd Add Retina asset for TabOverflow 2014-06-28 17:42:21 +02:00
Allan Odgaard
4e5a7fdfe6 Delete clipboard history when seeing NSFileReadCorruptFileError 2014-05-17 13:21:53 +07:00
Allan Odgaard
af3f4aaa33 Check result of most CF/CT ‘Create’ functions 2014-05-15 13:17:30 +07:00
Ronald Wampler
fc5dcf4020 Prefer NULL to nop: in most cases
This change was prompted by the appearance of the `tabSizePopUp` button in the status bar. After dismissing the menu, the title would be disabled.

To ensure we do not have similar issues elsewhere, let's prefer the use of `NULL` to `nop:` when assigning the action for menu items unless we are sure that the menu item should always be disabled (e.g., the item is used as a label).
2014-04-30 12:09:47 +07:00
Allan Odgaard
d06c6f02bc Use file’s display name instead of CFBundleName
This seems to be what Finder does, and some bundles (Spotify.app) actually lack a CFBundleName key.

Also ensure our bundle has a CFBundleIdentifier.
2014-04-28 18:23:51 +07:00
Allan Odgaard
0ad0b12a82 Improve “Open With” submenu
- Path to application is shown in the menu item’s tool tip.
- When menu is shown for multiple file types with different default applications, we show the default applications first.
- Use the potentially localized bundle name rather than file system display name.
- Use bundle identifier to group applications rather than display name: Grouping is done to decide if version number should be shown for the item.
2014-04-25 16:55:31 +07:00
Allan Odgaard
1f0e3db472 Remove trailing zeroes from numeric literals
I mainly dislike the trailing zeroes because CGFloat used to be a float but 1.0 is a double (1.0f would be a float). So better to under-specify and let the compiler figure out the proper type.
2014-04-14 14:26:52 +07:00
Allan Odgaard
39b94e6ac3 Harmonize whitespace and add trailing newline 2014-04-14 14:26:52 +07:00
Allan Odgaard
6e619ad14c Do not render full screen windows as inactive
The text view itself will still dim the selection, but document tabs, status, and tool bars no longer change colors.

This seems consistent with how Apple’s controls act and is necessary for the status bar since it draws a transparent gradient over the window background, so only its borders got the dimmed look.
2014-04-12 11:23:07 +07:00
Allan Odgaard
d1bce2ac4f Get rid of OakCreateViewWithColor 2014-04-12 11:23:07 +07:00
Allan Odgaard
d0bb0e7dc2 fixup! Full implementation of ‘labels’ property 2014-04-10 17:46:31 +07:00
Allan Odgaard
30edbc9118 Disable autoresize mask translation for divider line views 2014-04-10 17:46:30 +07:00
Boris Dušek
44a803fe7c Use NSAccessibilityUnignoredDescendant to streamline code 2014-04-05 14:13:38 +07:00
Boris Dušek
07e253f3bb Cleaner disabling of image view accessibility. 2014-04-05 09:46:42 +07:00
Boris Dušek
896ad73ee8 Add ability to specify AX labels in UI functions
Accessibility labels now can be specified conveniently as a parameter
of a UI construction function.
2014-04-01 13:39:27 +07:00
Boris Dušek
b80d60db57 Add OakSetAccessibilityLabel function
This function makes it easy to set accessibility "labels" for UI elements.
It is flexible - takes care of NSView vs. NSControl case, labels can be
specified directly as a string or as a user interface element.
2014-04-01 13:37:45 +07:00
Allan Odgaard
617e9df202 Move missing accessibility API declarations to OakAppKit.h 2014-04-01 13:33:49 +07:00
Allan Odgaard
69c83e56df The ‘const’ keyword should be to the right of its type
The standard doesn’t care which side the keyword is placed on, but placing it on the right makes it easier to read types.

E.g. reading “int const* const” from right to left we get “const pointer to const integer”.
2014-03-31 08:27:19 +07:00
Allan Odgaard
a63edc149f Set default merge policy for CoreData
This is only relevant when another process is updating the CoreData storage (while TextMate is running), i.e. not a scenario normal users should see.
2014-03-31 08:27:17 +07:00
Allan Odgaard
5f69ef31c7 Don’t use NS prefix for custom functions 2014-03-28 19:31:14 +07:00
Allan Odgaard
619a2cfec7 Change a few instances of floorf/fabsf → floor/fabs 2014-03-28 19:31:14 +07:00
Allan Odgaard
a6654f56c9 Using cut/copy will always update the system pasteboard
Previously we only updated the system pasteboard if it was different, but some users copy rich text from one application, paste it in TextMate and then copy it (in TextMate) with the expectation that the rich styles are stripped.
2014-03-26 19:02:42 +07:00
Allan Odgaard
7e02902ab0 Remove retain cycle from pasteboard history window 2014-03-26 19:02:41 +07:00
Allan Odgaard
6535546c87 Use view’s undo manager rather than the window’s 2014-03-26 15:30:36 +07:00
Allan Odgaard
1a20f3a42d Set accessibility description when creating action buttons 2014-03-26 15:30:36 +07:00
Allan Odgaard
a004fe685d Only set raised background style for borderless action buttons 2014-03-26 15:30:35 +07:00
Allan Odgaard
ec491a4e19 Exclude divider images from accessibility
Since it is the cell that is providing the accessibility attributes the simplest way I could think of to have it ignored was to remove NSImageView’s support for the NSAccessibilityChildrenAttribute.

I tried using accessibilitySetOverrideValue:forAttribute: but it did not work for me, so a subclass was required.
2014-03-26 15:30:35 +07:00
Allan Odgaard
2cc71e57f9 Limit clipboard history display string to ~1024 code points
This should fix performance issues (during scroll).
2014-03-26 15:30:35 +07:00
Ronald Wampler
f45cb07d52 Moved OakCreateActionPopUpButton method to OakUIConstructionFunctions.h
While code reuse is an added benefit, the main motivation was to fix the appearance of the action popup button in the Find window. The first (placeholder) item in the Find window's action button was assigned a nop action so that when the button was clicked and it's menu validated, the "action" image would always appear as disabled.
2014-03-25 16:51:40 -04:00
Allan Odgaard
90d1fd432d Non-local drags from TextMate now include NSDragOperationGeneric 2014-03-25 12:19:57 +07:00
Allan Odgaard
1a95579844 Rework OakFileIconImage
We no longer let the image representation point back to the image, since the image might be copied.
2014-03-23 22:47:16 +07:00
Allan Odgaard
175e4cf183 Let ‘tab’ in pasteboard history move to next key view
Similarly shift-tab moves to previous key view.
2014-03-14 16:08:56 +07:00
Allan Odgaard
fe1134c6c1 Full implementation of ‘labels’ property 2014-03-13 20:51:31 +07:00
Allan Odgaard
9a9614e264 Workaround for “format string is not a string literal” warning 2014-03-13 20:51:15 +07:00