Commit Graph

84 Commits

Author SHA1 Message Date
Allan Odgaard
b084146651 Fix image sizes on retina Macs
We were using the point size for the bitmap mask causing the images to be doubled in pixels.
2012-09-10 14:29:13 +02:00
Allan Odgaard
05cf1232a5 Redo spell checking after changing options 2012-09-09 21:10:00 +02:00
Allan Odgaard
6807f41d3b Move spell checker methods to OTV 2012-09-09 21:10:00 +02:00
Allan Odgaard
b25b397b5d Remove commented code
It’s unusable in its current state and it’s unclear what purpose the code would serve.
2012-09-09 20:43:53 +02:00
Allan Odgaard
6156cf87d7 Remove overwrite and freehanded toggles
Both from code and the menus. These were not implemented and I see no real reason to implement freehanded movement as a toggle since it is easily obtainable via column selections or option-clicking beyond EOL.

Overwrite mode might be implemented, but rather low priority.
2012-09-09 20:43:53 +02:00
Dennis Vennink
69341b2960 Gutter theming round-up
1. Removed the alpha channels from all images.
2. Deleted unnecessary double images. (@sorbits: You might want to
rename them to more accurately display what they do.)
3. Slight adjustments to improve the visibility of the bookmark icons
at lower font sizes.
2012-09-09 20:42:32 +02:00
Allan Odgaard
8e1851679e Treat gutter images as image masks
The advantage is that we avoid creating an off-screen image for compositing. We want to avoid off-screen images as they may not use the same pixel format/density as the render context (screen).
2012-09-09 20:34:36 +02:00
Allan Odgaard
b149b4215e Use image for drawing folding dots
The color of the image can be set by adding a theme style for the foreground and scoped to “deco.folding”.
2012-09-09 11:32:42 +02:00
Allan Odgaard
732f486187 Change folding dots to be in image mask format
An image mask cannot use alpha but should instead be greyscale.
2012-09-09 11:32:41 +02:00
Allan Odgaard
9e11d0790f Increase folding image scale factor to 1.5 2012-09-09 11:32:41 +02:00
Allan Odgaard
84107bcb7f Remove ‘Template’ from image names
We don’t use them in a context where this property matters and we plan to convert them to image masks.
2012-09-09 11:32:41 +02:00
Allan Odgaard
aba449d171 Move gutter styles to own settings dictionary
This removes all the blending, the need to provide a scope selector to obtain them, and no longer taxes the general syntax highlight (by no longer having to carry around a dozen gutter styles per scope).
2012-09-08 00:40:08 +02:00
Dennis Vennink
f2f14dd48a Extended gutter theming support
The following four new keys have been added:

 - gutterIconsHover
 - gutterIconsPressed
 - gutterSelectionIconsHover
 - gutterSelectionIconsPressed
2012-09-07 21:21:35 +02:00
Allan Odgaard
e33c680269 Fix potential out-of-range access
When we update the text view frame we implicitly cause the gutter to refresh, which will ask for line records from the text view based on the selection, so we should ensure the selection is up-to-date before changing frame size.
2012-09-07 16:18:03 +02:00
Allan Odgaard
8f5ddc672f Move bundles pop-up menu to BundleMenu library 2012-09-06 23:10:56 +02:00
Allan Odgaard
cf5e9f1530 Leave autoenablesItems at its default value 2012-09-06 23:10:56 +02:00
Allan Odgaard
f57d35362e Rename method: scope → scopeContext
This is to avoid a clash as there is also another method called scope (WebKit / DOM).
2012-09-06 23:10:56 +02:00
Allan Odgaard
73d586c2ba Use helper for bundle item’s key equivalent
This is to allow a bundle item to display another key than the one assigned to the item, e.g. when the bundle item is matched by a proxy item it should show that item’s key equivalent.
2012-09-06 23:10:56 +02:00
Allan Odgaard
79254cbb6b Add find{Next,Previous}AndModifySelection: action methods
Presently no keys or menu items bound to these.
2012-09-06 23:10:55 +02:00
Allan Odgaard
bca2b4f8c8 Don’t include existing text for “search highlights”
This is e.g. when one does Find All with one instance already selected, that one instance is left out of the found instances being highlighted.
2012-09-06 23:10:55 +02:00
Allan Odgaard
41ab738d19 Change colorWithCGColor: → tmColorWithCGColor:
On Mountain Lion the OS provides a colorWithCGColor: which tmColorWithCGColor: now wraps for (when available).

This fixes a warning when building with the 10.8 SDK.
2012-09-06 23:10:55 +02:00
Allan Odgaard
2b555aef7b 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:53:37 +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