From 8e934dd83a2f2674cf139353c988e5e77ff42d02 Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Thu, 25 Dec 2025 17:58:33 +0800 Subject: [PATCH] 1 --- CustomKeyboard/View/KBToolBar.m | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CustomKeyboard/View/KBToolBar.m b/CustomKeyboard/View/KBToolBar.m index 19ffe93..3eeec40 100644 --- a/CustomKeyboard/View/KBToolBar.m +++ b/CustomKeyboard/View/KBToolBar.m @@ -23,6 +23,7 @@ @implementation KBToolBar static NSString * const kKBAIKeyIdentifier = @"ai"; +static NSString * const kKBUndoKeyIdentifier = @"key_revoke"; static const CGFloat kKBAIButtonWidth = 40; static const CGFloat kKBAIButtonHeight = 40; @@ -96,6 +97,7 @@ static const CGFloat kKBAIButtonHeight = 40; make.right.equalTo(self.mas_right).offset(-12); make.centerY.equalTo(self.mas_centerY); make.height.mas_equalTo(32); + make.width.mas_equalTo(84); }]; [self kb_updateLeftContainerConstraints]; @@ -169,6 +171,7 @@ static const CGFloat kKBAIButtonHeight = 40; - (void)kb_applyTheme { [self kb_updateAIButtonAppearance]; + [self kb_updateUndoButtonAppearance]; } - (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 - (void)onLeftAction:(UIButton *)sender {