mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-02 21:29:45 +00:00
Merge remote-tracking branch 'cappuccino/master'
This commit is contained in:
commit
043cc13bb3
4 files changed
+28
-16
No files matched your search
@@ -550,7 +550,7 @@ var CPTableHeaderViewResizeZone = 3.0,
|
||||
- (void)_autoscroll:(CPEvent)theEvent localLocation:(CGPoint)theLocation
|
||||
{
|
||||
// Constrain the y coordinate so we don't autoscroll vertically
|
||||
var constrainedLocation = CGPointMake(theLocation.x, CGRectGetMinY([_tableView visibleRect])),
|
||||
var constrainedLocation = CGPointMake(theLocation.x, CGRectGetMaxY([self frame])),
|
||||
constrainedEvent = [CPEvent mouseEventWithType:CPLeftMouseDragged
|
||||
location:[self convertPoint:constrainedLocation toView:nil]
|
||||
modifierFlags:[theEvent modifierFlags]
|
||||
|
||||
@@ -49,6 +49,8 @@ var defaultDateFormatterBehavior = CPDateFormatterBehavior10_4,
|
||||
relativeDateFormating,
|
||||
patternStringTokens;
|
||||
|
||||
var _separatorsCharacterSet = nil;
|
||||
|
||||
/*!
|
||||
@ingroup foundation
|
||||
@class CPDateFormatter
|
||||
@@ -136,6 +138,14 @@ var defaultDateFormatterBehavior = CPDateFormatterBehavior10_4,
|
||||
defaultDateFormatterBehavior = behavior;
|
||||
}
|
||||
|
||||
+ (CPCharacterSet)_separatorsCharacterSet
|
||||
{
|
||||
if (_separatorsCharacterSet == nil)
|
||||
_separatorsCharacterSet = [CPCharacterSet characterSetWithCharactersInString:@" ,:/-."];
|
||||
|
||||
return _separatorsCharacterSet;
|
||||
}
|
||||
|
||||
/*! Init a dateFormatter
|
||||
@return a new CPDateFormatter
|
||||
*/
|
||||
@@ -743,7 +753,7 @@ var defaultDateFormatterBehavior = CPDateFormatterBehavior10_4,
|
||||
continue;
|
||||
}
|
||||
|
||||
if ([character isEqualToString:@","] || [character isEqualToString:@":"] || [character isEqualToString:@"/"] || [character isEqualToString:@"-"] || [character isEqualToString:@" "] || [character isEqualToString:@"."])
|
||||
if ([[CPDateFormatter _separatorsCharacterSet] characterIsMember:character])
|
||||
{
|
||||
result += [self _stringFromToken:currentToken date:aDate];
|
||||
result += character;
|
||||
|
||||
@@ -23,31 +23,26 @@
|
||||
@import <AppKit/CPTableHeaderView.j>
|
||||
|
||||
@class CPTableView
|
||||
@class Nib2Cib
|
||||
|
||||
|
||||
@implementation CPTableHeaderView (NSCoding)
|
||||
|
||||
- (id)NS_initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
if (self = [super NS_initWithCoder:aCoder])
|
||||
{
|
||||
_tableView = [aCoder decodeObjectForKey:"NSTableView"];
|
||||
|
||||
// change the default height
|
||||
if (_bounds.size.height === 17)
|
||||
{
|
||||
var theme = [Nib2Cib defaultTheme],
|
||||
height = [theme valueForAttributeWithName:@"header-view-height" forClass:CPTableView];
|
||||
|
||||
_bounds.size.height = height;
|
||||
_frame.size.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)_setHeightIfDefaultValue:(CPInteger)height
|
||||
{
|
||||
if (_bounds.size.height === 17)
|
||||
{
|
||||
_bounds.size.height = height;
|
||||
_frame.size.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSTableHeaderView : CPTableHeaderView
|
||||
|
||||
@@ -86,6 +86,13 @@
|
||||
_allowsColumnReordering = (flags & 0x80000000) ? YES : NO;
|
||||
|
||||
[self setBackgroundColor:[aCoder decodeObjectForKey:@"NSBackgroundColor"]];
|
||||
|
||||
var headerViewHeight = [theme valueForAttributeWithName:@"header-view-height" forClass:CPTableView];
|
||||
|
||||
if (!headerViewHeight)
|
||||
headerViewHeight = [self currentValueForThemeAttribute:@"header-view-height"];
|
||||
|
||||
[_headerView _setHeightIfDefaultValue:headerViewHeight];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
Reference in new issue
Block a user