From b9518f1a321e8119f89e4c6ac083c775f6043cac Mon Sep 17 00:00:00 2001 From: tisfeng Date: Sun, 10 Dec 2023 18:10:25 +0800 Subject: [PATCH] perf(UI): adjust blue text button expandValue and vertical padding --- .../View/CustomButton/BlueTextButton/EZBlueTextButton.h | 2 +- .../View/CustomButton/BlueTextButton/EZBlueTextButton.m | 2 +- .../ViewController/View/WordResultView/EZWordResultView.m | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Easydict/Feature/ViewController/View/CustomButton/BlueTextButton/EZBlueTextButton.h b/Easydict/Feature/ViewController/View/CustomButton/BlueTextButton/EZBlueTextButton.h index f877dd502..d6d6ceaa3 100644 --- a/Easydict/Feature/ViewController/View/CustomButton/BlueTextButton/EZBlueTextButton.h +++ b/Easydict/Feature/ViewController/View/CustomButton/BlueTextButton/EZBlueTextButton.h @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @interface EZBlueTextButton : EZHoverButton -@property (nonatomic, assign) CGFloat expandValue; // default is 6. +@property (nonatomic, assign) CGFloat expandValue; // default is 5. @property (nonatomic, copy, nullable) NSString *openURL; @property (nonatomic, assign) BOOL closeWindowAfterOpeningURL; diff --git a/Easydict/Feature/ViewController/View/CustomButton/BlueTextButton/EZBlueTextButton.m b/Easydict/Feature/ViewController/View/CustomButton/BlueTextButton/EZBlueTextButton.m index 83f5e8620..a914b345f 100644 --- a/Easydict/Feature/ViewController/View/CustomButton/BlueTextButton/EZBlueTextButton.m +++ b/Easydict/Feature/ViewController/View/CustomButton/BlueTextButton/EZBlueTextButton.m @@ -12,7 +12,7 @@ @implementation EZBlueTextButton - (instancetype)initWithFrame:(NSRect)frameRect { if (self = [super initWithFrame:frameRect]) { - self.expandValue = 6; + self.expandValue = 5; } return self; } diff --git a/Easydict/Feature/ViewController/View/WordResultView/EZWordResultView.m b/Easydict/Feature/ViewController/View/WordResultView/EZWordResultView.m index 3bcd92e10..d3e047bfd 100644 --- a/Easydict/Feature/ViewController/View/WordResultView/EZWordResultView.m +++ b/Easydict/Feature/ViewController/View/WordResultView/EZWordResultView.m @@ -35,7 +35,7 @@ static const CGFloat kHorizontalMargin_8 = 8; static const CGFloat kVerticalMargin_12 = 12; static const CGFloat kVerticalPadding_6 = 6; -static const CGFloat kBlueTextButtonVerticalPadding_3 = 3; +static const CGFloat kBlueTextButtonVerticalPadding_2 = 2; static NSString *const kAppleDictionaryURIScheme = @"x-dictionary"; @@ -652,13 +652,13 @@ - (void)refreshWithResult:(EZQueryResult *)result { exceptedWidth += leftOffset; make.left.offset(leftOffset); // Since button has been expanded, so need to be shifted to the left. if (partLabel) { - CGFloat topOffset = kBlueTextButtonVerticalPadding_3; + CGFloat topOffset = kBlueTextButtonVerticalPadding_2; height += topOffset; make.top.equalTo(partLabel.mas_bottom).offset(topOffset); } else { CGFloat topOffset = kHorizontalMargin_8; if (lastView) { - topOffset = kBlueTextButtonVerticalPadding_3; + topOffset = kBlueTextButtonVerticalPadding_2; if (idx == 0) { topOffset = 8; } @@ -971,7 +971,7 @@ - (NSView *)buildSynonymsAndAntonymsView:(NSString *)title parts:(NSArray