Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
feat: adjust font size
Browse files Browse the repository at this point in the history
Signed-off-by: 82Flex <[email protected]>
  • Loading branch information
Lessica committed Jan 28, 2024
1 parent 35f47b1 commit f591649
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions layout/Applications/TrollSpeed.app/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.11.0</string>
<string>1.11.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.11.0</string>
<string>1.11.1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion layout/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ch.xxtou.hudapp
Name: HUD App
Version: 1.11.0
Version: 1.11.1
Section: Tweaks
Depends: firmware (>= 14.0), mobilesubstrate (>= 0.9.7000)
Architecture: iphoneos-arm
Expand Down
3 changes: 1 addition & 2 deletions sources/HUDBackdropLabel.mm
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ - (void)setupAppearance
]];

_backdropTextLayer = [CATextLayer layer];
_backdropTextLayer.contentsScale = self.layer.contentsScale * 1.1;
_backdropTextLayer.allowsFontSubpixelQuantization = YES;
_backdropTextLayer.contentsScale = self.layer.contentsScale * 1.2;
_backdropTextLayer.actions = @{
@"bounds": [NSNull null],
@"contents": [NSNull null],
Expand Down
17 changes: 12 additions & 5 deletions sources/HUDRootViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
#define INLINE_SEPARATOR "\t"
#define IDLE_INTERVAL 3.0

static const double HUD_MIN_FONT_SIZE = 9.0;
static const double HUD_MAX_FONT_SIZE = 10.0;
static const double HUD_MIN_CORNER_RADIUS = 4.5;
static const double HUD_MAX_CORNER_RADIUS = 5.0;
static double HUD_FONT_SIZE = 8.0;
static UIFontWeight HUD_FONT_WEIGHT = UIFontWeightRegular;
static CGFloat HUD_INACTIVE_OPACITY = 0.667;
Expand Down Expand Up @@ -395,8 +399,8 @@ - (void)reloadUserDefaults
HUD_DOWNLOAD_PREFIX = (usesArrowPrefixes ? "" : "");

BOOL usesLargeFont = [self usesLargeFont];
HUD_FONT_SIZE = (usesLargeFont ? 9.0 : 8.0);
[_blurView.layer setCornerRadius:(usesLargeFont ? 4.5 : 4.0)];
HUD_FONT_SIZE = (usesLargeFont ? HUD_MAX_FONT_SIZE : HUD_MIN_FONT_SIZE);
[_blurView.layer setCornerRadius:(usesLargeFont ? HUD_MAX_CORNER_RADIUS : HUD_MIN_CORNER_RADIUS)];

BOOL usesInvertedColor = [self usesInvertedColor];
HUD_FONT_WEIGHT = (usesInvertedColor ? UIFontWeightSemibold : UIFontWeightRegular);
Expand Down Expand Up @@ -591,7 +595,7 @@ - (void)viewDidLoad

_blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
_blurView = [[UIVisualEffectView alloc] initWithEffect:_blurEffect];
_blurView.layer.cornerRadius = 4.0;
_blurView.layer.cornerRadius = HUD_MIN_CORNER_RADIUS;
_blurView.layer.masksToBounds = YES;
_blurView.translatesAutoresizingMaskIntoConstraints = NO;
_containerView = [[ScreenshotInvisibleContainer alloc] initWithContent:_blurView];
Expand Down Expand Up @@ -744,8 +748,11 @@ - (void)updateViewConstraints
CGFloat minimumTopConstraintConstant = 0;
CGFloat minimumBottomConstraintConstant = 0;

if (CGRectGetMinY(layoutGuide.layoutFrame) > 30) {
minimumTopConstraintConstant = -10;
if (CGRectGetMinY(layoutGuide.layoutFrame) >= 51) {
minimumTopConstraintConstant = -8;
}
else if (CGRectGetMinY(layoutGuide.layoutFrame) > 30) {
minimumTopConstraintConstant = -12;
minimumBottomConstraintConstant = -4;
} else {
#if !NO_TROLL
Expand Down
6 changes: 3 additions & 3 deletions sources/RootViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#define HUD_TRANSITION_DURATION 0.25

static BOOL _gShouldToggleHUDAfterLaunch = NO;
static const CGFloat _gTopButtonConstraintsConstantCompact = 40.f;
static const CGFloat _gTopButtonConstraintsConstantCompact = 46.f;
static const CGFloat _gTopButtonConstraintsConstantRegular = 28.f;
static const CGFloat _gTopButtonConstraintsConstantRegularPad = 40.f;
static const CGFloat _gTopButtonConstraintsConstantRegularPad = 46.f;
static const CGFloat _gAuthorLabelBottomConstraintConstantCompact = -20.f;
static const CGFloat _gAuthorLabelBottomConstraintConstantRegular = -80.f;

Expand Down Expand Up @@ -241,7 +241,7 @@ - (void)loadView

- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
_supportsCenterMost = self.view.window.safeAreaLayoutGuide.layoutFrame.origin.y >= 51;
_supportsCenterMost = CGRectGetMinY(self.view.window.safeAreaLayoutGuide.layoutFrame) >= 51;
}

- (void)viewDidLoad {
Expand Down
4 changes: 2 additions & 2 deletions supports/Sandbox-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.11.0</string>
<string>1.11.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.11.0</string>
<string>1.11.1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>NSHumanReadableCopyright</key>
Expand Down

0 comments on commit f591649

Please sign in to comment.