pip tool box special entry

This commit is contained in:
TrueZhuanjia
2025-07-12 16:30:37 +08:00
parent d263482f7e
commit 35a2c1111d
3 changed files with 43 additions and 6 deletions
+1 -1
View File
@@ -1521,7 +1521,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="20" id="hvN-TZ-ziV" userLabel="pipStack">
<rect key="frame" x="382" y="1618" width="280" height="31"/>
<rect key="frame" x="437" y="1618" width="280" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable PiP" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Ul-P6-eUk" userLabel="pipLabel">
@@ -214,6 +214,29 @@
}
}
},
"[ Enter picture-in-picture mode ]" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "[ 进入画中画模式 ]"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "[ 进入画中画模式 ]"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "[ 进入画中画模式 ]"
}
}
}
},
"[ Open on-screen widget tool ]" : {
"extractionState" : "manual",
"localizations" : {
@@ -200,10 +200,25 @@
}
}
- (void)configOscLayoutTool{
- (void)updateToolboxSpecialEntries{
if([self isOscLayoutToolEnabled]){
if(![toolBoxViewController.specialEntries containsObject:@"widgetLayoutTool"]) [toolBoxViewController.specialEntries insertObject:@"widgetLayoutTool" atIndex:0];
if(![toolBoxViewController.specialEntries containsObject:@"widgetSwitchTool"]) [toolBoxViewController.specialEntries insertObject:@"widgetSwitchTool" atIndex:1];
}
else{
[toolBoxViewController.specialEntries removeObject:@"widgetLayoutTool"];
[toolBoxViewController.specialEntries removeObject:@"widgetSwitchTool"];
}
if(_settings.enablePIP){
if(![toolBoxViewController.specialEntries containsObject:@"enterPip"]) [toolBoxViewController.specialEntries addObject:@"enterPip"];
}
else [toolBoxViewController.specialEntries removeObject:@"enterPip"];
NSLog(@"toolBoxViewController.specialEntries %@", toolBoxViewController.specialEntries);
}
- (void)configOscLayoutTool{
if([self isOscLayoutToolEnabled]){
_oscLayoutTapRecoginizer = [[CustomTapGestureRecognizer alloc] initWithTarget:self action:@selector(openWidgetLayoutTool)];
_oscLayoutTapRecoginizer.numberOfTouchesRequired = _settings.oscLayoutToolFingers.intValue; //tap a predefined number of fingers to open osc layout tool
_oscLayoutTapRecoginizer.tapDownTimeThreshold = 0.2;
@@ -227,15 +242,13 @@
_layoutOnScreenControlsVC.view.backgroundColor = UIColor.clearColor;
_layoutOnScreenControlsVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
}
else{
[toolBoxViewController.specialEntries removeObject:@"widgetLayoutTool"];
[toolBoxViewController.specialEntries removeObject:@"widgetSwitchTool"];
}
}
- (void)presentCommandManagerViewController{
ToolboxViewController* oldToolboxVC = toolBoxViewController;
toolBoxViewController = [[ToolboxViewController alloc] init];
toolBoxViewController.specialEntryDelegate = self;
toolBoxViewController.specialEntries = oldToolboxVC.specialEntries;
[self configOscLayoutTool];
[self presentViewController:toolBoxViewController animated:YES completion:^{
//[self->toolBoxViewController setupConstraints];
@@ -296,6 +309,7 @@
_settings = [[[DataManager alloc] init] getSettings]; //StreamFrameViewController retrieve the settings here.
overlayLevel = _settings.statsOverlayLevel.intValue;
[self configOscLayoutTool];
[self updateToolboxSpecialEntries];
[self configSwipeGestures];
[self configZoomGestureAndAddStreamView];
[self->_streamView disableOnScreenControls]; //don't know why but this must be called outside the streamview class, just put it here. execute in streamview class cause hang