From 879c2f368c1e953474cf2575749899f2967b7931 Mon Sep 17 00:00:00 2001 From: Acaki Date: Fri, 11 Jul 2025 03:07:14 +0800 Subject: [PATCH] feat: update storyboard and translations for pip --- VoidLink/Base.lproj/iPad.storyboard | 29 ++++++++++++++-- VoidLink/Base.lproj/iPhone.storyboard | 33 +++++++++++++++---- .../ViewControllers/MainFrameViewController.m | 15 --------- .../ViewControllers/SettingsViewController.h | 2 ++ .../ViewControllers/SettingsViewController.m | 6 +++- VoidLink/mul.lproj/iPad.xcstrings | 32 +++++++++++++++++- VoidLink/mul.lproj/iPhone.xcstrings | 30 +++++++++++++++++ 7 files changed, 121 insertions(+), 26 deletions(-) diff --git a/VoidLink/Base.lproj/iPad.storyboard b/VoidLink/Base.lproj/iPad.storyboard index efea9bbd..fe7a8922 100644 --- a/VoidLink/Base.lproj/iPad.storyboard +++ b/VoidLink/Base.lproj/iPad.storyboard @@ -1,8 +1,8 @@ - + - + @@ -870,12 +870,33 @@ + + + + + + + + + + + + + - + @@ -916,6 +937,8 @@ + + diff --git a/VoidLink/Base.lproj/iPhone.storyboard b/VoidLink/Base.lproj/iPhone.storyboard index e256d55b..8bbac237 100644 --- a/VoidLink/Base.lproj/iPhone.storyboard +++ b/VoidLink/Base.lproj/iPhone.storyboard @@ -1,8 +1,8 @@ - + - + @@ -13,7 +13,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -636,12 +636,12 @@ - + - + @@ -1520,6 +1520,27 @@ + + + + + + + + + + + + + diff --git a/VoidLink/ViewControllers/MainFrameViewController.m b/VoidLink/ViewControllers/MainFrameViewController.m index b82563f2..776009a3 100644 --- a/VoidLink/ViewControllers/MainFrameViewController.m +++ b/VoidLink/ViewControllers/MainFrameViewController.m @@ -1147,21 +1147,6 @@ static NSMutableSet* hostList; // If we moved back to the center position, we should save the settings SettingsViewController* settingsViewController = (SettingsViewController*)[revealController rearViewController]; settingsViewController.mainFrameViewController = self; - // enable / disable widgets acoordingly: in streamview, disable, outside of streamview, enable. - [settingsViewController.resolutionSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.framerateSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController widget:settingsViewController.bitrateSlider setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.optimizeSettingsSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.audioOnPCSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.codecSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.yuv444Selector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.pipSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.hdrSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.framePacingSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.btMouseSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.externalDisplayModeSelector setEnabled:!self.settingsExpandedInStreamView]; - [settingsViewController.backToStreamingButton setEnabled:self.settingsExpandedInStreamView]; - // [settingsViewController.unlockDisplayOrientationSelector setEnabled:!self.settingsExpandedInStreamView && [self isFullScreenRequired]];//need "requires fullscreen" enabled in the app bunddle to make runtime orientation limitation woring if (position == FrontViewPositionLeft) { [settingsViewController saveSettings]; diff --git a/VoidLink/ViewControllers/SettingsViewController.h b/VoidLink/ViewControllers/SettingsViewController.h index 06b09cce..5a35bdfc 100644 --- a/VoidLink/ViewControllers/SettingsViewController.h +++ b/VoidLink/ViewControllers/SettingsViewController.h @@ -47,6 +47,7 @@ @property (strong, nonatomic) IBOutlet UISwitch *audioOnPcSwitch; @property (strong, nonatomic) IBOutlet UIStackView *codecStack; @property (strong, nonatomic) IBOutlet UIStackView *yuv444Stack; +@property (strong, nonatomic) IBOutlet UIStackView *pipStack; @property (strong, nonatomic) IBOutlet UIStackView *HdrStack; @property (strong, nonatomic) IBOutlet UIStackView *framepacingStack; @property (strong, nonatomic) IBOutlet UIStackView *reverseMouseWheelDirectionStack; @@ -72,6 +73,7 @@ @property (strong, nonatomic) IBOutlet UISegmentedControl *codecSelector; @property (strong, nonatomic) IBOutlet UISwitch *hdrSwitch; @property (strong, nonatomic) IBOutlet UISwitch *yuv444Switch; +@property (strong, nonatomic) IBOutlet UISwitch *pipSwitch; @property (strong, nonatomic) IBOutlet UISegmentedControl *framePacingSelector; @property (strong, nonatomic) IBOutlet UISegmentedControl *reverseMouseWheelDirectionSelector; @property (strong, nonatomic) IBOutlet UISegmentedControl *statsOverlaySelector; diff --git a/VoidLink/ViewControllers/SettingsViewController.m b/VoidLink/ViewControllers/SettingsViewController.m index b6c721a9..95e8940c 100644 --- a/VoidLink/ViewControllers/SettingsViewController.m +++ b/VoidLink/ViewControllers/SettingsViewController.m @@ -253,7 +253,7 @@ BOOL isCustomResolution(CGSize res) { } - (void)updateResolutionTable{ - UIWindow *window = UIApplication.sharedApplication.windows.firstObject; + UIWindow *window = self.view.window; CGFloat screenScale = window.screen.scale; CGFloat safeAreaWidth = (window.frame.size.width - window.safeAreaInsets.left - window.safeAreaInsets.right) * screenScale; CGFloat appWindowWidth = window.frame.size.width * screenScale; @@ -482,6 +482,7 @@ BOOL isCustomResolution(CGSize res) { [self addSetting:self.codecStack ofId:@"codecStack" withInfoTag:NO withDynamicLabel:NO to:videoSection]; [self addSetting:self.HdrStack ofId:@"HdrStack" withInfoTag:NO withDynamicLabel:NO to:videoSection]; [self addSetting:self.yuv444Stack ofId:@"yuv444Stack" withInfoTag:YES withDynamicLabel:NO to:videoSection]; + [self addSetting:self.pipStack ofId:@"pipStack" withInfoTag:YES withDynamicLabel:NO to:videoSection]; [videoSection addToParentStack:_parentStack]; [videoSection setExpanded:YES]; @@ -1245,6 +1246,7 @@ BOOL isCustomResolution(CGSize res) { } [self.yuv444Switch setOn:currentSettings.enableYUV444]; + [self.pipSwitch setOn:currentSettings.enablePIP]; [self.statsOverlaySelector setSelectedSegmentIndex:currentSettings.statsOverlayLevel.intValue]; [self.citrixX1MouseSwitch setOn:currentSettings.btMouseSupport]; [self.optimizeGamesSwitch setOn: currentSettings.optimizeGames]; @@ -1957,6 +1959,7 @@ BOOL isCustomResolution(CGSize res) { BOOL audioOnPC = self.audioOnPcSwitch.isOn; uint32_t preferredCodec = [self getChosenCodecPreference]; BOOL enableYUV444 = self.yuv444Switch.isOn; + BOOL enablePIP = self.pipSwitch.isOn; BOOL btMouseSupport = self.citrixX1MouseSwitch.isOn; BOOL useFramePacing = [self.framePacingSelector selectedSegmentIndex] == 1; NSInteger touchMode = [self isNotNativeTouchOnly] ? self.touchModeSelector.selectedSegmentIndex : NativeTouchOnly; @@ -1993,6 +1996,7 @@ BOOL isCustomResolution(CGSize res) { audioOnPC:audioOnPC preferredCodec:preferredCodec enableYUV444:enableYUV444 + enablePIP:enablePIP useFramePacing:useFramePacing enableHdr:enableHdr btMouseSupport:btMouseSupport diff --git a/VoidLink/mul.lproj/iPad.xcstrings b/VoidLink/mul.lproj/iPad.xcstrings index 36cfee57..08f6d6dc 100644 --- a/VoidLink/mul.lproj/iPad.xcstrings +++ b/VoidLink/mul.lproj/iPad.xcstrings @@ -43,6 +43,36 @@ } } }, + "3rP-dh-TJi.text" : { + "comment" : "Class = \"UILabel\"; text = \"Enable PiP\"; ObjectID = \"3rP-dh-TJi\";", + "extractionState" : "extracted_with_value", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "Enable PiP" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "启用画中画观察模式" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "啟用子母畫面觀察模式" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "啟用子母畫面觀察模式" + } + } + } + }, "4FU-iP-c6T.segmentTitles[0]" : { "comment" : "Class = \"UISegmentedControl\"; 4FU-iP-c6T.segmentTitles[0] = \"Captured\"; ObjectID = \"4FU-iP-c6T\";", "extractionState" : "extracted_with_value", @@ -3135,4 +3165,4 @@ } }, "version" : "1.0" -} +} \ No newline at end of file diff --git a/VoidLink/mul.lproj/iPhone.xcstrings b/VoidLink/mul.lproj/iPhone.xcstrings index 1c8bc4d0..25bb353b 100644 --- a/VoidLink/mul.lproj/iPhone.xcstrings +++ b/VoidLink/mul.lproj/iPhone.xcstrings @@ -211,6 +211,36 @@ } } }, + "4Ul-P6-eUk.text" : { + "comment" : "Class = \"UILabel\"; text = \"Enable PiP\"; ObjectID = \"4Ul-P6-eUk\";", + "extractionState" : "extracted_with_value", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "Enable PiP" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "启用画中画观察模式" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "啟用子母畫面觀察模式" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "啟用子母畫面觀察模式" + } + } + } + }, "5JB-m0-nUF.text" : { "comment" : "Class = \"UILabel\"; text = \"YUV 4:4:4\"; ObjectID = \"5JB-m0-nUF\";", "extractionState" : "extracted_with_value",