Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kgn/linenclipview
Adds a linen pattern behind scrollviews like in Apple's Lion apps.
https://github.com/kgn/linenclipview
Last synced: 9 days ago
JSON representation
Adds a linen pattern behind scrollviews like in Apple's Lion apps.
- Host: GitHub
- URL: https://github.com/kgn/linenclipview
- Owner: kgn
- License: mit
- Created: 2011-12-20T06:41:50.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-12-01T03:20:54.000Z (almost 12 years ago)
- Last Synced: 2024-10-31T14:50:35.326Z (16 days ago)
- Language: Objective-C
- Homepage:
- Size: 1.15 MB
- Stars: 58
- Watchers: 8
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**LinenClipView** provides a subclass of `NSScrollView` and `WebView`
that displays a linen pattern in the clip view like many of Apple's Lion apps. This library can of course be used to display any background image.---
In **Interface Builder** change the *Class* of an `NSScrollView` to `LNScrollView` or similarly change the *Class* of a `WebView` to `LNWebView`.
These classes can also be created via code with `initWithFrame`.
To set the pattern image simply call `setPattern` on either subclass:
``` obj-c
[self.tableScrollView setPattern:[NSImage imageNamed:@"pattern11"]];
[self.webView setPattern:[NSImage imageNamed:@"pattern3"]];
```The sample project that ships with this project demonstrates this.
![](https://github.com/kgn/LinenClipView/raw/master/Screenshot.png)
---
Special thanks to [@Dimillian](https://twitter.com/#!/dimillian) for figuring out how to keep the
pattern stationary(`[NSGraphicsContext setPatternPhase:]`) and [@caffeinatedapp](https://twitter.com/#!/caffeinatedapp) for figuring out a fix to the scrollbars on Lion(the complicated `hitTest` code).The background patterns included with this project are from [@minimalpatterns](http://www.minimal-patterns.com).
**LinenClipView** is available under the MIT license. See the LICENSE file for more info.