Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit fc4f788

Browse files
committed
add landscape toggle
1 parent 0886d25 commit fc4f788

File tree

7 files changed

+58
-7
lines changed

7 files changed

+58
-7
lines changed

HUDMainApplication.mm

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,13 @@ - (BOOL)usesLargeFont
907907
return mode ? [mode boolValue] : NO;
908908
}
909909

910+
- (BOOL)usesRotation
911+
{
912+
[self loadUserDefaults:NO];
913+
NSNumber *mode = [_userDefaults objectForKey:@"usesRotation"];
914+
return mode ? [mode boolValue] : NO;
915+
}
916+
910917
- (instancetype)init
911918
{
912919
self = [super init];
@@ -968,6 +975,25 @@ static inline CGRect orientationBounds(UIInterfaceOrientation orientation, CGRec
968975

969976
- (void)updateOrientation:(UIInterfaceOrientation)orientation animateWithDuration:(NSTimeInterval)duration
970977
{
978+
BOOL usesRotation = [self usesRotation];
979+
980+
if (!usesRotation)
981+
{
982+
if (orientation == UIInterfaceOrientationPortrait)
983+
{
984+
[UIView animateWithDuration:duration animations:^{
985+
self->_contentView.alpha = self->_isFocused ? 1.0 : 0.667;
986+
}];
987+
}
988+
else
989+
{
990+
[UIView animateWithDuration:duration animations:^{
991+
self->_contentView.alpha = 0.0;
992+
}];
993+
}
994+
return;
995+
}
996+
971997
if (orientation == _orientation)
972998
return;
973999
_orientation = orientation;
@@ -978,6 +1004,7 @@ - (void)updateOrientation:(UIInterfaceOrientation)orientation animateWithDuratio
9781004
[self.view setBounds:bounds];
9791005

9801006
[self onBlur:self->_contentView duration:duration];
1007+
9811008
[UIView animateWithDuration:duration animations:^{
9821009
[self.view setTransform:CGAffineTransformMakeRotation(orientationAngle(orientation))];
9831010
} completion:^(BOOL finished) {

MainApplication.mm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,20 @@ - (void)setUsesLargeFont:(BOOL)usesLargeFont
315315
[self saveUserDefaults];
316316
}
317317

318+
- (BOOL)usesRotation
319+
{
320+
[self loadUserDefaults:NO];
321+
NSNumber *mode = [_userDefaults objectForKey:@"usesRotation"];
322+
return mode ? [mode boolValue] : NO;
323+
}
324+
325+
- (void)setUsesRotation:(BOOL)usesRotation
326+
{
327+
[self loadUserDefaults:NO];
328+
[_userDefaults setObject:@(usesRotation) forKey:@"usesRotation"];
329+
[self saveUserDefaults];
330+
}
331+
318332
- (void)reloadMainButtonState
319333
{
320334
[UIView transitionWithView:self.view duration:0.25 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{

TSSettingsController.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import UIKit
1212
internal var restartRequired = false
1313

1414
open override func settingsCount() -> Int {
15-
return 5;
15+
return 6;
1616
}
1717

1818
open override func settingTitle(index: Int, highlighted: Bool) -> String {
@@ -24,8 +24,10 @@ import UIKit
2424
return NSLocalizedString("Unit", comment: "")
2525
} else if index == 3 {
2626
return NSLocalizedString("Prefixes", comment: "")
27-
} else {
27+
} else if index == 4 {
2828
return NSLocalizedString("Size", comment: "")
29+
} else {
30+
return NSLocalizedString("Landscape", comment: "")
2931
}
3032
}
3133

@@ -61,12 +63,18 @@ import UIKit
6163
} else {
6264
return NSLocalizedString("▲▼", comment: "")
6365
}
64-
} else {
66+
} else if index == 4 {
6567
if (highlighted) {
6668
return NSLocalizedString("Large", comment: "")
6769
} else {
6870
return NSLocalizedString("Standard", comment: "")
6971
}
72+
} else {
73+
if (highlighted) {
74+
return NSLocalizedString("Follow", comment: "")
75+
} else {
76+
return NSLocalizedString("Hide", comment: "")
77+
}
7078
}
7179
}
7280

@@ -79,8 +87,10 @@ import UIKit
7987
return "usesBitrate"
8088
} else if index == 3 {
8189
return "usesArrowPrefixes"
82-
} else {
90+
} else if index == 4 {
8391
return "usesLargeFont"
92+
} else {
93+
return "usesRotation"
8494
}
8595
}
8696

layout/Applications/XXTAssistiveTouch.app/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<key>CFBundleDisplayName</key>
1212
<string>TrollSpeed</string>
1313
<key>CFBundleVersion</key>
14-
<string>1.8.1</string>
14+
<string>1.8.2</string>
1515
<key>CFBundleExecutable</key>
1616
<string>XXTAssistiveTouch</string>
1717
<key>NSPrincipalClass</key>
@@ -39,6 +39,6 @@
3939
<key>NSHumanReadableCopyright</key>
4040
<string>Copyright © 2009 Apple Inc. All Rights Reserved.</string>
4141
<key>CFBundleShortVersionString</key>
42-
<string>1.8.1</string>
42+
<string>1.8.2</string>
4343
</dict>
4444
</plist>
Binary file not shown.
Binary file not shown.

layout/DEBIAN/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: ch.xxtou.hud
22
Name: HUD App
3-
Version: 1.8.1
3+
Version: 1.8.2
44
Section: Tweaks
55
Depends: firmware (>= 13.0), mobilesubstrate (>= 0.9.7000), com.rpetrich.rocketbootstrap (>= 1.0.9)
66
Architecture: iphoneos-arm

0 commit comments

Comments
 (0)