better capturedStack locating

This commit is contained in:
TrueZhuanjia committed 2025-06-11 19:11:34 +08:00
1 parent 78be18ed89
commit 38ee17a852
3 files changed
+74 -33

No files matched your search

+54 -29
View File
@@ -63,37 +63,62 @@
<rect key="frame" x="0.0" y="0.0" width="682" height="2500"/> <rect key="frame" x="0.0" y="0.0" width="682" height="2500"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="zpX-lo-MLA" userLabel="ResolutionStack"> <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="zpX-lo-MLA" userLabel="Resolutionstak">
<rect key="frame" x="16" y="57" width="380" height="111.5"/> <rect key="frame" x="16" y="57" width="380" height="102.5"/>
<subviews> <subviews>
<label opaque="NO" clearsContextBeforeDrawing="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Resolution " lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pYZ-GR-EwO"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="R3v-Wj-0rX" userLabel="ResolutionInnerStack1">
<rect key="frame" x="0.0" y="0.0" width="380" height="20.5"/> <rect key="frame" x="0.0" y="0.0" width="380" height="56.5"/>
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="17"/> <subviews>
<nil key="textColor"/> <label opaque="NO" clearsContextBeforeDrawing="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Resolution " lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pYZ-GR-EwO">
<nil key="highlightedColor"/> <rect key="frame" x="0.0" y="0.0" width="380" height="20.5"/>
<size key="shadowOffset" width="0.0" height="0.0"/> <fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="17"/>
</label> <nil key="textColor"/>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" apportionsSegmentWidthsByContent="YES" segmentControlStyle="plain" selectedSegmentIndex="5" translatesAutoresizingMaskIntoConstraints="NO" id="ckc-Dm-8ex"> <nil key="highlightedColor"/>
<rect key="frame" x="0.0" y="25.5" width="380" height="32"/> <size key="shadowOffset" width="0.0" height="0.0"/>
<segments> </label>
<segment title="360p"/> <segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" apportionsSegmentWidthsByContent="YES" segmentControlStyle="plain" selectedSegmentIndex="5" translatesAutoresizingMaskIntoConstraints="NO" id="ckc-Dm-8ex">
<segment title="720p"/> <rect key="frame" x="0.0" y="25.5" width="380" height="32"/>
<segment title="1080p"/> <segments>
<segment title="4K"/> <segment title="360p" enabled="NO"/>
<segment title="Safe Area"/> <segment title="720p"/>
<segment title="FullScr/Window"/> <segment title="1080p"/>
<segment title="Custom"/> <segment title="4K"/>
</segments> <segment title="Safe Area"/>
<color key="tintColor" systemColor="linkColor"/> <segment title="FullScr/Window"/>
<color key="selectedSegmentTintColor" systemColor="linkColor"/> <segment title="Custom"/>
</segmentedControl> </segments>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9cG-JD-glb" userLabel="Resolution Display View"> <color key="tintColor" systemColor="linkColor"/>
<rect key="frame" x="0.0" y="61.5" width="380" height="50"/> <color key="selectedSegmentTintColor" systemColor="linkColor"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> </segmentedControl>
</view> </subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="dH7-Sy-EdJ" userLabel="ResolutionInnerStack2">
<rect key="frame" x="0.0" y="71.5" width="380" height="31"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Custom Resolution" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1ri-Kt-gSf">
<rect key="frame" x="0.0" y="0.0" width="150" height="31"/>
<constraints>
<constraint firstAttribute="width" constant="150" id="wgu-KB-nC0"/>
</constraints>
<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="wIq-fF-X8l">
<rect key="frame" x="170" y="0.0" width="92" height="31"/>
</switch>
<view contentMode="right" translatesAutoresizingMaskIntoConstraints="NO" id="9cG-JD-glb" userLabel="Resolution Display View">
<rect key="frame" x="280" y="0.0" width="100" height="31"/>
<color key="backgroundColor" red="0.13553617388112518" green="0.51330748785477198" blue="0.5771430415951514" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="100" id="6Ck-NR-Jje"/>
<constraint firstAttribute="width" constant="100" id="o1e-qd-rfH"/>
</constraints>
</view>
</subviews>
</stackView>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstAttribute="height" constant="111.5" id="0nu-Oy-daj"/>
<constraint firstAttribute="width" constant="380" id="bn6-xc-xEZ"/> <constraint firstAttribute="width" constant="380" id="bn6-xc-xEZ"/>
</constraints> </constraints>
</stackView> </stackView>
@@ -850,7 +875,7 @@ ICAgICAgICAgICAgICA
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="01j-TU-OoL" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="01j-TU-OoL" userLabel="First Responder" sceneMemberID="firstResponder"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="video.and.waveform" catalog="system" id="20f-ao-iK1"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="video.and.waveform" catalog="system" id="20f-ao-iK1">
<rect key="frame" x="0.0" y="0.0" width="240" height="128"/> <rect key="frame" x="0.0" y="-4" width="240" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
<navigationBar contentMode="scaleToFill" id="3qa-QW-sSl"> <navigationBar contentMode="scaleToFill" id="3qa-QW-sSl">
@@ -708,11 +708,13 @@ BOOL isCustomResolution(CGSize res) {
- (void)findCapturedStackByTouchLocation:(CGPoint)point{ - (void)findCapturedStackByTouchLocation:(CGPoint)point{
UIView *touchedView = [parentStack hitTest:point withEvent:nil]; UIView *touchedView = [parentStack hitTest:point withEvent:nil];
if([touchedView isKindOfClass:[UIStackView class]]){ while(touchedView){
if(touchedView.accessibilityIdentifier != nil) capturedStack = (UIStackView *)touchedView; if([touchedView isKindOfClass:[UIStackView class]] && touchedView.accessibilityIdentifier != nil){
capturedStack = (UIStackView *)touchedView;
break;
}
touchedView = touchedView.superview;
} }
else if([touchedView.superview isKindOfClass:[UIStackView class]] && touchedView.superview.accessibilityIdentifier != nil) capturedStack = (UIStackView *)touchedView.superview;
else NSLog(@"hit test: not setting stack captured");
} }
- (UIAlertController* )prepareAddToFavoriteActionSheet{ - (UIAlertController* )prepareAddToFavoriteActionSheet{
@@ -1069,6 +1071,8 @@ BOOL isCustomResolution(CGSize res) {
CGFloat fullScreenWidth = window.frame.size.width * screenScale; CGFloat fullScreenWidth = window.frame.size.width * screenScale;
CGFloat fullScreenHeight = window.frame.size.height * screenScale; CGFloat fullScreenHeight = window.frame.size.height * screenScale;
[self.resolutionSelector removeSegmentAtIndex:0 animated:NO]; // remove 360p
[self.resolutionSelector removeSegmentAtIndex:5 animated:NO]; // remove custom segment
self.resolutionDisplayView.layer.cornerRadius = 10; self.resolutionDisplayView.layer.cornerRadius = 10;
self.resolutionDisplayView.clipsToBounds = YES; self.resolutionDisplayView.clipsToBounds = YES;
UITapGestureRecognizer *resolutionDisplayViewTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(resolutionDisplayViewTapped:)]; UITapGestureRecognizer *resolutionDisplayViewTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(resolutionDisplayViewTapped:)];
+12
View File
@@ -1,6 +1,18 @@
{ {
"sourceLanguage" : "en", "sourceLanguage" : "en",
"strings" : { "strings" : {
"1ri-Kt-gSf.text" : {
"comment" : "Class = \"UILabel\"; text = \"Custom Resolution\"; ObjectID = \"1ri-Kt-gSf\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Custom Resolution"
}
}
}
},
"2Bp-XZ-cCw.text" : { "2Bp-XZ-cCw.text" : {
"comment" : "Class = \"UILabel\"; text = \"Async Native Touch\"; ObjectID = \"2Bp-XZ-cCw\";", "comment" : "Class = \"UILabel\"; text = \"Async Native Touch\"; ObjectID = \"2Bp-XZ-cCw\";",
"extractionState" : "extracted_with_value", "extractionState" : "extracted_with_value",