Commit Graph

63 Commits

Author SHA1 Message Date
Allan Odgaard
ace2e2269b Move spelling dot to OakTextView
We now load the image via NSImage and creates a CGImageRef from that (based on the current graphics context). This ensures we get the @2px version when on a HiDPI display.
2012-09-04 23:16:55 +02:00
Allan Odgaard
81de007bd4 Use new API for better bundle item display names 2012-09-04 20:34:54 +02:00
Allan Odgaard
4b8f7389fb Make hasSelection a public property 2012-09-04 20:33:28 +02:00
Allan Odgaard
a026e4ad11 Improve snippet choice menu
We filter out items that doesn’t have the current prefix and deselect current item if the user deletes the selection.

Some of this logic should probably be encapsulated by a filterPrefixString property added to OakChoiceMenu. This will also avoid the visual flash which arise when filtering the menu and selection changes (since we do one redraw w/o any items selected).
2012-09-04 19:22:53 +02:00
Allan Odgaard
141c0bd525 Don’t scroll selected item to top in choice menu
We now only ensure it is scrolled into the visible area.
2012-09-04 19:22:53 +02:00
Allan Odgaard
b136fcbca4 Proper implementation of setChoices:
This will now reload the table view and resize the pop-up (if necessary).
2012-09-04 19:22:52 +02:00
Allan Odgaard
949c074f9d Factor out choice menu sizing code 2012-09-04 19:22:52 +02:00
Allan Odgaard
0fd7d2a41b Implement Wrap Column → Other…
This is done using an alert with an accessory view. Not the best user experience, but given how rarely the user interacts with this, I wasn’t really in the mood to spend a lot of time on this part now (can always be improved later).

Closes issue #200.
2012-09-03 22:35:12 +02:00
Allan Odgaard
709882fa53 Drag-selecting beyond visible document lacked refresh
This closes issue #297.
2012-09-03 17:59:41 +02:00
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