mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
_CPRuleEditorViewSliceRow integration
This commit is contained in:
@@ -127,7 +127,7 @@ var CPRuleEditorItemPBoardType = @"CPRuleEditorItemPBoardType",
|
||||
BOOL _isKeyDown;
|
||||
BOOL _nestingModeDidChange;
|
||||
|
||||
_CPRuleEditorLocalizer _standardLocalizer @accessors(property=standardLocalizer);
|
||||
_CPRuleEditorLocalizer _standardLocalizer;
|
||||
CPDictionary _itemsAndValuesToAddForRowType;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ var CPRuleEditorItemPBoardType = @"CPRuleEditorItemPBoardType",
|
||||
*/
|
||||
- (CPDictionary)formattingDictionary
|
||||
{
|
||||
return [_standardLocalizer dictionary];
|
||||
return [[self standardLocalizer] dictionary];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -396,6 +396,9 @@ var CPRuleEditorItemPBoardType = @"CPRuleEditorItemPBoardType",
|
||||
*/
|
||||
- (void)setFormattingDictionary:(CPDictionary)dictionary
|
||||
{
|
||||
if (_standardLocalizer == nil)
|
||||
_standardLocalizer = [_CPRuleEditorLocalizer new];
|
||||
|
||||
[_standardLocalizer setDictionary:dictionary];
|
||||
_stringsFilename = nil;
|
||||
}
|
||||
@@ -440,6 +443,19 @@ var CPRuleEditorItemPBoardType = @"CPRuleEditorItemPBoardType",
|
||||
}
|
||||
}
|
||||
|
||||
- (_CPRuleEditorLocalizer)standardLocalizer
|
||||
{
|
||||
if (_standardLocalizer == nil)
|
||||
_standardLocalizer = [_CPRuleEditorLocalizer new];
|
||||
|
||||
return _standardLocalizer;
|
||||
}
|
||||
|
||||
- (void)setStandardLocalizer:(_CPRuleEditorLocalizer)aLocalizer
|
||||
{
|
||||
_standardLocalizer = aLocalizer;
|
||||
}
|
||||
|
||||
/*!
|
||||
@name Providing Data
|
||||
*/
|
||||
@@ -1924,17 +1940,17 @@ TODO: implement
|
||||
|
||||
- (CPString)_toolTipForAddCompoundRowButton
|
||||
{
|
||||
return [_standardLocalizer localizedStringForString:@"Add compound row"];
|
||||
return [[self standardLocalizer] localizedStringForString:@"Add compound row"];
|
||||
}
|
||||
|
||||
- (CPString)_toolTipForAddSimpleRowButton
|
||||
{
|
||||
return [_standardLocalizer localizedStringForString:@"Add row"];
|
||||
return [[self standardLocalizer] localizedStringForString:@"Add row"];
|
||||
}
|
||||
|
||||
- (CPString)_toolTipForDeleteRowButton
|
||||
{
|
||||
return [_standardLocalizer localizedStringForString:@"Delete row"];
|
||||
return [[self standardLocalizer] localizedStringForString:@"Delete row"];
|
||||
}
|
||||
|
||||
- (void)_updateSliceIndentations
|
||||
|
||||
@@ -334,6 +334,28 @@
|
||||
|
||||
[_correspondingRuleItems setArray:ruleItems];
|
||||
|
||||
// Localize drop-down options in context and reorder/insert intermediate labels natively
|
||||
var localizer = [_ruleEditor standardLocalizer];
|
||||
if (localizer)
|
||||
{
|
||||
[localizer localizeMenuItemsForViews:_ruleOptionViews];
|
||||
_ruleOptionViews = [localizer localizeAndReorderViews:_ruleOptionViews];
|
||||
}
|
||||
|
||||
// Rebuild frame configurations to match the new localized layout order
|
||||
[_ruleOptionFrames removeAllObjects];
|
||||
[_ruleOptionInitialViewFrames removeAllObjects];
|
||||
|
||||
var newCount = [_ruleOptionViews count];
|
||||
for (var i = 0; i < newCount; i++)
|
||||
{
|
||||
var view = [_ruleOptionViews objectAtIndex:i],
|
||||
frame = [view frame];
|
||||
|
||||
[_ruleOptionFrames addObject:frame];
|
||||
[_ruleOptionInitialViewFrames addObject:frame];
|
||||
}
|
||||
|
||||
if (!_editable)
|
||||
[self _updateEnabledStateForSubviews];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user