mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-29 18:02:03 +00:00
Merge branch 'master' into slevenbits
This commit is contained in:
commit
9d57d02eb5
4 files changed
+37
-9
No files matched your search
@@ -1174,6 +1174,10 @@ var LABEL_MARGIN = 2.0;
|
||||
|
||||
- (void)setEnabled:(BOOL)shouldBeEnabled
|
||||
{
|
||||
// Tiling is very expensive so try to avoid it. The CPToolbarItem should already be careful to not notifying about its enabled state needlessly.
|
||||
if ([self isEnabled] === shouldBeEnabled)
|
||||
return;
|
||||
|
||||
[super setEnabled:shouldBeEnabled];
|
||||
|
||||
if (shouldBeEnabled)
|
||||
|
||||
+32
-6
@@ -275,6 +275,9 @@ CPToolbarPrintItemIdentifier = @"CPToolbarPrintItem";
|
||||
*/
|
||||
- (void)setEnabled:(BOOL)shouldBeEnabled
|
||||
{
|
||||
if (_isEnabled === shouldBeEnabled)
|
||||
return;
|
||||
|
||||
if ([_view respondsToSelector:@selector(setEnabled:)])
|
||||
[_view setEnabled:shouldBeEnabled];
|
||||
|
||||
@@ -457,26 +460,49 @@ CPToolbarItemVisibilityPriorityUser
|
||||
if (_view)
|
||||
{
|
||||
if ([target respondsToSelector:@selector(validateToolbarItem:)])
|
||||
[self setEnabled:[target validateToolbarItem:self]];
|
||||
{
|
||||
var shouldBeEnabled = [target validateToolbarItem:self];
|
||||
if (_isEnabled !== shouldBeEnabled)
|
||||
[self setEnabled:shouldBeEnabled];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!action)
|
||||
return [self setEnabled:NO];
|
||||
{
|
||||
if (_isEnabled)
|
||||
return [self setEnabled:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
if (target && ![target respondsToSelector:action])
|
||||
return [self setEnabled:NO];
|
||||
{
|
||||
if (_isEnabled)
|
||||
return [self setEnabled:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
target = [CPApp targetForAction:action to:target from:self];
|
||||
|
||||
if (!target)
|
||||
return [self setEnabled:NO];
|
||||
{
|
||||
if (_isEnabled)
|
||||
return [self setEnabled:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
if ([target respondsToSelector:@selector(validateToolbarItem:)])
|
||||
[self setEnabled:[target validateToolbarItem:self]];
|
||||
{
|
||||
var shouldBeEnabled = [target validateToolbarItem:self];
|
||||
if (_isEnabled !== shouldBeEnabled)
|
||||
[self setEnabled:shouldBeEnabled];
|
||||
}
|
||||
else
|
||||
[self setEnabled:YES];
|
||||
{
|
||||
if (!_isEnabled)
|
||||
[self setEnabled:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)autovalidates
|
||||
|
||||
@@ -176,8 +176,6 @@ var _CPKeyedArchiverStringClass = Nil,
|
||||
|
||||
_replacementObjects = [CPDictionary dictionary];
|
||||
|
||||
_data = data;
|
||||
|
||||
_plistObject = [CPDictionary dictionary];
|
||||
_plistObjects = [CPArray arrayWithObject:_CPKeyedArchiverNullString];
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
// adjust the frame
|
||||
_frame.origin.x -= 4;
|
||||
_frame.origin.y -= 4;
|
||||
_frame.size.width += 6;
|
||||
_frame.size.width += 7;
|
||||
_bounds.size.width += 7;
|
||||
|
||||
[self setPullsDown:[cell pullsDown]];
|
||||
|
||||
Reference in new issue
Block a user