- allow wider size range for on-screen widgets

- minor improvements
This commit is contained in:
True Zhuanjia
2026-03-22 11:21:51 +08:00
parent eff35450f6
commit d092b93a29
6 changed files with 53 additions and 40 deletions
+2 -2
View File
@@ -2694,7 +2694,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<slider verifyAmbiguity="off" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.60000002384185791" maxValue="6" translatesAutoresizingMaskIntoConstraints="NO" id="Xzq-VC-hP3" userLabel="Size Slider">
<slider verifyAmbiguity="off" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.35999999999999999" maxValue="10" translatesAutoresizingMaskIntoConstraints="NO" id="Xzq-VC-hP3" userLabel="Size Slider">
<rect key="frame" x="105" y="0.0" width="545" height="34"/>
<color key="tintColor" red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<color key="maximumTrackTintColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -2713,7 +2713,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<slider verifyAmbiguity="off" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.60000002384185791" maxValue="6" translatesAutoresizingMaskIntoConstraints="NO" id="aZp-Dq-RTr" userLabel="Height Slider">
<slider verifyAmbiguity="off" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.35999999999999999" maxValue="10" translatesAutoresizingMaskIntoConstraints="NO" id="aZp-Dq-RTr" userLabel="Height Slider">
<rect key="frame" x="105" y="0.0" width="545" height="34"/>
<color key="tintColor" red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<color key="maximumTrackTintColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+2 -2
View File
@@ -386,7 +386,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<slider clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.60000002384185791" maxValue="6" translatesAutoresizingMaskIntoConstraints="NO" id="Eke-rc-DVp" userLabel="Size Slider">
<slider clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.35999999999999999" maxValue="7" translatesAutoresizingMaskIntoConstraints="NO" id="Eke-rc-DVp" userLabel="Size Slider">
<rect key="frame" x="105" y="0.0" width="445" height="20"/>
<color key="tintColor" red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<color key="maximumTrackTintColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -408,7 +408,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<slider clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.60000002384185791" maxValue="6" translatesAutoresizingMaskIntoConstraints="NO" id="ssl-ip-Ckz" userLabel="Height Slider">
<slider clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.35999999999999999" maxValue="7" translatesAutoresizingMaskIntoConstraints="NO" id="ssl-ip-Ckz" userLabel="Height Slider">
<rect key="frame" x="105" y="0.0" width="445" height="20"/>
<color key="tintColor" red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<color key="maximumTrackTintColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -149,7 +149,9 @@
}
for(UIView* view in self.layoutToolVC.view.subviews){
if ([view isKindOfClass:[OnScreenWidgetView class]] && view != widget) {
if ((horizontalGuideline.center.y < view.center.y + 1) && (horizontalGuideline.center.y > view.center.y - 1)) {
OnScreenWidgetView* otherWidget = (OnScreenWidgetView *) view;
if(widget.isFolder && widget.bulkMoveEnabled && [widget.sequenceSet containsObject:@(otherWidget.sequence)]) break;
if((horizontalGuideline.center.y < view.center.y + 1) && (horizontalGuideline.center.y > view.center.y - 1)) {
horizontalGuideline.backgroundColor = [UIColor yellowColor];
break;
}
+16 -11
View File
@@ -697,13 +697,13 @@ import SVGKit
private func getDiameter(lengthFactor:CGFloat) -> CGFloat {
self.getBaselineLenths()
let isNormalizedSizeFactor = lengthFactor > 6;
let isNormalizedSizeFactor = lengthFactor > 10;
return isNormalizedSizeFactor ? denormalizeSize(sizeFactor:lengthFactor) : CGFloat(Int(baselineDiameter * lengthFactor / 2) * 2)
}
private func getRecSize(widthFactor:CGFloat, heightFactor:CGFloat) -> CGSize {
let isNormalizedSizeFactor = widthFactor > 6;
let isNormalizedHeightFactor = heightFactor > 6;
let isNormalizedSizeFactor = widthFactor > 10;
let isNormalizedHeightFactor = heightFactor > 10;
self.getBaselineLenths()
@@ -2853,7 +2853,7 @@ import SVGKit
}
}
private func highlightBorder(highlighted:Bool) {
private func highlightBorder(highlighted:Bool, color:CGColor? = nil) {
if self.isFolder {
OnScreenWidgetView.setBorder(hilighted: highlighted, in: UIColor.systemYellow.cgColor, for: self)
self.forEachWidget{ widget in
@@ -2864,7 +2864,7 @@ import SVGKit
return
}
OnScreenWidgetView.setBorder(hilighted: highlighted, in: voidlinkPurple, for: self)
OnScreenWidgetView.setBorder(hilighted: highlighted, in: color ?? voidlinkPurple, for: self)
}
private func isPencilProEnabled() -> Bool {
@@ -2906,8 +2906,9 @@ import SVGKit
guard let widget = OnScreenWidgetView.mapping[sequence], widget != exception else {continue}
DispatchQueue.main.async {
widget.isUserInteractionEnabled = false
if widget.widgetType == .touchPad {
widget.highlightBorder(highlighted: true)
if ((folder.buttonMode != .slideAndHold && widget.widgetType == .touchPad)
|| abs(widget.backgroundAlpha) < 0.1){
widget.highlightBorder(highlighted: true, color: UIColor.systemBlue.cgColor)
}
let duration = OnScreenWidgetView.enableFolderAnimation ? (folder.buttonMode == .slideAndHold ? 0.05 : 0.15) : 0
UIView.animate(withDuration: duration, animations: {
@@ -2916,7 +2917,8 @@ import SVGKit
widget.isUserInteractionEnabled = !hidden
widget.center = folder.folded ? folder.storedCenter : widget.storedCenter
widget.isHidden = folder.folded
if widget.widgetType == .touchPad {
if ((folder.buttonMode != .slideAndHold && widget.widgetType == .touchPad)
|| abs(widget.backgroundAlpha) < 0.1){
widget.highlightBorder(highlighted: false)
}
})
@@ -2931,8 +2933,9 @@ import SVGKit
widget.capturedTouches.removeAllObjects()
widget.center = folder.storedCenter
widget.isHidden = false
if widget.widgetType == .touchPad {
widget.highlightBorder(highlighted: true)
if ((folder.buttonMode != .slideAndHold && widget.widgetType == .touchPad)
|| abs(widget.backgroundAlpha) < 0.1){
widget.highlightBorder(highlighted: true, color: UIColor.systemBlue.cgColor)
}
UIView.animate(withDuration: OnScreenWidgetView.enableFolderAnimation ? (folder.buttonMode == .slideAndHold ? 0.05 : 0.15) : 0, animations: {
widget.center = widget.storedCenter
@@ -2941,7 +2944,8 @@ import SVGKit
widget.isUserInteractionEnabled = !folder.folded
widget.center = folder.folded ? folder.storedCenter : widget.storedCenter
widget.isHidden = folder.folded
if widget.widgetType == .touchPad {
if ((folder.buttonMode != .slideAndHold && widget.widgetType == .touchPad)
|| abs(widget.backgroundAlpha) < 0.1){
widget.highlightBorder(highlighted: false)
}
})
@@ -3151,6 +3155,7 @@ import SVGKit
var verticallyAligned = false
widget.forEachWidget{ otherWidget in
guard otherWidget != widget else {return}
if widget.isFolder, widget.bulkMoveEnabled, widget.sequenceSet.contains(otherWidget.sequence) {return}
verticallyAligned = verticallyAligned ? verticallyAligned : widget.center.x > otherWidget.center.x-1 && widget.center.x < otherWidget.center.x+1
horizontallyAligned = horizontallyAligned ? horizontallyAligned : widget.center.y > otherWidget.center.y-1 && widget.center.y < otherWidget.center.y+1
}
+29 -23
View File
@@ -5024,6 +5024,35 @@
}
}
},
"mouseModeSwitchButtonTip" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Press a button for switching to controller mouse mode (long press for 1 second during streaming)\n\nNote: if you want to designate home button, double tap to pass it through to VoidLink app on iOS 26+."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "按下用于切换手柄鼠标模式的按键(串流时长按1秒切换)\n\n注意:如果需要指定 home 键,在 iOS 26+ 系统上需要双击将该按键透传至 VoidLink。"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "按下用於切換手柄滑鼠模式的按鍵(串流時長按 1 秒切換)\n\n注意:如果需要指定 Home 鍵,在 iOS 26+ 系統上需要雙擊將該按鍵透傳至 VoidLink。"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "按下用於切換手柄滑鼠模式的按鍵(串流時長按 1 秒切換)。\n\n注意:如果需要指定 Home 鍵,在 iOS 26+ 系統上需要雙擊將該按鍵透傳至 VoidLink。"
}
}
}
},
"Move the stick you wish to use for mouse control. Another stick will be used for vertical & horizontal scroll." : {
"extractionState" : "manual",
"localizations" : {
@@ -6486,29 +6515,6 @@
}
}
},
"Press a button for switching to controller mouse mode (long press for 1 second during streaming)" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "按下用于切换手柄鼠标模式的按键(串流时长按1秒切换)"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "按下用於切換手柄滑鼠模式的按鍵(串流時長按 1 秒切換)"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "按下用於切換手柄滑鼠模式的按鍵(串流時長按 1 秒切換)"
}
}
}
},
"Press the button for mouse left button" : {
"extractionState" : "manual",
"localizations" : {
@@ -2592,7 +2592,7 @@ BOOL isCustomResolution(int resolutionSelected) {
Settings* currentSettings = [dataMan retrieveSettings];
[AlertControllerUtil showAlertIn:self
title:[LocalizationHelper localizedStringForKey:@"Map controller to mouse"]
message:[LocalizationHelper localizedStringForKey:@"Press a button for switching to controller mouse mode (long press for 1 second during streaming)"]
message:[LocalizationHelper localizedStringForKey:@"mouseModeSwitchButtonTip"]
withCancel:YES
buttonTitle:@""
countdown:0