1
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
@implementation KBToolBar
|
@implementation KBToolBar
|
||||||
|
|
||||||
static NSString * const kKBAIKeyIdentifier = @"ai";
|
static NSString * const kKBAIKeyIdentifier = @"ai";
|
||||||
|
static NSString * const kKBUndoKeyIdentifier = @"key_revoke";
|
||||||
static const CGFloat kKBAIButtonWidth = 40;
|
static const CGFloat kKBAIButtonWidth = 40;
|
||||||
static const CGFloat kKBAIButtonHeight = 40;
|
static const CGFloat kKBAIButtonHeight = 40;
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ static const CGFloat kKBAIButtonHeight = 40;
|
|||||||
make.right.equalTo(self.mas_right).offset(-12);
|
make.right.equalTo(self.mas_right).offset(-12);
|
||||||
make.centerY.equalTo(self.mas_centerY);
|
make.centerY.equalTo(self.mas_centerY);
|
||||||
make.height.mas_equalTo(32);
|
make.height.mas_equalTo(32);
|
||||||
|
make.width.mas_equalTo(84);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
[self kb_updateLeftContainerConstraints];
|
[self kb_updateLeftContainerConstraints];
|
||||||
@@ -169,6 +171,7 @@ static const CGFloat kKBAIButtonHeight = 40;
|
|||||||
|
|
||||||
- (void)kb_applyTheme {
|
- (void)kb_applyTheme {
|
||||||
[self kb_updateAIButtonAppearance];
|
[self kb_updateAIButtonAppearance];
|
||||||
|
[self kb_updateUndoButtonAppearance];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)kb_updateAIButtonAppearance {
|
- (void)kb_updateAIButtonAppearance {
|
||||||
@@ -205,6 +208,26 @@ static const CGFloat kKBAIButtonHeight = 40;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)kb_updateUndoButtonAppearance {
|
||||||
|
if (!self.undoButtonInternal) { return; }
|
||||||
|
|
||||||
|
KBSkinManager *skinManager = [KBSkinManager shared];
|
||||||
|
UIImage *icon = [skinManager iconImageForKeyIdentifier:kKBUndoKeyIdentifier caseVariant:0];
|
||||||
|
if (!icon) {
|
||||||
|
icon = [UIImage imageNamed:@"key_revoke"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (icon) {
|
||||||
|
[self.undoButtonInternal setImage:icon forState:UIControlStateNormal];
|
||||||
|
[self.undoButtonInternal setImage:icon forState:UIControlStateHighlighted];
|
||||||
|
[self.undoButtonInternal setImage:icon forState:UIControlStateSelected];
|
||||||
|
} else {
|
||||||
|
[self.undoButtonInternal setImage:nil forState:UIControlStateNormal];
|
||||||
|
[self.undoButtonInternal setImage:nil forState:UIControlStateHighlighted];
|
||||||
|
[self.undoButtonInternal setImage:nil forState:UIControlStateSelected];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Actions
|
#pragma mark - Actions
|
||||||
|
|
||||||
- (void)onLeftAction:(UIButton *)sender {
|
- (void)onLeftAction:(UIButton *)sender {
|
||||||
|
|||||||
Reference in New Issue
Block a user