Skip to content

Adds a linen pattern behind scrollviews like in Apple's Lion apps.

License

Notifications You must be signed in to change notification settings

kgn/LinenClipView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

[self.tableScrollView setPattern:[NSImage imageNamed:@"pattern11"]];
[self.webView setPattern:[NSImage imageNamed:@"pattern3"]];

The sample project that ships with this project demonstrates this.


Special thanks to @Dimillian for figuring out how to keep the pattern stationary([NSGraphicsContext setPatternPhase:]) and @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.

LinenClipView is available under the MIT license. See the LICENSE file for more info.

About

Adds a linen pattern behind scrollviews like in Apple's Lion apps.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published