Commit Graph

103 Commits

Author SHA1 Message Date
Allan Odgaard
565242584f Ensure document stays open in refresh helper
The refresh helper uses the document’s undo manager in its destructor. Normally the document would stay open throughout the duration of the scope in which the refresh helper is used, but it might be possible to close the current document from a nested event loop, as spawned e.g. by showing a tool tip, in which case, the document will be closed when we reach the destructor.
2012-09-18 17:33:01 +02:00
Allan Odgaard
2ef3d52a3d Remove unnecessary refresh from performKeyEquivalent: 2012-09-18 17:33:01 +02:00
Allan Odgaard
c26e5c2d36 Scope attributes are now given to editor_t
While presently it works the same, it allows us to provide better scope attributes e.g. for untitled documents (which lack SCM attributes).
2012-09-18 17:33:01 +02:00
Allan Odgaard
dabcad588d Introduce OakTextViewDelegate 2012-09-18 17:33:00 +02:00
Allan Odgaard
130d0a168d Move check for indent corrections to OakTextView
This makes it easier to introduce a UI setting for the option.
2012-09-18 17:33:00 +02:00
Allan Odgaard
8f7346ee3e Reset potential column selection cursor on caret blink
Sometimes the cursor gets stuck and there is really no workaround other than periodically reset the image.
2012-09-18 17:33:00 +02:00
Allan Odgaard
1fafbecd54 Remove Chinese translation
It’s not feasible to maintain the old-style xib translations while we work on the UI. We’ll soon move fully to constraint-based layout which should allow translations to be purely string-based.
2012-09-16 11:41:23 +02:00
Allan Odgaard
baae923414 Remove resize buttons
Going forward we only allow resizing views by grabbing the dividers.
2012-09-15 15:12:57 +02:00
Allan Odgaard
5f24a91d44 Auto-layout: Update OakDocumentView
The gutter will invalidate its intrinsic size when its width changes which will cause the Cocoa layout engine to update the layout, so no more explicit code to deal with adjusting the gutter’s width.

Likewise, the height of the gutter (not the gutter scroll view) has been setup to match the height of the text view (again, not the containing scroll view). This avoids observing the text view frame and manually updating gutter height to match it.
2012-09-14 17:14:56 +02:00
Allan Odgaard
6bb23c1765 Gracefully handle missing gutter view delegate 2012-09-14 17:14:56 +02:00
Allan Odgaard
339c582f8c Auto-layout: Update incremental search (xib) 2012-09-14 17:14:55 +02:00
Allan Odgaard
144ee3762d Use NSBox to draw gutter divider
There’s a few subtle advantages of going with a view, mostly theoretical (about minimizing refresh rectangles) but switching to constrained based layout should provide minor code simplifications, since our ancestor view won’t have to deal with the gutter divider rectangle.
2012-09-14 17:14:54 +02:00
Allan Odgaard
2e2b91144d Change property to read-only
Since it uses a const reference we can’t synthesize a setter for this.
2012-09-12 18:30:37 +02:00
Allan Odgaard
cb46ba11e5 Change set-only property → method 2012-09-12 18:30:37 +02:00
Allan Odgaard
5dea94da01 Disable undo/redo menu items when appropriate 2012-09-10 22:47:58 +02:00
Allan Odgaard
cf5b5965da Don’t send theme bundle items to OakTextView
Since the text view delegates theme switching to its parent document view, we just send the theme (bundle item) directly to the document view.
2012-09-10 22:47:58 +02:00
Allan Odgaard
80a0efb563 Update themed UI colors from OakDocumentView
This is an ongoing effort to refactor and simplify OakTextView. The goal is to move decisions up the hierarchy and instead have properties on the objects lower in the hierarchy (making the components more flexible and allowing for better decision making at the higher level).
2012-09-10 22:47:57 +02:00
Allan Odgaard
d442a49e1e Add ibeamCursor property to OakTextView
We now require this to be set when changing theme, rather than have the IBeamCursor getter return a cursor appropriate for the current theme.

When switching themes we need to update several UI elements (scrollview background and knob style, gutter view, and possibly more in the future) so we might as well move the logic that picks the proper cursor color to this setup code.
2012-09-10 22:47:57 +02:00
Allan Odgaard
fe5d47272e Only fill with “clear color” for transparent themes 2012-09-10 22:47:57 +02:00
Allan Odgaard
87d780d9f6 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:24:05 +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