Commit Graph

54 Commits

Author SHA1 Message Date
Dennis Vennink
a2fd40db29 Lower the minimum value for the tab size slider to 1. 2012-08-31 23:16:39 +02:00
Dennis Vennink
4acbbf6b25 Added the ellipsis icon for folded text. 2012-08-31 23:16:38 +02:00
Dennis Vennink
007e498a02 fixup! Incorporated scalable icons.
Implemented proper alignment of the icons with the line number font.
2012-08-31 23:16:38 +02:00
Allan Odgaard
593b6052f5 fixup! Incorporated scalable icons. 2012-08-30 18:59:27 +02:00
Allan Odgaard
6c6ba400ff Revert "Don’t refresh gutter from OakTextView"
Turns out this is required in the situation where the document occupy less space than the visible document rect.

In this case, inserting new lines will not resize the text view, since it has been artificially enlarged to fit the visible document rect, therefore the gutter view will not update properly when inserting new lines.

I think there is a better solution than have the text view refresh the gutter, reverting is just meant as a quick fix.

This reverts commit 4e2ae3c508.
2012-08-30 18:52:49 +02:00
Dennis Vennink
6eca51ab33 Incorporated scalable icons. 2012-08-30 16:40:14 +02:00
Allan Odgaard
4e2ae3c508 Don’t refresh gutter from OakTextView
I suspect that this was added because some operations were not properly detected, though the only thing I can find, that doesn’t properly update the gutter, is when deleting folded code in a way that doesn’t change the bounds of the text view. This code however does not address that issue.
2012-08-30 10:17:12 +02:00
Allan Odgaard
46786ec60d Gutter: Don’t draw same row rectangle twice
Incase the last line of a file is folded (has no newline) then the gutter would first receive a row record for the line starting this fold, and then when querying for the next row, it would get the last line of the layout, this had a different line number but shared same coordinates as the previously rendered line, so the gutter would draw on top of that.

Closes issue #256.
2012-08-30 00:30:59 +02:00
Allan Odgaard
4e9c5c4693 OakDocumentView now manage gutter’s size 2012-08-30 00:30:59 +02:00
Allan Odgaard
9af3c2ff1a Limit amount of refresh
In theory there should be no reason to redraw more than the divider line and the gutter, after changing gutter styles.
2012-08-30 00:30:59 +02:00
Allan Odgaard
5a2869ea3c Remove pointless indirection 2012-08-29 23:34:24 +02:00
Dennis Vennink
69919fd329 Update gutter images 2012-08-29 22:08:59 +02:00
Allan Odgaard
3d2a3b09d6 Remove automatic resizing from gutter view
There is a somewhat frequent crash caused by infinite “did resize” notifications. It’s unclear exactly why this happens, but basically a subview shouldn’t resize itself unless asked, and it shouldn’t resize siblings either.

We now have an explicit sizeToFit which takes care of sizing the gutter view. It is the responsibility of the owner (of this gutter view) to resize the gutter’s parent scroll view and any siblings that may need adjustment (after calling sizeToFit).

Additionally it is the responsibility of the owner to call sizeToFit when there is a chance the gutter view size needs updating. Generally though, the owner should know, as it is the data source for everything.
2012-08-29 21:55:10 +02:00
Allan Odgaard
ad8977d849 Change how we render gutter images
Previously we would lock focus on our source image. This is bad because we do rasterization (to a fixed pixel format / density) and it (potentially) destroys / mutates the source image.

We now use a second (new) image for the compositing. This is still not ideal, as this second image still is “off screen” so lack the proper graphics context during rendering. A better approach might be to create a CGImage using the graphics context and use that as an (image) mask and do a stroke, but this would require the images to be changed and I am not really certain it will work.
2012-08-29 21:44:23 +02:00
Allan Odgaard
d58389e103 Use NSDictionary instead of retained_image_t
The main reason for this is that we wish to resize the images when the font is changed. This can now be done in the gutterImage: method.
2012-08-29 21:41:57 +02:00
Allan Odgaard
0e96a04d76 Remove compatibility checks
Since we now require 10.7 we don’t need all of this. Keeping it around is just noise that can lead to confusion about code paths.
2012-08-29 16:02:29 +02:00
Jacob Bandes-Storch
dfdde3283f Use 64-bit: explicit visibility where required 2012-08-28 21:32:47 +02:00
Jacob Bandes-Storch
9584afba16 Use 64-bit: replace SELNAME with sel_getName 2012-08-28 21:32:46 +02:00
Jacob Bandes-Storch
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +02:00
Allan Odgaard
a58f424a14 Fix issue with recording macros
The recordSelector: might receive a ‘nil’ argument. Previously this was handled gracefully by using ‘dictionaryWithObjectsAndKeys:’ but not so when using the new Objective-C literal array syntax. So reverting to the old syntax.

This closes issue #38.
2012-08-27 20:19:05 +02:00
Jacob Bandes-Storch
6aeb27f02f Use Cocoa instead of Carbon for popup menus 2012-08-27 01:03:16 +02:00
Allan Odgaard
1482c87f0c Remove executable flag from PDF files 2012-08-26 20:37:32 +02:00
Allan Odgaard
fc13d2021d Tweak gutter colors
Use the text foreground color for icons when the theme doesn’t provide a color and introduce ‘gutterSelectionIcons’ for the color of selected icons (defaults to selected foreground color).

