Commit Graph

275 Commits

Author SHA1 Message Date
Allan Odgaard
5d4fe11e70 Speedup tool-tip fadeout except when closing due to mouse moved 2014-09-10 15:28:19 +02:00
Allan Odgaard
a4f47a7bfc Use Core Animation for the open document animation (zooming icon) 2014-09-10 13:34:11 +02:00
Allan Odgaard
9d39e80044 Hide OakToolTip interface in implementation file
This isn’t actually a public interface.
2014-09-08 14:47:19 +02:00
Allan Odgaard
f082f8fe47 Order out any old tool tip that might exist when showing a new 2014-09-08 14:47:19 +02:00
Allan Odgaard
db2c798292 Use Core Animation to fade out tool tips 2014-09-08 14:47:19 +02:00
Allan Odgaard
751a564fe2 Escape can now be used to clear a recorded key equivalent
If there is no recorded key equivalent then the key is passed to super.
2014-09-02 20:44:17 +02:00
Allan Odgaard
85f23eb53c Add crash report info to OakShowSheetForWindow
Trying to figure out why this function crashes due to uncaught exception with reason: ‘Modal session requires modal window’.
2014-09-02 18:59:28 +02:00
Allan Odgaard
a50846ba6c Don’t let our NSCell superclass know about our image
When linking with the 10.10 SDK our cell was misbehaving, showing either no image or only the image. The explanation might be NSCell’s setImage: implementation which is documented as: “If the receiver is not an image-type cell, the method converts it to that type of cell.”.
2014-09-01 17:37:10 +02:00
Allan Odgaard
d6f84b33d2 Remove a FIXME
The issue here was that a line of non-printable characters would return a height of zero.
2014-08-30 15:41:21 +02:00
Allan Odgaard
e098611387 Use the correct selected text color (for lists) 2014-08-27 09:12:01 +02:00
Allan Odgaard
63f8400cc4 Allow specifying an NSTextField subclass when creating labels 2014-08-21 17:37:04 +02:00
Allan Odgaard
2f1c4c05c4 Do not use ‘timeIntervalSinceNow’ with dates in the past
We previously negated the result but now we instead ask for [[NSDate date] timeIntervalSinceDate:startDate].
2014-08-21 16:07:23 +02:00
Allan Odgaard
c8f6c1d440 Set content hugging priority to high for our buttons
None of our layouts rely on the buttons not hugging their content, so we set the hugging priority so that we do not have to worry about wether or not the constraints capture this requirement.

Curiously, if only the hugging priority is set (to high) for the horizontal orientation then the find dialog can end up with an undesired layout, although all constraints are met.
2014-08-14 20:37:38 +02:00
Allan Odgaard
9da4c65c2d Remove unused ‘sender’ parameter 2014-08-13 22:26:46 +02:00
Allan Odgaard
8d26144668 Override doCommandBySelector: to avoid beep from super 2014-08-13 22:26:45 +02:00
Allan Odgaard
227b138112 Move table view movement helper to OakAppKit 2014-08-13 22:26:45 +02:00
Ronald Wampler
22cec6bb6b Do not use convertBaseToScreen: and convertScreenToBase:
These methods were deprecated in 10.7. Use `convertRectToScreen:` and `convertRectFromScreen:` instead. This is required for proper high resolution support.
2014-08-13 11:24:40 +02:00
Allan Odgaard
bc65a57957 Use OakIsEmptyString where appropriate 2014-08-08 19:42:30 +02:00
Allan Odgaard
0890b2aab0 Use local event monitor for key equivalent view
This ensures we get all key events, for example in the bundle item chooser window the pop-up button’s menu would previously see the key down event before the key equivalent view, so enabling recording and pressing ⌘1-3 would not record that key equivalent, but instead activate the corresponding (pop-up) menu item.
2014-08-07 12:03:21 +02:00
Allan Odgaard
acaf24dca0 Remove unused code
This should have been removed in 36cfb177a5.
2014-07-28 21:57:44 +02:00
Boris Dušek
ae373343c1 Implement basic accessibility for OakKeyEquivalentView
I experimented a lot with different combination of attributes, this one works
reasonably well compared to the others (even though it is less feature
complete). I may revisit experimenting with it at some later point.
2014-07-28 17:10:15 +02:00
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