widget profile accessibility

This commit is contained in:
True Zhuanjia committed 2026-02-14 12:43:31 +08:00
1 parent 28d9a0faf2
commit 63d5417a2c
6 files changed
+30 -11

No files matched your search

+10 -1
View File
@@ -165,13 +165,22 @@ static CGRect layoutViewBounds;
- (void) importEncodedProfiles:(NSMutableArray* )profilesEncoded { - (void) importEncodedProfiles:(NSMutableArray* )profilesEncoded {
NSMutableArray* targetProfiles = [_currentProfiles mutableCopy]; //_currentProfiles is availabled as long as getAllProfiles was called before calling this method (_currentProfiles avoids frequent accessing persisted data) NSMutableArray* targetProfiles = [_currentProfiles mutableCopy]; //_currentProfiles is availabled as long as getAllProfiles was called before calling this method (_currentProfiles avoids frequent accessing persisted data)
OSCProfile* profile;
/* /*
profile = [self findProfileByName:DEFAULT_TEMPLATE_NAME1 inProfileArray:targetProfiles]; profile = [self findProfileByName:DEFAULT_TEMPLATE_NAME1 inProfileArray:targetProfiles];
if(profile && targetProfiles.count > 1) [targetProfiles removeObject:profile]; if(profile && targetProfiles.count > 1) [targetProfiles removeObject:profile];
profile = [self findProfileByName:DEFAULT_TEMPLATE_NAME2 inProfileArray:targetProfiles]; profile = [self findProfileByName:DEFAULT_TEMPLATE_NAME2 inProfileArray:targetProfiles];
if(profile && targetProfiles.count > 1) [targetProfiles removeObject:profile]; if(profile && targetProfiles.count > 1) [targetProfiles removeObject:profile];
*/ */
NSString *bundleId = [[NSBundle mainBundle] bundleIdentifier];
bool importPencilProProfile = ([bundleId isEqualToString:@"com.voidlink.iOS"]
|| [bundleId isEqualToString:@"com.voidlinkextreme.iOS"]
|| [bundleId isEqualToString:@"com.voidlink.tf.debug10.iOS"]);
if(!importPencilProProfile && [Utils isIPad]){
[profilesEncoded removeObjectAtIndex:1];
}
if(targetProfiles.count > 0) [targetProfiles removeObjectAtIndex:0]; if(targetProfiles.count > 0) [targetProfiles removeObjectAtIndex:0];
NSMutableArray* localEncodedPofiles = [self encodedProfilesFromArray:targetProfiles]; NSMutableArray* localEncodedPofiles = [self encodedProfilesFromArray:targetProfiles];
[profilesEncoded addObjectsFromArray:localEncodedPofiles]; [profilesEncoded addObjectsFromArray:localEncodedPofiles];
+6 -1
View File
@@ -2475,7 +2475,12 @@ import SVGKit
eraserShortcut = eraserShortcut.replacingOccurrences(of: "ERASER", with: "") eraserShortcut = eraserShortcut.replacingOccurrences(of: "ERASER", with: "")
self.functionalButtonDelegate?.replaceEraser(shortcut: eraserShortcut) self.functionalButtonDelegate?.replaceEraser(shortcut: eraserShortcut)
case "PRESSURECURVE": case "PRESSURECURVE":
self.functionalButtonDelegate?.presentPressureCurveVC() if ["com.voidlink.iOS"
, "com.voidlinkextreme.iOS"
, "com.voidlink.tf.debug10.iOS"
].contains(Bundle.main.bundleIdentifier) && Utils.isIPad() {
self.functionalButtonDelegate?.presentPressureCurveVC()
}
default: default:
break break
} }
+1
View File
@@ -34,6 +34,7 @@ FOUNDATION_EXPORT NSString *const deviceName;
+ (bool)hdrSupported; + (bool)hdrSupported;
+ (bool)needUpdateDefaultSettings; + (bool)needUpdateDefaultSettings;
+ (BOOL)isIPhone; + (BOOL)isIPhone;
+ (BOOL)isIPad;
#if !TARGET_OS_TV #if !TARGET_OS_TV
+ (void) launchUrl:(NSString*)urlString; + (void) launchUrl:(NSString*)urlString;
+5 -1
View File
@@ -157,7 +157,7 @@ NSString *const deviceName = @"roth";
+ (bool)needUpdateDefaultSettings { + (bool)needUpdateDefaultSettings {
// NSString *key = @"needUpdateDefaultSettings20260209"; // NSString *key = @"needUpdateDefaultSettings20260209";
NSString *key = @"needUpdateDefaultSettings20260212"; NSString *key = @"needUpdateDefaultSettings20260215";
BOOL updatedBefore = [[NSUserDefaults standardUserDefaults] boolForKey:key]; BOOL updatedBefore = [[NSUserDefaults standardUserDefaults] boolForKey:key];
if (!updatedBefore) { if (!updatedBefore) {
@@ -172,6 +172,10 @@ NSString *const deviceName = @"roth";
return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone); return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
} }
+ (BOOL)isIPad{
return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad);
}
@end @end
@implementation NSString (NSStringWithTrim) @implementation NSString (NSStringWithTrim)
@@ -1595,9 +1595,13 @@ static NSMutableSet* hostList;
settings.framePacingMode = @(FramePacingModeQueue); settings.framePacingMode = @(FramePacingModeQueue);
break; break;
} }
if([UIScreen mainScreen].maximumFramesPerSecond > 110) settings.asyncFrameDequeue = true; if([UIScreen mainScreen].maximumFramesPerSecond > 110) settings.asyncFrameDequeue = true;
if([UIScreen mainScreen].maximumFramesPerSecond < 65) settings.asyncFrameDequeue = true; if([UIScreen mainScreen].maximumFramesPerSecond < 65) settings.asyncFrameDequeue = true;
settings.touchMoveEventInterval = [Utils isIPhone] ? @(30) : @(0);
settings.touchMoveEventInterval = [Utils isIPhone] ? @(45) : @(0);
if([UIScreen mainScreen].maximumFramesPerSecond < 65) settings.touchMoveEventInterval = @(60);
[dataMan saveData]; [dataMan saveData];
} }
@@ -593,10 +593,6 @@ BOOL isCustomResolution(int resolutionSelected) {
return [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone; return [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone;
} }
- (BOOL)isIPad {
return [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad;
}
- (CGFloat)getStandardNavBarHeight{ - (CGFloat)getStandardNavBarHeight{
return [self isIPhone] ? UINavigationBarHeightIPhone : UINavigationBarHeightIPad; return [self isIPhone] ? UINavigationBarHeightIPhone : UINavigationBarHeightIPad;
} }
@@ -871,7 +867,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|| [bundleId isEqualToString:@"com.voidlinkextreme.iOS"] || [bundleId isEqualToString:@"com.voidlinkextreme.iOS"]
|| [bundleId isEqualToString:@"com.voidlink.tf.debug10.iOS"]); || [bundleId isEqualToString:@"com.voidlink.tf.debug10.iOS"]);
if([self isIPad] && loadPencilSection){ if([Utils isIPad] && loadPencilSection){
MenuSectionView* pencilSection = [[MenuSectionView alloc] init]; MenuSectionView* pencilSection = [[MenuSectionView alloc] init];
pencilSection.delegate = self; pencilSection.delegate = self;
pencilSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Pencil"]; pencilSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Pencil"];
@@ -3505,7 +3501,7 @@ BOOL isCustomResolution(int resolutionSelected) {
} }
- (void)loadPencilSettings:(TemporarySettings*) tempSettings{ - (void)loadPencilSettings:(TemporarySettings*) tempSettings{
if([self isIPad]){ if([Utils isIPad]){
self.pencilTickSelector.selectedSegmentIndex = tempSettings.pencilTickMode.intValue; self.pencilTickSelector.selectedSegmentIndex = tempSettings.pencilTickMode.intValue;
[self.pencilTickSelector addTarget:self action:@selector(pencilTickModeChanged:) forControlEvents:UIControlEventValueChanged]; [self.pencilTickSelector addTarget:self action:@selector(pencilTickModeChanged:) forControlEvents:UIControlEventValueChanged];
[self pencilTickModeChanged:self.pencilTickSelector]; [self pencilTickModeChanged:self.pencilTickSelector];
@@ -3527,7 +3523,7 @@ BOOL isCustomResolution(int resolutionSelected) {
} }
- (void)populatePencilSettings:(Settings*)currentSettings{ - (void)populatePencilSettings:(Settings*)currentSettings{
if([self isIPad]){ if([Utils isIPad]){
currentSettings.pencilTickMode = @(self.pencilTickSelector.selectedSegmentIndex); currentSettings.pencilTickMode = @(self.pencilTickSelector.selectedSegmentIndex);
currentSettings.pencilTickIntervalUs = @(self.pencilTickIntervalSlider.value); currentSettings.pencilTickIntervalUs = @(self.pencilTickIntervalSlider.value);
} }