Commit Graph

338 Commits

Author SHA1 Message Date
Allan Odgaard
28f80a791d Use project’s window title settings for untitled documents
This includes setting up SCM variables and closes issue #298.
2012-09-11 00:05:05 +02:00
Allan Odgaard
b2fa6ff377 Remove UUID from settings API
Don’t recall what the intent was with this.
2012-09-11 00:05:05 +02:00
Allan Odgaard
2333b23fe7 When file is renamed, check if a new file takes its place
Xcode does some weird stuff while saving, it renames the existing file (twice), having it end up in some staging area with a UUID as filename, and then disappear.

Previously TextMate would track these renames, now it waits up to one second for a new file to appear using the old file’s path.
2012-09-10 23:17:32 +02:00
Allan Odgaard
77360e4a6b Proper undo management for external changes
This fixes issue #50.
2012-09-10 22:47:58 +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
b49e35ab6a Harmonize “perform bundle item” method naming
We now have:

 - performBundleItem:
 - performBundleItemWithUUIDString:
 - performBundleItemWithUUIDStringFrom:

I’m leaning toward changing the prefix, as ‘perform’ is mainly action methods invoked as a direct response to some user action (with that action part of the name), but haven’t found a better prefix yet.
2012-09-10 22:47:58 +02:00
Allan Odgaard
20c6a9640d Remove unused helper function
This was from before requiring Lion.
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
5ce947541c Use new theme_t API 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
b88ba4ff23 Extend theme_t’s public API 2012-09-10 22:47:57 +02:00
Allan Odgaard
12f305f82a Spelling dot was drawn flipped 2012-09-10 14:24:05 +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
111c1acd11 Refactor: Remove code duplication 2012-09-10 14:24:05 +02:00
Allan Odgaard
b475bdfdef Refactoring 2012-09-10 14:24:04 +02:00
Allan Odgaard
45b00164c4 Move document::is_binary to where it is used 2012-09-10 14:24:04 +02:00
Allan Odgaard
9dd1585abe fixup! Redo spell checking after changing options 2012-09-10 10:27:42 +02:00
Allan Odgaard
400be883b9 URL-escape PAC string
Since the PAC URL is user supplied it’s unknown what state it actually is in, so we try to create a CFURL object from the raw string and if that fails, we URL-escape it (though not escaping slashes and colons).

Should fix issue #228.
2012-09-09 22:49:55 +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
Allan Odgaard
aed4c1c27f No longer show dialog for readlink() failure
Only one readlink() failure reported (issue #389) which wouldn’t explain the crashes which the dialog (introduced in 68ed8293) was trying to track down.
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
b2acb02a7f Use std::function with cf::callback_t 2012-09-09 16:22:19 +02:00
Allan Odgaard
a3cedb5c58 Use std::function as callback type for setup_timer
There is a minor functional change in that the custom callback type uses event loop signaling that makes it safe to trigger the callback from a thread. This should however not be necessary for timers (which are all setup on the main thread).
2012-09-09 16:22:19 +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
21e29fd011 Add support for obtaining folding dots imagery
Also remove direct access to context_t’s member data (spelling dot image).
2012-09-09 11:32:41 +02:00
Allan Odgaard
92a058b0dd Add x- and cap height to metrics_t
This is to allow potential background bezels, images, and similar to be aligned with the text.
2012-09-09 11:32:41 +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
392c195077 fixup! Retina assets for the "Bundle Editor" window
The non-retina bundle icon lost its alpha mask.
2012-09-09 11:32:40 +02:00
Allan Odgaard
7a67248dec No longer necessary to set all gutter colors
Previously all the colors were calculated so setting e.g. the icon color made it sort of necessary to also set the iconHover and iconPressed color.

Now the default icon hover and pressed colors are a potential user supplied icon color. Likewise, the default icon color is a potential user supplied foreground color, etc.
2012-09-08 01:02:47 +02:00
Allan Odgaard
c154751045 Allow cf::color_t to be uninitialized 2012-09-08 01:00:41 +02:00
Allan Odgaard
6477c32fda Expose gutterSettings when editing themes
Also fix the grammar used for theme and macro editing (meta.plist → source.plist).
2012-09-08 00:42:26 +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
ffeb4ff991 Add simplistic parser for proxy item queries
This only support ‘||’ to allow chained queries, e.g.: ‘action.build || format.strong’.
2012-09-07 16:18:04 +02:00
Allan Odgaard
fd2374e6c6 Don’t use virtual path for retrieving settings 2012-09-07 16:18:04 +02:00
Allan Odgaard
96ba797043 Show proxy item in menu when nothing matched
This way we can have “Lookup Word” in the Source menu being a proxy for “lookup.documentation” and simply rendered as disabled when the current language have no such functionality.
2012-09-07 16:18:03 +02:00
Allan Odgaard
2678358ff9 Encapsulate proxy expansion code
How a proxy items are expanded is not something user code should concern itself with.
2012-09-07 16:18:03 +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
521b981f09 fixup! Fix warning for literal strings used with NSAlert
Since we use another way to initialize the alert, the return codes are different.
2012-09-07 16:17:18 +02:00
Allan Odgaard
bfc3804520 Show matched items for proxies in menu
This means e.g. Bundles → SCM will show the SCM actions available in the current context.
2012-09-06 23:18:42 +02:00
Allan Odgaard
8cf6f94f13 Refactor OakShowMenuForBundleItems 2012-09-06 23:10:56 +02:00
Allan Odgaard
8f5ddc672f Move bundles pop-up menu to BundleMenu library 2012-09-06 23:10:56 +02:00