widget profile accessibility

This commit is contained in:
True Zhuanjia
2026-02-14 12:43:31 +08:00
parent 28d9a0faf2
commit 63d5417a2c
6 changed files with 30 additions and 11 deletions
+10 -1
View File
@@ -165,13 +165,22 @@ static CGRect layoutViewBounds;
- (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)
OSCProfile* profile;
/*
profile = [self findProfileByName:DEFAULT_TEMPLATE_NAME1 inProfileArray:targetProfiles];
if(profile && targetProfiles.count > 1) [targetProfiles removeObject:profile];
profile = [self findProfileByName:DEFAULT_TEMPLATE_NAME2 inProfileArray:targetProfiles];
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];
NSMutableArray* localEncodedPofiles = [self encodedProfilesFromArray:targetProfiles];
[profilesEncoded addObjectsFromArray:localEncodedPofiles];
+6 -1
View File
@@ -2475,7 +2475,12 @@ import SVGKit
eraserShortcut = eraserShortcut.replacingOccurrences(of: "ERASER", with: "")
self.functionalButtonDelegate?.replaceEraser(shortcut: eraserShortcut)
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:
break
}
+1
View File
@@ -34,6 +34,7 @@ FOUNDATION_EXPORT NSString *const deviceName;
+ (bool)hdrSupported;
+ (bool)needUpdateDefaultSettings;
+ (BOOL)isIPhone;
+ (BOOL)isIPad;
#if !TARGET_OS_TV
+ (void) launchUrl:(NSString*)urlString;
+5 -1
View File
@@ -157,7 +157,7 @@ NSString *const deviceName = @"roth";
+ (bool)needUpdateDefaultSettings {
// NSString *key = @"needUpdateDefaultSettings20260209";
NSString *key = @"needUpdateDefaultSettings20260212";
NSString *key = @"needUpdateDefaultSettings20260215";
BOOL updatedBefore = [[NSUserDefaults standardUserDefaults] boolForKey:key];
if (!updatedBefore) {
@@ -172,6 +172,10 @@ NSString *const deviceName = @"roth";
return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
}
+ (BOOL)isIPad{
return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad);
}
@end
@implementation NSString (NSStringWithTrim)
@@ -1595,9 +1595,13 @@ static NSMutableSet* hostList;
settings.framePacingMode = @(FramePacingModeQueue);
break;
}
if([UIScreen mainScreen].maximumFramesPerSecond > 110) 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];
}
@@ -593,10 +593,6 @@ BOOL isCustomResolution(int resolutionSelected) {
return [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone;
}
- (BOOL)isIPad {
return [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad;
}
- (CGFloat)getStandardNavBarHeight{
return [self isIPhone] ? UINavigationBarHeightIPhone : UINavigationBarHeightIPad;
}
@@ -871,7 +867,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|| [bundleId isEqualToString:@"com.voidlinkextreme.iOS"]
|| [bundleId isEqualToString:@"com.voidlink.tf.debug10.iOS"]);
if([self isIPad] && loadPencilSection){
if([Utils isIPad] && loadPencilSection){
MenuSectionView* pencilSection = [[MenuSectionView alloc] init];
pencilSection.delegate = self;
pencilSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Pencil"];
@@ -3505,7 +3501,7 @@ BOOL isCustomResolution(int resolutionSelected) {
}
- (void)loadPencilSettings:(TemporarySettings*) tempSettings{
if([self isIPad]){
if([Utils isIPad]){
self.pencilTickSelector.selectedSegmentIndex = tempSettings.pencilTickMode.intValue;
[self.pencilTickSelector addTarget:self action:@selector(pencilTickModeChanged:) forControlEvents:UIControlEventValueChanged];
[self pencilTickModeChanged:self.pencilTickSelector];
@@ -3527,7 +3523,7 @@ BOOL isCustomResolution(int resolutionSelected) {
}
- (void)populatePencilSettings:(Settings*)currentSettings{
if([self isIPad]){
if([Utils isIPad]){
currentSettings.pencilTickMode = @(self.pencilTickSelector.selectedSegmentIndex);
currentSettings.pencilTickIntervalUs = @(self.pencilTickIntervalSlider.value);
}