Also changed the gutter selection border color to match the divider color (when it isn’t specified by the theme).
2012-08-26 18:52:25 +02:00
Dennis Vennink
5a80fcea95 Replace PNGs with resizable PDF template images 2012-08-26 18:26:34 +02:00
Dennis Vennink
6e02f55fff Add gutterSelectionBorder and gutterIcons theme keys 2012-08-26 18:26:34 +02:00
Adam Strzelecki
9f72b75827 Use gutter divider color for selection rectangle 2012-08-25 23:48:41 +02:00
Allan Odgaard
cbbebd879a Also save spelling language in settings
Missed this one in a previous commit.
2012-08-25 14:54:46 +02:00
Allan Odgaard
23576923fd fixup! Extend gutter theming to selection foreground
Previous solution didn’t handle soft wrapped lines.

This solution also scales better, as we no longer need to break up ranges and create an entry per selected line.
2012-08-25 14:54:46 +02:00
Allan Odgaard
b1e8efcd01 Preserve various OakTextView settings
All the settings are now taken exclusively from the property files, so no more user defaults. This means users will have to set their theme and font again.
2012-08-24 16:57:32 +02:00
Allan Odgaard
3c79f275f1 Use constants for settings keys 2012-08-23 17:15:12 +02:00
David Howden
b8b25a46c8 Extend gutter theming to selection foreground
New theme setting: gutterSelectionForeground
2012-08-23 14:42:11 +02:00
David Howden
f2dd19f2a3 Extend support for theming the gutter
New theme setting: gutterSelectionBackground
2012-08-22 15:10:21 +02:00
Paul Wilde
cd84a864d2 Added Retina icons for bottom bar and file browser
As all the icons have been remade some of them should look better on non-retina also.

This closes issue #42.
2012-08-22 14:34:25 +02:00
Allan Odgaard
7b4bf9c893 fixup! Move border drawing to OakDocumentView
Drawing the border did not account for auxiliary views (presently used by incremental search). See issue #240.

It also did not properly layout the views when adding/removing such views, causing the border to disappear after having used incremental search.
2012-08-22 14:34:25 +02:00
Dennis Vennink
fc9767b520 Community effort to redesign and retinafy the gutter icons. 2012-08-21 23:45:45 +02:00
Allan Odgaard
fcaa957d4b fixup! Add support for theming the gutter
Theme was no longer initialized by OakTextView, instead we relied on OakDocumentView to provide us with a theme, but if the user had no themes installed, it would never do so, leading to a crash when OTV uses a theme member function to obtain colors.

This closes issue #222.
2012-08-21 20:11:21 +02:00
Allan Odgaard
40822e87e6 Limit recursive snippet expansion
If caret is at the first position of a place holder then we no longer look for tab expansions, should the user press tab.

This address the issue where a placeholder has optional content and the word to the left of this optional content is a tab trigger. Previously deleting the placeholder text and pressing tab would insert a new snippet, which would generally not be expected.

This closes issue #226.
2012-08-21 19:43:10 +02:00
Jacob Bandes-Storch
1c83eaa389 Add support for theming the gutter
Theme setting keys gutterForeground, gutterBackground, and gutterDivider
2012-08-20 19:01:56 +02:00
Jacob Bandes-Storch
dc810607b2 Refactor theme selection to pass through OakDocumentView 2012-08-20 18:49:47 +02:00
jtbandes
d15a0eddb3 Include high resolution I-Beam cursor 2012-08-18 14:52:58 -07:00
jtbandes
6e70305c5d Move border drawing to OakDocumentView
This allows the border to appear properly when scrolling (with a multitouch device) bounces past the end of the content.
2012-08-18 21:28:56 +02:00
Allan Odgaard
e9d30644e9 Improve tab trigger boundary checks
When two neighboring characters have different character class or one is an alpha numeric character (excl. underscore) and the other is not, we consider this a valid boundary for a tab trigger.

This closes issue #157.
2012-08-15 16:07:23 +02:00
Allan Odgaard
1892e0a557 Make the file drop path relative to current file
Previously these were relative to the project directory with current file’s directory as a fallback, but 1.x used current file.
2012-08-14 22:42:51 +02:00
Allan Odgaard
05298ee8dc Insert path when dropping binary files
This is only when there is no drop command for the file type.
2012-08-14 22:35:11 +02:00
Bo Xiao
96cb899b53 Initial commit of Simplified Chinese localization for xib files. 2012-08-14 21:29:51 +02:00
Adam Strzelecki
6763406fe5 Bind Opt+F1 to show bundle item popup. 2012-08-14 19:29:00 +02:00
Adam Strzelecki
752430f339 Check current grammar bundle in bundle item popup.
Do not specify selected index explicitely, popup menu item with NSOnState gets selected by default.
2012-08-14 19:13:15 +02:00
Adam Strzelecki
8a8432d065 Select current grammar at bundle item popup. 2012-08-14 19:13:14 +02:00
Allan Odgaard
bf12bdd3f2 Another CJK fix
When invoking an action that would replace the marked text (“CJK edit buffer”) with a zero-length string, we would continue to be in “CJK” mode and thus allow the input manager to process the next key press.

In this situation though pressing e.g. escape or backspace would result in the input manager inserting the literal character code for this key.

So we now leave “CJK edit mode” if the “edit buffer” is empty.

There is still an issue though where, if the edit buffer is not empty, and the user press backspace, we correctly (?) ask the input manager to handle this key press, but the input manager will (wrongly) replace the selection with the literal backspace character.
2012-08-13 18:31:37 +02:00
Allan Odgaard
9ce0a3faa6 Fix issue #44 (CJK input)
We have our own version of interpretKeyEvents: because we want to augment the default key bindings dictionaries (and support multi-stroke key bindings).

When there is marked text (as part of inserting CJK or similar) the system’s version of interpretKeyEvents: seems to handle key bindings slightly different, for example where ↩ is normally bound to insertNewline:, this might be suppressed when the user has just selected a “translation”.
2012-08-13 01:21:53 +02:00