From d612346db56f0268a24ade57c1d288770836aa8a Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Fri, 19 Dec 2025 21:36:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=AB=8B=E5=8D=B3=E5=85=85?= =?UTF-8?q?=E5=80=BC=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CustomKeyboard/KeyboardViewController.m | 4 ---- CustomKeyboard/View/KBToolBar.h | 2 +- CustomKeyboard/View/KBToolBar.m | 12 ++++++------ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CustomKeyboard/KeyboardViewController.m b/CustomKeyboard/KeyboardViewController.m index be8711f..38259f5 100644 --- a/CustomKeyboard/KeyboardViewController.m +++ b/CustomKeyboard/KeyboardViewController.m @@ -277,10 +277,6 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center, - (void)keyBoardMainView:(KBKeyBoardMainView *)keyBoardMainView didTapToolActionAtIndex:(NSInteger)index { if (index == 0) { - [self showSubscriptionPanel]; - return; - } - if (index == 1) { [self showFunctionPanel:YES]; return; } diff --git a/CustomKeyboard/View/KBToolBar.h b/CustomKeyboard/View/KBToolBar.h index 2179cd0..5bb4553 100644 --- a/CustomKeyboard/View/KBToolBar.h +++ b/CustomKeyboard/View/KBToolBar.h @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, weak, nullable) id delegate; -/// 左侧按钮的标题(数量由数组决定)。默认值:@[@"Recharge Now", @"AI"]。 +/// 左侧按钮的标题(数量由数组决定)。默认值:@[@"AI"]。 @property (nonatomic, copy) NSArray *leftButtonTitles; /// 暴露按钮以便外部定制(只读;首次访问时懒加载创建) diff --git a/CustomKeyboard/View/KBToolBar.m b/CustomKeyboard/View/KBToolBar.m index c56dcd4..ce4000a 100644 --- a/CustomKeyboard/View/KBToolBar.m +++ b/CustomKeyboard/View/KBToolBar.m @@ -29,7 +29,7 @@ static const CGFloat kKBAIButtonHeight = 36.0f; - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { self.backgroundColor = [UIColor clearColor]; - _leftButtonTitles = @[KBLocalized(@"Recharge Now"), @"AI"]; // 默认标题 + _leftButtonTitles = @[@"AI"]; // 默认标题 [self setupUI]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(kb_undoStateChanged) @@ -109,7 +109,7 @@ static const CGFloat kKBAIButtonHeight = 36.0f; [buttons addObject:btn]; [btn mas_makeConstraints:^(MASConstraintMaker *make) { - if (i == 1) { + if (i == 0) { make.centerY.equalTo(self.leftContainer); make.width.mas_equalTo(kKBAIButtonWidth); make.height.mas_equalTo(kKBAIButtonHeight); @@ -196,7 +196,7 @@ static const CGFloat kKBAIButtonHeight = 36.0f; [aiButton setBackgroundImage:nil forState:UIControlStateNormal]; [aiButton setBackgroundImage:nil forState:UIControlStateHighlighted]; [aiButton setBackgroundImage:nil forState:UIControlStateSelected]; - NSString *title = (self.leftButtonTitles.count > 1) ? self.leftButtonTitles[1] : @"AI"; + NSString *title = (self.leftButtonTitles.count > 0) ? self.leftButtonTitles[0] : @"AI"; [aiButton setTitle:title forState:UIControlStateNormal]; aiButton.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9]; aiButton.layer.cornerRadius = 16; @@ -278,8 +278,8 @@ static const CGFloat kKBAIButtonHeight = 36.0f; } - (UIButton *)kb_aiButton { - if (self.leftButtonsInternal.count <= 1) { return nil; } - return self.leftButtonsInternal[1]; + if (self.leftButtonsInternal.count == 0) { return nil; } + return self.leftButtonsInternal[0]; } #pragma mark - Globe (Input Mode Switch) @@ -324,7 +324,7 @@ static const CGFloat kKBAIButtonHeight = 36.0f; make.right.equalTo(self).offset(-12); } make.centerY.equalTo(self.mas_centerY); - make.height.mas_equalTo(32); + make.height.mas_equalTo(MAX(32.0f, kKBAIButtonHeight)); }]; }