From 1e6a380f995cb4c85bc59e8ee5c89487f370dbbb Mon Sep 17 00:00:00 2001 From: TrueZhuanjia Date: Mon, 9 Jun 2025 23:43:36 +0800 Subject: [PATCH] setting menuSections initial layout --- Limelight/Base.lproj/iPad.storyboard | 491 +++++++++--------- Limelight/MenuSectionView.h | 2 +- Limelight/MenuSectionView.m | 21 +- .../ViewControllers/SWRevealViewController.m | 2 +- .../ViewControllers/SettingsViewController.m | 84 ++- 5 files changed, 319 insertions(+), 281 deletions(-) diff --git a/Limelight/Base.lproj/iPad.storyboard b/Limelight/Base.lproj/iPad.storyboard index 307facc7..f744af7e 100644 --- a/Limelight/Base.lproj/iPad.storyboard +++ b/Limelight/Base.lproj/iPad.storyboard @@ -141,6 +141,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -299,6 +393,29 @@ + + + + + + + + + + + + + + + + + + @@ -348,30 +465,6 @@ ICAgICAgICAgICAgICA - - - - - - - - - - - - - - - - - - @@ -442,190 +535,51 @@ ICAgICAgICAgICAgICA - - + + - - + - - + + - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -698,6 +652,99 @@ ICAgICAgICAgICAgICA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -721,53 +768,6 @@ ICAgICAgICAgICAgICA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -849,6 +849,10 @@ ICAgICAgICAgICAgICA + + + + @@ -1145,16 +1149,16 @@ ICAgICAgICAgICAgICA - + @@ -1164,16 +1168,16 @@ ICAgICAgICAgICAgICA - + @@ -1183,16 +1187,16 @@ ICAgICAgICAgICAgICA - + @@ -1200,16 +1204,16 @@ ICAgICAgICAgICAgICA - + @@ -1219,16 +1223,16 @@ ICAgICAgICAgICAgICA - + @@ -1238,16 +1242,16 @@ ICAgICAgICAgICAgICA - + @@ -1396,6 +1400,7 @@ ICAgICAgICAgICAgICA + diff --git a/Limelight/MenuSectionView.h b/Limelight/MenuSectionView.h index 33f7692f..d707e32f 100644 --- a/Limelight/MenuSectionView.h +++ b/Limelight/MenuSectionView.h @@ -24,7 +24,7 @@ @property (nonatomic, strong) NSMutableArray *subStackViews; // 方法 -- (void)setSectionIcon:(UIImage *)icon; +- (void)setSectionWithIcon:(UIImage *)icon andSize:(CGFloat)size; - (void)addSubStackView:(UIStackView *)stackView; - (void)addToParentStack:(UIStackView *)parentStack; - (void)removeSubStackView:(UIStackView *)stackView; diff --git a/Limelight/MenuSectionView.m b/Limelight/MenuSectionView.m index 619d569d..ff2a99b8 100644 --- a/Limelight/MenuSectionView.m +++ b/Limelight/MenuSectionView.m @@ -45,14 +45,14 @@ - (void)commonInit { // 默认值 _leadingTrailingPadding = 0; - _separatorLinePadding = 18; + _separatorLinePadding = 40; _sectionTitle = @"Section"; _expanded = YES; _backgroundColor = [UIColor clearColor]; - _rootStackViewSpacing = 10; + _rootStackViewSpacing = 15; _subStackViews = [NSMutableArray array]; _headerViewHeight = 37; - _headerViewVerticalSpacing = 20; + _headerViewVerticalSpacing = 25; // 设置视图 self.layer.cornerRadius = 10.0; @@ -74,7 +74,7 @@ // 标题标签 _titleLabel = [[UILabel alloc] init]; _titleLabel.text = _sectionTitle; - _titleLabel.font = [UIFont systemFontOfSize:27 weight:UIFontWeightMedium]; + _titleLabel.font = [UIFont systemFontOfSize:23 weight:UIFontWeightMedium]; _titleLabel.textColor = [ThemeManager textColor]; _titleLabel.textAlignment = NSTextAlignmentLeft; _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; @@ -132,11 +132,11 @@ // 图标约束 [NSLayoutConstraint activateConstraints:@[ - [_iconImageView.leadingAnchor constraintEqualToAnchor:_headerView.leadingAnchor constant:_leadingTrailingPadding], + [_iconImageView.centerXAnchor constraintEqualToAnchor:_headerView.leadingAnchor constant:_leadingTrailingPadding+_headerViewHeight/2-3], [_iconImageView.centerYAnchor constraintEqualToAnchor:_headerView.centerYAnchor], // [_iconImageView.topAnchor constraintEqualToAnchor:_headerView.topAnchor], - [_iconImageView.widthAnchor constraintEqualToConstant:_headerViewHeight], - [_iconImageView.heightAnchor constraintEqualToConstant:_headerViewHeight] + [_iconImageView.widthAnchor constraintEqualToConstant:_headerViewHeight-6], + //[_iconImageView.heightAnchor constraintEqualToConstant:_headerViewHeight-6] ]]; // 标题约束 @@ -198,9 +198,9 @@ #pragma mark - Public Methods -- (void)setSectionIcon:(UIImage *)icon { +- (void)setSectionWithIcon:(UIImage *)icon andSize:(CGFloat)size{ if (@available(iOS 13.0, *)) { - UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithWeight:UIImageSymbolWeightSemibold]; + UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:size weight:UIImageSymbolWeightBold]; _iconImageView.image = [icon imageWithConfiguration:config]; } else { @@ -254,7 +254,8 @@ } - (void)addToParentStack:(UIStackView *)parentStack { - [parentStack addArrangedSubview:self]; + [parentStack insertArrangedSubview:self atIndex:parentStack.arrangedSubviews.count]; + NSLog(@"title: %@, count: %ld", self.sectionTitle, parentStack.arrangedSubviews.count); self.translatesAutoresizingMaskIntoConstraints = NO; [NSLayoutConstraint activateConstraints:@[ [self.leadingAnchor constraintEqualToAnchor:parentStack.leadingAnchor constant:0], diff --git a/Limelight/ViewControllers/SWRevealViewController.m b/Limelight/ViewControllers/SWRevealViewController.m index dcc4d232..029b860d 100755 --- a/Limelight/ViewControllers/SWRevealViewController.m +++ b/Limelight/ViewControllers/SWRevealViewController.m @@ -688,7 +688,7 @@ const int FrontViewPositionNone = 0xff; _rearViewPosition = FrontViewPositionLeft; _rightViewPosition = FrontViewPositionLeft; // _rearViewRevealWidth = 492.0f; - _rearViewRevealWidth = 350; //mark: settingMenuLayout + _rearViewRevealWidth = 390; //mark: settingMenuLayout // _rearViewRevealOverdraw = 60.0f; _rearViewRevealOverdraw = 0.0f; _rearViewRevealDisplacement = 40.0f; diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m index e74e3da7..294e7acd 100644 --- a/Limelight/ViewControllers/SettingsViewController.m +++ b/Limelight/ViewControllers/SettingsViewController.m @@ -402,48 +402,79 @@ BOOL isCustomResolution(CGSize res) { } - (void)layoutSections{ + MenuSectionView *videoSection = [[MenuSectionView alloc] init]; videoSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Video"]; if (@available(iOS 13.0, *)) { - [videoSection setSectionIcon:[UIImage systemImageNamed:@"airplayvideo"]]; - } else [videoSection setSectionIcon:nil]; - + [videoSection setSectionWithIcon:[UIImage systemImageNamed:@"video.and.waveform"] andSize:20.5]; + } [self addSetting:self.resolutionStack ofId:@"resolutionStack" withInfoTag:YES to:videoSection]; [self addSetting:self.fpsStack ofId:@"fpsStack" withInfoTag:NO to:videoSection]; + [self addSetting:self.bitrateStack ofId:@"bitrateStack" withInfoTag:NO to:videoSection]; [self addSetting:self.codecStack ofId:@"codecStack" withInfoTag:NO to:videoSection]; + [self addSetting:self.HdrStack ofId:@"HdrStack" withInfoTag:NO to:videoSection]; + [self addSetting:self.framepacingStack ofId:@"framepacingStack" withInfoTag:NO to:videoSection]; [videoSection addToParentStack:parentStack]; - [videoSection setExpanded:YES]; - //_fpsStack.userInteractionEnabled = NO; + [videoSection setExpanded:NO]; + + MenuSectionView *touchInputSection = [[MenuSectionView alloc] init]; + touchInputSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Touch Input"]; + if (@available(iOS 13.0, *)) { + [touchInputSection setSectionWithIcon:[UIImage systemImageNamed:@"viewfinder.circle"] andSize:21.5]; + } + [self addSetting:self.touchModeStack ofId:@"touchModeStack" withInfoTag:YES to:touchInputSection]; + [self addSetting:self.pointerVelocityDividerStack ofId:@"pointerVelocityDividerStack" withInfoTag:YES to:touchInputSection]; + [self addSetting:self.pointerVelocityFactorStack ofId:@"pointerVelocityFactorStack" withInfoTag:YES to:touchInputSection]; + [self addSetting:self.mousePointerVelocityStack ofId:@"mousePointerVelocityStack" withInfoTag:YES to:touchInputSection]; + [self addSetting:self.onScreenWidgetStack ofId:@"onScreenWidgetStack" withInfoTag:YES to:touchInputSection]; + [self addSetting:self.swapAbaxyStack ofId:@"swapAbaxyStack" withInfoTag:NO to:touchInputSection]; + [touchInputSection addToParentStack:parentStack]; + [touchInputSection setExpanded:NO]; + + + + + MenuSectionView *gesturesSection = [[MenuSectionView alloc] init]; gesturesSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Gestures"]; if (@available(iOS 13.0, *)) { - [gesturesSection setSectionIcon:[UIImage systemImageNamed:@"hand.draw"]]; - } else [gesturesSection setSectionIcon:nil]; + [gesturesSection setSectionWithIcon:[UIImage systemImageNamed:@"hand.draw"] andSize:23]; + } [self addSetting:self.keyboardToggleFingerNumStack ofId:@"keyboardToggleFingerNumStack" withInfoTag:NO to:gesturesSection]; [self addSetting:self.slideToSettingsScreenEdgeStack ofId:@"slideToSettingsScreenEdgeStack" withInfoTag:NO to:gesturesSection]; [self addSetting:self.slideToCmdToolScreenEdgeStack ofId:@"slideToCmdToolScreenEdgeStack" withInfoTag:NO to:gesturesSection]; [self addSetting:self.slideToSettingsDistanceStack ofId:@"slideToSettingsDistanceStack" withInfoTag:NO to:gesturesSection]; - - [self addSetting:self.audioOnPcStack ofId:@"audioOnPcStack" withInfoTag:NO to:gesturesSection]; - // [self addSetting:self.codecStack ofIdentifier:@"codecStack" to:gesturesSection]; - [self addSetting:self.yuv444Stack ofId:@"yuv444Stack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.HdrStack ofId:@"HdrStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.optimizeSettingsStack ofId:@"optimizeSettingsStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.multiControllerStack ofId:@"multiControllerStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.optimizeSettingsStack ofId:@"optimizeSettingsStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.liftStreamViewForKeyboardStack ofId:@"liftStreamViewForKeyboardStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.framepacingStack ofId:@"framepacingStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.reverseMouseWheelDirectionStack ofId:@"reverseMouseWheelDirectionStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.statsOverlayStack ofId:@"statsOverlayStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.externalDisplayModeStack ofId:@"externalDisplayModeStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.localMousePointerModeStack ofId:@"localMousePointerModeStack" withInfoTag:NO to:gesturesSection]; - [self addSetting:self.onScreenWidgetStack ofId:@"onScreenWidgetStack" withInfoTag:NO to:gesturesSection]; - - [gesturesSection addToParentStack:parentStack]; - [gesturesSection setExpanded:YES]; + [gesturesSection setExpanded:NO]; + + MenuSectionView *peripheralSection = [[MenuSectionView alloc] init]; + peripheralSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Peripherals"]; + if (@available(iOS 13.0, *)) { + [peripheralSection setSectionWithIcon:[UIImage systemImageNamed:@"airplayvideo"] andSize:20.5]; + } + [self addSetting:self.externalDisplayModeStack ofId:@"externalDisplayModeStack" withInfoTag:NO to:peripheralSection]; + [self addSetting:self.localMousePointerModeStack ofId:@"localMousePointerModeStack" withInfoTag:NO to:peripheralSection]; + [self addSetting:self.reverseMouseWheelDirectionStack ofId:@"reverseMouseWheelDirectionStack" withInfoTag:NO to:peripheralSection]; + [self addSetting:self.citrixX1MouseStack ofId:@"citrixX1MouseStack" withInfoTag:NO to:peripheralSection]; + [peripheralSection addToParentStack:parentStack]; + [peripheralSection setExpanded:NO]; + + + + + MenuSectionView *experimentalSection = [[MenuSectionView alloc] init]; + experimentalSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Experimental"]; + if (@available(iOS 13.0, *)) { + [experimentalSection setSectionWithIcon:[UIImage systemImageNamed:@"flask"] andSize:20]; + } + [self addSetting:self.asyncTouchStack ofId:@"asyncTouchStack" withInfoTag:YES to:experimentalSection]; + [self addSetting:self.touchMoveEventIntervalStack ofId:@"touchMoveEventIntervalStack" withInfoTag:YES to:experimentalSection]; + [experimentalSection addToParentStack:parentStack]; + [experimentalSection setExpanded:NO]; + + } @@ -1800,7 +1831,8 @@ BOOL isCustomResolution(CGSize res) { BOOL reverseMouseWheelDirection = [self.reverseMouseWheelDirectionSelector selectedSegmentIndex] == 1; NSInteger asyncNativeTouchPriority = [self.asyncNativeTouchPrioritySelector selectedSegmentIndex]; - BOOL liftStreamViewForKeyboard = [self.liftStreamViewForKeyboardSelector selectedSegmentIndex] == 1; + //BOOL liftStreamViewForKeyboard = [self.liftStreamViewForKeyboardSelector selectedSegmentIndex] == 1; + BOOL liftStreamViewForKeyboard = YES; // enable and hide this option BOOL showKeyboardToolbar = [self.showKeyboardToolbarSelector selectedSegmentIndex] == 1; BOOL optimizeGames = [self.optimizeSettingsSelector selectedSegmentIndex] == 1; BOOL multiController = [self.multiControllerSelector selectedSegmentIndex] == 1;