feat: remember menu section fold state
This commit is contained in:
1 parent
acd4a04076
commit
0fe10d8654
13 files changed
+190
-23
No files matched your search
@@ -1181,6 +1181,26 @@
|
|||||||
<constraint firstAttribute="width" constant="380" id="yZo-WR-6FC"/>
|
<constraint firstAttribute="width" constant="380" id="yZo-WR-6FC"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</stackView>
|
</stackView>
|
||||||
|
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="FX8-Uc-2jx" userLabel="rememberFoldStateStack">
|
||||||
|
<rect key="frame" x="432" y="2175" width="379" height="31"/>
|
||||||
|
<subviews>
|
||||||
|
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Remember Menu Fold/Expand" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="shy-hG-9wY" userLabel="uiLabel">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="229" height="31"/>
|
||||||
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
|
<nil key="textColor"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="reE-RV-kFe" userLabel="rememberFoldStateSwitch">
|
||||||
|
<rect key="frame" x="249" y="0.0" width="132" height="31"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstAttribute="width" constant="130" id="wtJ-aO-s2n"/>
|
||||||
|
</constraints>
|
||||||
|
</switch>
|
||||||
|
</subviews>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstAttribute="height" constant="31" id="ucg-xc-5Iy"/>
|
||||||
|
</constraints>
|
||||||
|
</stackView>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
</view>
|
</view>
|
||||||
@@ -1251,6 +1271,8 @@
|
|||||||
<outlet property="pointerVelocityModeDividerSlider" destination="AcZ-2i-GI4" id="dGf-ZU-w3S"/>
|
<outlet property="pointerVelocityModeDividerSlider" destination="AcZ-2i-GI4" id="dGf-ZU-w3S"/>
|
||||||
<outlet property="redirectMicStack" destination="hcl-DT-peO" id="g8Y-dq-CiW"/>
|
<outlet property="redirectMicStack" destination="hcl-DT-peO" id="g8Y-dq-CiW"/>
|
||||||
<outlet property="redirectMicSwitch" destination="9Gg-3U-Oa7" id="39M-xy-hl8"/>
|
<outlet property="redirectMicSwitch" destination="9Gg-3U-Oa7" id="39M-xy-hl8"/>
|
||||||
|
<outlet property="rememberFoldStateStack" destination="FX8-Uc-2jx" id="TwW-2H-LU0"/>
|
||||||
|
<outlet property="rememberFoldStateSwitch" destination="reE-RV-kFe" id="jiA-Wq-gqH"/>
|
||||||
<outlet property="renderingBackendSelector" destination="53H-ST-OtY" id="jhu-Pw-Phg"/>
|
<outlet property="renderingBackendSelector" destination="53H-ST-OtY" id="jhu-Pw-Phg"/>
|
||||||
<outlet property="renderingBackendStack" destination="6hG-dw-YSr" id="qqz-lA-EOE"/>
|
<outlet property="renderingBackendStack" destination="6hG-dw-YSr" id="qqz-lA-EOE"/>
|
||||||
<outlet property="resolutionSelector" destination="ckc-Dm-8ex" id="rl6-rx-wd3"/>
|
<outlet property="resolutionSelector" destination="ckc-Dm-8ex" id="rl6-rx-wd3"/>
|
||||||
|
|||||||
@@ -1910,6 +1910,26 @@
|
|||||||
<constraint firstAttribute="width" constant="380" id="rif-XX-T22"/>
|
<constraint firstAttribute="width" constant="380" id="rif-XX-T22"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
</stackView>
|
</stackView>
|
||||||
|
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="Hdw-ci-dgR">
|
||||||
|
<rect key="frame" x="20" y="1856" width="379" height="31"/>
|
||||||
|
<subviews>
|
||||||
|
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Remember Menu Fold/Expand" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9Kq-ys-dnF" userLabel="uiLabel">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="229" height="31"/>
|
||||||
|
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||||
|
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
|
<nil key="highlightedColor"/>
|
||||||
|
</label>
|
||||||
|
<switch verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="o9n-ZA-CVk">
|
||||||
|
<rect key="frame" x="249" y="0.0" width="132" height="31"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstAttribute="width" constant="130" id="2IJ-jL-jT6"/>
|
||||||
|
</constraints>
|
||||||
|
</switch>
|
||||||
|
</subviews>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstAttribute="height" constant="31" id="FH8-Xv-wYq"/>
|
||||||
|
</constraints>
|
||||||
|
</stackView>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
</view>
|
</view>
|
||||||
@@ -1979,6 +1999,8 @@
|
|||||||
<outlet property="pointerVelocityModeDividerSlider" destination="OMw-Ew-fBX" id="Yki-z6-7bh"/>
|
<outlet property="pointerVelocityModeDividerSlider" destination="OMw-Ew-fBX" id="Yki-z6-7bh"/>
|
||||||
<outlet property="redirectMicStack" destination="CKa-yk-GSi" id="fL6-aV-3Im"/>
|
<outlet property="redirectMicStack" destination="CKa-yk-GSi" id="fL6-aV-3Im"/>
|
||||||
<outlet property="redirectMicSwitch" destination="96j-Vl-kBM" id="bHh-Qm-gsv"/>
|
<outlet property="redirectMicSwitch" destination="96j-Vl-kBM" id="bHh-Qm-gsv"/>
|
||||||
|
<outlet property="rememberFoldStateStack" destination="Hdw-ci-dgR" id="x3u-MG-uCe"/>
|
||||||
|
<outlet property="rememberFoldStateSwitch" destination="o9n-ZA-CVk" id="PMH-eP-l9c"/>
|
||||||
<outlet property="renderingBackendSelector" destination="53H-ST-OtY" id="jhu-Pw-Ph2"/>
|
<outlet property="renderingBackendSelector" destination="53H-ST-OtY" id="jhu-Pw-Ph2"/>
|
||||||
<outlet property="renderingBackendStack" destination="6hG-dw-YSr" id="qqz-lA-EO2"/>
|
<outlet property="renderingBackendStack" destination="6hG-dw-YSr" id="qqz-lA-EO2"/>
|
||||||
<outlet property="resolutionSelector" destination="7Sl-WI-zyo" id="YMv-Xy-dF9"/>
|
<outlet property="resolutionSelector" destination="7Sl-WI-zyo" id="YMv-Xy-dF9"/>
|
||||||
|
|||||||
@@ -108,7 +108,8 @@ typedef NS_ENUM(NSInteger, WidgetSizeTransition) {
|
|||||||
graphOpacity:(NSInteger)graphOpacity
|
graphOpacity:(NSInteger)graphOpacity
|
||||||
renderingBackend:(NSInteger)renderingBackend
|
renderingBackend:(NSInteger)renderingBackend
|
||||||
framePacingMode:(NSInteger)framePacingMode
|
framePacingMode:(NSInteger)framePacingMode
|
||||||
sendDummyEvent:(BOOL)sendDummyEvent
|
sendDummyEvent:(BOOL)sendDummyEvent
|
||||||
|
rememberFoldState:(BOOL)rememberFoldState
|
||||||
backgroundSessionTimer:(NSInteger)backgroundSessionTimer;
|
backgroundSessionTimer:(NSInteger)backgroundSessionTimer;
|
||||||
|
|
||||||
- (NSArray*) getHosts;
|
- (NSArray*) getHosts;
|
||||||
|
|||||||
@@ -103,7 +103,8 @@
|
|||||||
graphOpacity:(NSInteger)graphOpacity
|
graphOpacity:(NSInteger)graphOpacity
|
||||||
renderingBackend:(NSInteger)renderingBackend
|
renderingBackend:(NSInteger)renderingBackend
|
||||||
framePacingMode:(NSInteger)framePacingMode
|
framePacingMode:(NSInteger)framePacingMode
|
||||||
sendDummyEvent:(BOOL)sendDummyEvent
|
sendDummyEvent:(BOOL)sendDummyEvent
|
||||||
|
rememberFoldState:(BOOL)rememberFoldState
|
||||||
backgroundSessionTimer:(NSInteger)backgroundSessionTimer{
|
backgroundSessionTimer:(NSInteger)backgroundSessionTimer{
|
||||||
|
|
||||||
[_managedObjectContext performBlockAndWait:^{
|
[_managedObjectContext performBlockAndWait:^{
|
||||||
@@ -159,6 +160,7 @@
|
|||||||
settingsToSave.renderingBackend = [NSNumber numberWithInteger:renderingBackend];
|
settingsToSave.renderingBackend = [NSNumber numberWithInteger:renderingBackend];
|
||||||
settingsToSave.framePacingMode = [NSNumber numberWithInteger:framePacingMode];
|
settingsToSave.framePacingMode = [NSNumber numberWithInteger:framePacingMode];
|
||||||
settingsToSave.sendDummyEvent = sendDummyEvent;
|
settingsToSave.sendDummyEvent = sendDummyEvent;
|
||||||
|
settingsToSave.rememberFoldState = rememberFoldState;
|
||||||
[self saveData];
|
[self saveData];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
@property (nonatomic, retain) NSNumber * graphOpacity;
|
@property (nonatomic, retain) NSNumber * graphOpacity;
|
||||||
@property (nonatomic, retain) NSNumber * renderingBackend;
|
@property (nonatomic, retain) NSNumber * renderingBackend;
|
||||||
@property (nonatomic) BOOL sendDummyEvent;
|
@property (nonatomic) BOOL sendDummyEvent;
|
||||||
|
@property (nonatomic) BOOL rememberFoldState;
|
||||||
@property (nonatomic, retain) NSNumber * framePacingMode;
|
@property (nonatomic, retain) NSNumber * framePacingMode;
|
||||||
|
|
||||||
- (id) initFromSettings:(Settings*)settings;
|
- (id) initFromSettings:(Settings*)settings;
|
||||||
|
|||||||
@@ -129,6 +129,7 @@
|
|||||||
self.renderingBackend = settings.renderingBackend;
|
self.renderingBackend = settings.renderingBackend;
|
||||||
self.framePacingMode = settings.framePacingMode;
|
self.framePacingMode = settings.framePacingMode;
|
||||||
self.sendDummyEvent = settings.sendDummyEvent;
|
self.sendDummyEvent = settings.sendDummyEvent;
|
||||||
|
self.rememberFoldState = settings.rememberFoldState;
|
||||||
self.backgroundSessionTimer = settings.backroundSessionTimer;
|
self.backgroundSessionTimer = settings.backroundSessionTimer;
|
||||||
#endif
|
#endif
|
||||||
self.uniqueId = settings.uniqueId;
|
self.uniqueId = settings.uniqueId;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
<attribute name="pointerVelocityModeDivider" optional="YES" attributeType="Float" defaultValueString="0.5" usesScalarValueType="NO" syncable="YES"/>
|
<attribute name="pointerVelocityModeDivider" optional="YES" attributeType="Float" defaultValueString="0.5" usesScalarValueType="NO" syncable="YES"/>
|
||||||
<attribute name="preferredCodec" attributeType="Integer 32" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
<attribute name="preferredCodec" attributeType="Integer 32" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||||
<attribute name="redirectMic" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
<attribute name="redirectMic" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||||
|
<attribute name="rememberFoldState" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||||
<attribute name="renderingBackend" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
<attribute name="renderingBackend" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
||||||
<attribute name="resolutionSelected" optional="YES" attributeType="Integer 16" defaultValueString="4" usesScalarValueType="NO" syncable="YES"/>
|
<attribute name="resolutionSelected" optional="YES" attributeType="Integer 16" defaultValueString="4" usesScalarValueType="NO" syncable="YES"/>
|
||||||
<attribute name="reverseMouseWheelDirection" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
<attribute name="reverseMouseWheelDirection" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||||
|
|||||||
@@ -19,11 +19,14 @@
|
|||||||
|
|
||||||
@interface MenuSectionView : UIView
|
@interface MenuSectionView : UIView
|
||||||
|
|
||||||
|
@property (class, nonatomic, assign) BOOL overridePersistedFoldState;
|
||||||
|
|
||||||
// 外部可访问属性
|
// 外部可访问属性
|
||||||
@property (nonatomic, assign) CGFloat leadingTrailingPadding;
|
@property (nonatomic, assign) CGFloat leadingTrailingPadding;
|
||||||
@property (nonatomic, assign) CGFloat separatorLinePadding;
|
@property (nonatomic, assign) CGFloat separatorLinePadding;
|
||||||
@property (nonatomic, copy) NSString *sectionTitle;
|
@property (nonatomic, copy) NSString *sectionTitle;
|
||||||
@property (nonatomic, assign) BOOL expanded;
|
@property (nonatomic, copy) NSString *identifier;
|
||||||
|
@property (nonatomic, assign) BOOL isExpanded;
|
||||||
@property (nonatomic, strong) UIColor *backgroundColor;
|
@property (nonatomic, strong) UIColor *backgroundColor;
|
||||||
@property (nonatomic, assign) CGFloat rootStackViewSpacing;
|
@property (nonatomic, assign) CGFloat rootStackViewSpacing;
|
||||||
@property (nonatomic, assign) CGFloat headerViewHeight;
|
@property (nonatomic, assign) CGFloat headerViewHeight;
|
||||||
@@ -40,6 +43,7 @@
|
|||||||
- (void)removeSubStackView:(UIStackView *)stackView;
|
- (void)removeSubStackView:(UIStackView *)stackView;
|
||||||
- (void)updateLayout;
|
- (void)updateLayout;
|
||||||
- (void)updateViewForFoldState;
|
- (void)updateViewForFoldState;
|
||||||
|
- (void)setExpanded:(BOOL)overridePersistedState;
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -24,6 +24,17 @@
|
|||||||
|
|
||||||
@implementation MenuSectionView
|
@implementation MenuSectionView
|
||||||
|
|
||||||
|
static BOOL overridePersistedFoldState = YES;
|
||||||
|
|
||||||
|
+ (BOOL)overridePersistedFoldState {
|
||||||
|
return overridePersistedFoldState;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void)setOverridePersistedFoldState:(BOOL)val {
|
||||||
|
overridePersistedFoldState = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame {
|
- (instancetype)initWithFrame:(CGRect)frame {
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
@@ -45,7 +56,7 @@
|
|||||||
_leadingTrailingPadding = 0;
|
_leadingTrailingPadding = 0;
|
||||||
_separatorLinePadding = 40;
|
_separatorLinePadding = 40;
|
||||||
_sectionTitle = @"Section";
|
_sectionTitle = @"Section";
|
||||||
_expanded = YES;
|
_isExpanded = YES;
|
||||||
_backgroundColor = [UIColor clearColor];
|
_backgroundColor = [UIColor clearColor];
|
||||||
_rootStackViewSpacing = [self isIPhone] ? 10 : 13.8;
|
_rootStackViewSpacing = [self isIPhone] ? 10 : 13.8;
|
||||||
_subStackViews = [NSMutableArray array];
|
_subStackViews = [NSMutableArray array];
|
||||||
@@ -224,9 +235,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)setExpanded:(BOOL)isExpanded {
|
- (void)setExpanded:(BOOL)isExpanded {
|
||||||
if (_expanded != isExpanded) {
|
self.isExpanded = isExpanded;
|
||||||
_expanded = isExpanded;}
|
[self updateViewForFoldState];
|
||||||
[self updateViewForFoldState];
|
[[NSUserDefaults standardUserDefaults] setBool:self.isExpanded forKey:self.identifier];
|
||||||
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setBackgroundColor:(UIColor *)backgroundColor {
|
- (void)setBackgroundColor:(UIColor *)backgroundColor {
|
||||||
@@ -262,6 +274,11 @@
|
|||||||
[self.leadingAnchor constraintEqualToAnchor:parentStack.leadingAnchor constant:0],
|
[self.leadingAnchor constraintEqualToAnchor:parentStack.leadingAnchor constant:0],
|
||||||
[self.trailingAnchor constraintEqualToAnchor:parentStack.trailingAnchor constant:0],
|
[self.trailingAnchor constraintEqualToAnchor:parentStack.trailingAnchor constant:0],
|
||||||
]];
|
]];
|
||||||
|
|
||||||
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
BOOL persistedFoldState = [defaults objectForKey:self.identifier] ? [defaults boolForKey:self.identifier] : YES;
|
||||||
|
|
||||||
|
[self setExpanded: MenuSectionView.overridePersistedFoldState ? YES : persistedFoldState];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)removeSubStackView:(UIStackView *)stackView {
|
- (void)removeSubStackView:(UIStackView *)stackView {
|
||||||
@@ -306,8 +323,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)toggleFold {
|
- (void)toggleFold {
|
||||||
self.expanded = !self.expanded;
|
self.isExpanded = !self.isExpanded;
|
||||||
[self updateViewForFoldState];
|
[self updateViewForFoldState];
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:self.isExpanded forKey:self.identifier];
|
||||||
|
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (SettingsMenuMode)getSettingsMenuMode {
|
- (SettingsMenuMode)getSettingsMenuMode {
|
||||||
@@ -326,7 +345,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.hidden = visibleCount == 0;
|
self.hidden = visibleCount == 0;
|
||||||
if (_expanded) {
|
if (_isExpanded) {
|
||||||
_rootStackView.hidden = NO;
|
_rootStackView.hidden = NO;
|
||||||
_separatorLine.hidden = NO;
|
_separatorLine.hidden = NO;
|
||||||
CGSize fittingSize = [self.rootStackView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
|
CGSize fittingSize = [self.rootStackView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
|
||||||
|
|||||||
@@ -144,6 +144,9 @@
|
|||||||
@property (strong, nonatomic) IBOutlet UIStackView *micVolumeStack;
|
@property (strong, nonatomic) IBOutlet UIStackView *micVolumeStack;
|
||||||
@property (strong, nonatomic) IBOutlet UISlider *micVolumeSlider;
|
@property (strong, nonatomic) IBOutlet UISlider *micVolumeSlider;
|
||||||
|
|
||||||
|
@property (strong, nonatomic) IBOutlet UIStackView *rememberFoldStateStack;
|
||||||
|
@property (strong, nonatomic) IBOutlet UISwitch *rememberFoldStateSwitch;
|
||||||
|
|
||||||
@property (nonatomic, strong) MicHandler *micHandler;
|
@property (nonatomic, strong) MicHandler *micHandler;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -372,6 +372,15 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
}
|
}
|
||||||
else dispatch_async(dispatch_get_main_queue(), ^{[self widget:self.bitrateSlider setEnabled:true];});
|
else dispatch_async(dispatch_get_main_queue(), ^{[self widget:self.bitrateSlider setEnabled:true];});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(currentSettingsMenuMode == AllSettings && MenuSectionView.overridePersistedFoldState){
|
||||||
|
for(UIView *subview in _parentStack.arrangedSubviews){
|
||||||
|
if([subview isKindOfClass:[MenuSectionView class]]){
|
||||||
|
MenuSectionView* section = (MenuSectionView* )subview;
|
||||||
|
[section setExpanded:YES];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidAppear:(BOOL)animated{
|
- (void)viewDidAppear:(BOOL)animated{
|
||||||
@@ -601,6 +610,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
videoSection = [[MenuSectionView alloc] init];
|
videoSection = [[MenuSectionView alloc] init];
|
||||||
videoSection.delegate = self;
|
videoSection.delegate = self;
|
||||||
videoSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Video"];
|
videoSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Video"];
|
||||||
|
videoSection.identifier = @"SettingsSectionVideo";
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
[videoSection setSectionWithIcon:[UIImage systemImageNamed:@"waveform"] andSize:20];
|
[videoSection setSectionWithIcon:[UIImage systemImageNamed:@"waveform"] andSize:20];
|
||||||
}
|
}
|
||||||
@@ -615,11 +625,12 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self addSetting:self.frameQueueSizeStack ofId:@"frameQueueSizeStack" withInfoTag:NO withDynamicLabel:YES to:videoSection];
|
[self addSetting:self.frameQueueSizeStack ofId:@"frameQueueSizeStack" withInfoTag:NO withDynamicLabel:YES to:videoSection];
|
||||||
|
|
||||||
[videoSection addToParentStack:_parentStack];
|
[videoSection addToParentStack:_parentStack];
|
||||||
[videoSection setExpanded:YES];
|
// [videoSection setExpanded:NO];
|
||||||
|
|
||||||
touchAndControlSection = [[MenuSectionView alloc] init];
|
touchAndControlSection = [[MenuSectionView alloc] init];
|
||||||
touchAndControlSection.delegate = self;
|
touchAndControlSection.delegate = self;
|
||||||
touchAndControlSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Touch & Controller"];
|
touchAndControlSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Touch & Controller"];
|
||||||
|
touchAndControlSection.identifier = @"SettingsSectionTouch&Controller";
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
[touchAndControlSection setSectionWithIcon:[UIImage imageNamed:@"arcade.stick.console"] andSize:20.5];
|
[touchAndControlSection setSectionWithIcon:[UIImage imageNamed:@"arcade.stick.console"] andSize:20.5];
|
||||||
}
|
}
|
||||||
@@ -634,11 +645,12 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self addSetting:self.gyroModeStack ofId:@"gyroModeStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection];
|
[self addSetting:self.gyroModeStack ofId:@"gyroModeStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection];
|
||||||
[self addSetting:self.gyroSensitivityStack ofId:@"gyroSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection];
|
[self addSetting:self.gyroSensitivityStack ofId:@"gyroSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection];
|
||||||
[touchAndControlSection addToParentStack:_parentStack];
|
[touchAndControlSection addToParentStack:_parentStack];
|
||||||
[touchAndControlSection setExpanded:YES];
|
// [touchAndControlSection setExpanded:NO];
|
||||||
|
|
||||||
MenuSectionView *gesturesSection = [[MenuSectionView alloc] init];
|
MenuSectionView *gesturesSection = [[MenuSectionView alloc] init];
|
||||||
gesturesSection.delegate = self;
|
gesturesSection.delegate = self;
|
||||||
gesturesSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Gestures"];
|
gesturesSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Gestures"];
|
||||||
|
gesturesSection.identifier = @"SettingsSectionGestures";
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
[gesturesSection setSectionWithIcon:[UIImage systemImageNamed:@"hand.draw"] andSize:23];
|
[gesturesSection setSectionWithIcon:[UIImage systemImageNamed:@"hand.draw"] andSize:23];
|
||||||
}
|
}
|
||||||
@@ -648,11 +660,12 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self addSetting:self.slideToToolboxScreenEdgeStack ofId:@"slideToToolboxScreenEdgeStack" withInfoTag:NO withDynamicLabel:NO to:gesturesSection];
|
[self addSetting:self.slideToToolboxScreenEdgeStack ofId:@"slideToToolboxScreenEdgeStack" withInfoTag:NO withDynamicLabel:NO to:gesturesSection];
|
||||||
[self addSetting:self.slideToSettingsDistanceStack ofId:@"slideToSettingsDistanceStack" withInfoTag:YES withDynamicLabel:YES to:gesturesSection];
|
[self addSetting:self.slideToSettingsDistanceStack ofId:@"slideToSettingsDistanceStack" withInfoTag:YES withDynamicLabel:YES to:gesturesSection];
|
||||||
[gesturesSection addToParentStack:_parentStack];
|
[gesturesSection addToParentStack:_parentStack];
|
||||||
[gesturesSection setExpanded:YES];
|
// [gesturesSection setExpanded:NO];
|
||||||
|
|
||||||
MenuSectionView *peripheralSection = [[MenuSectionView alloc] init];
|
MenuSectionView *peripheralSection = [[MenuSectionView alloc] init];
|
||||||
peripheralSection.delegate = self;
|
peripheralSection.delegate = self;
|
||||||
peripheralSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Peripherals"];
|
peripheralSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Peripherals"];
|
||||||
|
peripheralSection.identifier = @"SettingsSectionPeripherals";
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
[peripheralSection setSectionWithIcon:[UIImage imageNamed:@"cable.connector.video"] andSize:20];
|
[peripheralSection setSectionWithIcon:[UIImage imageNamed:@"cable.connector.video"] andSize:20];
|
||||||
}
|
}
|
||||||
@@ -663,13 +676,14 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self addSetting:self.reverseMouseWheelDirectionStack ofId:@"reverseMouseWheelDirectionStack" withInfoTag:NO withDynamicLabel:NO to:peripheralSection];
|
[self addSetting:self.reverseMouseWheelDirectionStack ofId:@"reverseMouseWheelDirectionStack" withInfoTag:NO withDynamicLabel:NO to:peripheralSection];
|
||||||
[self addSetting:self.citrixX1MouseStack ofId:@"citrixX1MouseStack" withInfoTag:NO withDynamicLabel:NO to:peripheralSection];
|
[self addSetting:self.citrixX1MouseStack ofId:@"citrixX1MouseStack" withInfoTag:NO withDynamicLabel:NO to:peripheralSection];
|
||||||
[peripheralSection addToParentStack:_parentStack];
|
[peripheralSection addToParentStack:_parentStack];
|
||||||
[peripheralSection setExpanded:YES];
|
// [peripheralSection setExpanded:NO];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MenuSectionView *audioSection = [[MenuSectionView alloc] init];
|
MenuSectionView *audioSection = [[MenuSectionView alloc] init];
|
||||||
audioSection.delegate = self;
|
audioSection.delegate = self;
|
||||||
audioSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Audio"];
|
audioSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Audio"];
|
||||||
|
audioSection.identifier = @"SettingsSectionAudio";
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
[audioSection setSectionWithIcon:[UIImage imageNamed:@"speaker.wave.2"] andSize:20];
|
[audioSection setSectionWithIcon:[UIImage imageNamed:@"speaker.wave.2"] andSize:20];
|
||||||
}
|
}
|
||||||
@@ -681,12 +695,13 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self addSetting:self.micVolumeStack ofId:@"micVolumeStack" withInfoTag:NO withDynamicLabel:YES to:audioSection];
|
[self addSetting:self.micVolumeStack ofId:@"micVolumeStack" withInfoTag:NO withDynamicLabel:YES to:audioSection];
|
||||||
[self addSetting:self.audioConfigStack ofId:@"audioConfigStack" withInfoTag:NO withDynamicLabel:NO to:audioSection];
|
[self addSetting:self.audioConfigStack ofId:@"audioConfigStack" withInfoTag:NO withDynamicLabel:NO to:audioSection];
|
||||||
[audioSection addToParentStack:_parentStack];
|
[audioSection addToParentStack:_parentStack];
|
||||||
[audioSection setExpanded:YES];
|
// [audioSection setExpanded:NO];
|
||||||
|
|
||||||
|
|
||||||
otherSection = [[MenuSectionView alloc] init];
|
otherSection = [[MenuSectionView alloc] init];
|
||||||
otherSection.delegate = self;
|
otherSection.delegate = self;
|
||||||
otherSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Others"];
|
otherSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Others"];
|
||||||
|
otherSection.identifier = @"SettingsSectionOthers";
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
[otherSection setSectionWithIcon:[UIImage systemImageNamed:@"cube"] andSize:20.5];
|
[otherSection setSectionWithIcon:[UIImage systemImageNamed:@"cube"] andSize:20.5];
|
||||||
}
|
}
|
||||||
@@ -696,14 +711,16 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self addSetting:self.optimizeGamesStack ofId:@"optimizeGamesStack" withInfoTag:YES withDynamicLabel:NO to:otherSection];
|
[self addSetting:self.optimizeGamesStack ofId:@"optimizeGamesStack" withInfoTag:YES withDynamicLabel:NO to:otherSection];
|
||||||
[self addSetting:self.multiControllerStack ofId:@"multiControllerStack" withInfoTag:NO withDynamicLabel:NO to:otherSection];
|
[self addSetting:self.multiControllerStack ofId:@"multiControllerStack" withInfoTag:NO withDynamicLabel:NO to:otherSection];
|
||||||
[self addSetting:self.softKeyboardToolbarStack ofId:@"softKeyboardToolbarStack" withInfoTag:NO withDynamicLabel:NO to:otherSection];
|
[self addSetting:self.softKeyboardToolbarStack ofId:@"softKeyboardToolbarStack" withInfoTag:NO withDynamicLabel:NO to:otherSection];
|
||||||
|
[self addSetting:self.rememberFoldStateStack ofId:@"rememberFoldStateStack" withInfoTag:NO withDynamicLabel:NO to:otherSection];
|
||||||
|
|
||||||
[otherSection addToParentStack:_parentStack];
|
[otherSection addToParentStack:_parentStack];
|
||||||
[otherSection setExpanded:YES];
|
// [otherSection setExpanded:NO];
|
||||||
|
|
||||||
|
|
||||||
experimentalSection = [[MenuSectionView alloc] init];
|
experimentalSection = [[MenuSectionView alloc] init];
|
||||||
experimentalSection.delegate = self;
|
experimentalSection.delegate = self;
|
||||||
experimentalSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Experimental"];
|
experimentalSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Experimental"];
|
||||||
|
experimentalSection.identifier = @"SettingsSectionExperimental";
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
[experimentalSection setSectionWithIcon:[UIImage imageNamed:@"flask"] andSize:20];
|
[experimentalSection setSectionWithIcon:[UIImage imageNamed:@"flask"] andSize:20];
|
||||||
}
|
}
|
||||||
@@ -716,7 +733,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self addSetting:self.sendDummyEventStack ofId:@"sendDummyEventStack" withInfoTag:YES withDynamicLabel:NO to:experimentalSection];
|
[self addSetting:self.sendDummyEventStack ofId:@"sendDummyEventStack" withInfoTag:YES withDynamicLabel:NO to:experimentalSection];
|
||||||
|
|
||||||
[experimentalSection addToParentStack:_parentStack];
|
[experimentalSection addToParentStack:_parentStack];
|
||||||
[experimentalSection setExpanded:YES];
|
// [experimentalSection setExpanded:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1394,7 +1411,16 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
for(UIView* view in self.view.subviews){
|
for(UIView* view in self.view.subviews){
|
||||||
[view removeFromSuperview];
|
[view removeFromSuperview];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self initParentStack];
|
[self initParentStack];
|
||||||
|
|
||||||
|
// load rememberFoldState before section layout
|
||||||
|
dataMan = [[DataManager alloc] init];
|
||||||
|
tempSettings = [dataMan getSettings];
|
||||||
|
[self.rememberFoldStateSwitch setOn:tempSettings.rememberFoldState];// Load old setting
|
||||||
|
MenuSectionView.overridePersistedFoldState = !tempSettings.rememberFoldState;
|
||||||
|
[self.rememberFoldStateSwitch addTarget:self action:@selector(rememberFoldStateSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
|
||||||
|
|
||||||
[self layoutSections];
|
[self layoutSections];
|
||||||
|
|
||||||
|
|
||||||
@@ -1416,8 +1442,6 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;
|
self.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataMan = [[DataManager alloc] init];
|
|
||||||
tempSettings = [dataMan getSettings];
|
|
||||||
|
|
||||||
currentSettingsMenuMode = tempSettings.settingsMenuMode.intValue;
|
currentSettingsMenuMode = tempSettings.settingsMenuMode.intValue;
|
||||||
[self loadFavoriteSettingStackIdentifiers];
|
[self loadFavoriteSettingStackIdentifiers];
|
||||||
@@ -1819,11 +1843,9 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
style:UIAlertActionStyleDestructive
|
style:UIAlertActionStyleDestructive
|
||||||
handler:^(UIAlertAction * _Nonnull action) {
|
handler:^(UIAlertAction * _Nonnull action) {
|
||||||
|
|
||||||
DataManager* directDataMan = [[DataManager alloc] init];
|
Settings* directSettings = [self->dataMan retrieveSettings];
|
||||||
Settings* directSettings = [directDataMan retrieveSettings];
|
|
||||||
directSettings.renderingBackend = [NSNumber numberWithInteger:sender.selectedSegmentIndex];
|
directSettings.renderingBackend = [NSNumber numberWithInteger:sender.selectedSegmentIndex];
|
||||||
[directDataMan saveData];
|
[self->dataMan saveData];
|
||||||
|
|
||||||
[self saveSettings];
|
[self saveSettings];
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
@@ -2091,6 +2113,13 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self setHidden:!sender.isOn forStack:_micVolumeStack];
|
[self setHidden:!sender.isOn forStack:_micVolumeStack];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)rememberFoldStateSwitchFlipped:(UISwitch* )sender{
|
||||||
|
MenuSectionView.overridePersistedFoldState = !sender.isOn;
|
||||||
|
Settings* currentSettings = [self->dataMan retrieveSettings];
|
||||||
|
currentSettings.rememberFoldState = sender.isOn;
|
||||||
|
[self->dataMan saveData];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)enableOswForNativeTouchSwitchFlipped:(UISwitch *)sender{
|
- (void)enableOswForNativeTouchSwitchFlipped:(UISwitch *)sender{
|
||||||
[self setHidden:!sender.isOn forStack:self.onScreenWidgetStack];
|
[self setHidden:!sender.isOn forStack:self.onScreenWidgetStack];
|
||||||
[self setHidden:!sender.isOn forStack:self.buttonVisualFeedbackStack];
|
[self setHidden:!sender.isOn forStack:self.buttonVisualFeedbackStack];
|
||||||
@@ -2531,6 +2560,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
NSInteger externalDisplayMode = [self.externalDisplayModeSelector selectedSegmentIndex];
|
NSInteger externalDisplayMode = [self.externalDisplayModeSelector selectedSegmentIndex];
|
||||||
NSInteger localMousePointerMode = [self.localMousePointerModeSelector selectedSegmentIndex];
|
NSInteger localMousePointerMode = [self.localMousePointerModeSelector selectedSegmentIndex];
|
||||||
BOOL sendDummyEvent = self.sendDummyEventSwitch.isOn;
|
BOOL sendDummyEvent = self.sendDummyEventSwitch.isOn;
|
||||||
|
BOOL rememberFoldState = self.rememberFoldStateSwitch.isOn;
|
||||||
NSInteger backgroundSessionTimer = self.backgroundSessionTimerSlider.value == self.backgroundSessionTimerSlider.maximumValue ? (uint32_t) INT16_MAX : (uint32_t)self.backgroundSessionTimerSlider.value;
|
NSInteger backgroundSessionTimer = self.backgroundSessionTimerSlider.value == self.backgroundSessionTimerSlider.maximumValue ? (uint32_t) INT16_MAX : (uint32_t)self.backgroundSessionTimerSlider.value;
|
||||||
|
|
||||||
[dataMan saveSettingsWithBitrate:_bitrate
|
[dataMan saveSettingsWithBitrate:_bitrate
|
||||||
@@ -2581,6 +2611,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
renderingBackend:renderingBackend
|
renderingBackend:renderingBackend
|
||||||
framePacingMode:framePacingMode
|
framePacingMode:framePacingMode
|
||||||
sendDummyEvent:sendDummyEvent
|
sendDummyEvent:sendDummyEvent
|
||||||
|
rememberFoldState:rememberFoldState
|
||||||
backgroundSessionTimer:backgroundSessionTimer];
|
backgroundSessionTimer:backgroundSessionTimer];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3535,6 +3535,36 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"shy-hG-9wY.text" : {
|
||||||
|
"comment" : "Class = \"UILabel\"; text = \"Remember Menu Fold/Expand\"; ObjectID = \"shy-hG-9wY\";",
|
||||||
|
"extractionState" : "extracted_with_value",
|
||||||
|
"localizations" : {
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "new",
|
||||||
|
"value" : "Remember Menu Fold/Expand"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "记住菜单折叠状态"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "記住選單摺疊狀態"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "記住選單摺疊狀態"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"t7a-18-5wz.text" : {
|
"t7a-18-5wz.text" : {
|
||||||
"comment" : "Class = \"UILabel\"; text = \"Performance Graphs \"; ObjectID = \"t7a-18-5wz\";",
|
"comment" : "Class = \"UILabel\"; text = \"Performance Graphs \"; ObjectID = \"t7a-18-5wz\";",
|
||||||
"extractionState" : "extracted_with_value",
|
"extractionState" : "extracted_with_value",
|
||||||
|
|||||||
@@ -697,6 +697,36 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"9Kq-ys-dnF.text" : {
|
||||||
|
"comment" : "Class = \"UILabel\"; text = \"Remember Menu Fold/Expand\"; ObjectID = \"9Kq-ys-dnF\";",
|
||||||
|
"extractionState" : "extracted_with_value",
|
||||||
|
"localizations" : {
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "new",
|
||||||
|
"value" : "Remember Menu Fold/Expand"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "记住菜单折叠状态"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "記住選單摺疊狀態"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "記住選單摺疊狀態"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"53H-ST-OtY.segmentTitles[0]" : {
|
"53H-ST-OtY.segmentTitles[0]" : {
|
||||||
"comment" : "Class = \"UISegmentedControl\"; 53H-ST-OtY.segmentTitles[0] = \"Balanced\"; ObjectID = \"53H-ST-OtY\";",
|
"comment" : "Class = \"UISegmentedControl\"; 53H-ST-OtY.segmentTitles[0] = \"Balanced\"; ObjectID = \"53H-ST-OtY\";",
|
||||||
"extractionState" : "extracted_with_value",
|
"extractionState" : "extracted_with_value",
|
||||||
|
|||||||
Reference in new issue
Block a user