lower iOS compatibility fixes

This commit is contained in:
True Zhuanjia
2026-04-22 23:53:19 +08:00
parent 7e21292a62
commit ecacb1afa7
9 changed files with 111 additions and 15 deletions
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "gamecontroller.circle.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generator: Apple Native CoreSVG 341-->
<!DOCTYPE svg
PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 30.249 29.8975">
<g>
<rect height="29.8975" opacity="0" width="30.249" x="0" y="0"/>
<path d="M14.9414 29.8828C23.1885 29.8828 29.8828 23.1885 29.8828 14.9414C29.8828 6.69434 23.1885 0 14.9414 0C6.69434 0 0 6.69434 0 14.9414C0 23.1885 6.69434 29.8828 14.9414 29.8828ZM14.9414 27.3926C8.05664 27.3926 2.49023 21.8262 2.49023 14.9414C2.49023 8.05664 8.05664 2.49023 14.9414 2.49023C21.8262 2.49023 27.3926 8.05664 27.3926 14.9414C27.3926 21.8262 21.8262 27.3926 14.9414 27.3926Z" fill="white"/>
<path d="M7.9834 20.127C8.8623 20.127 9.47754 19.79 10.0342 19.1309L11.2207 17.6807C11.3818 17.4756 11.5723 17.373 11.7773 17.373L18.0762 17.373C18.2812 17.373 18.4717 17.4756 18.6328 17.6807L19.834 19.1309C20.376 19.79 20.9912 20.127 21.8701 20.127C23.3643 20.127 24.3604 19.1309 24.3604 17.6074C24.3604 16.9482 24.2139 16.2158 23.9648 15.3516C23.5547 14.0332 22.8516 12.2021 22.1777 10.7812C21.6211 9.60938 21.3428 9.06738 19.9658 8.75977C18.7207 8.48145 17.0215 8.29102 14.9268 8.29102C12.832 8.29102 11.1328 8.48145 9.8877 8.75977C8.51074 9.06738 8.23242 9.60938 7.67578 10.7812C7.00195 12.2021 6.31348 14.0332 5.90332 15.3516C5.6543 16.2158 5.49316 16.9482 5.49316 17.6074C5.49316 19.1309 6.48926 20.127 7.9834 20.127ZM9.44824 12.8906C9.44824 12.5391 9.66797 12.3047 10.0342 12.3047L11.2207 12.3047L11.2207 11.1621C11.2207 10.7959 11.4258 10.5615 11.7773 10.5615C12.1289 10.5615 12.334 10.7959 12.334 11.1621L12.334 12.3047L13.4619 12.3047C13.8574 12.3047 14.0918 12.5391 14.0918 12.8906C14.0918 13.2568 13.8574 13.4766 13.4619 13.4766L12.334 13.4766L12.334 14.6484C12.334 15 12.1289 15.2344 11.7773 15.2344C11.4258 15.2344 11.2207 15 11.2207 14.6484L11.2207 13.4766L10.0342 13.4766C9.66797 13.4766 9.44824 13.2568 9.44824 12.8906ZM19.1162 12.8174C18.5889 12.8174 18.1348 12.3926 18.1348 11.8359C18.1348 11.3086 18.5889 10.8691 19.1162 10.8691C19.6582 10.8691 20.0977 11.3086 20.0977 11.8359C20.0977 12.3926 19.6582 12.8174 19.1162 12.8174ZM17.1387 14.8242C16.5967 14.8242 16.1572 14.3848 16.1572 13.8428C16.1572 13.3008 16.5967 12.876 17.1387 12.876C17.6807 12.876 18.1201 13.3008 18.1201 13.8428C18.1201 14.3848 17.6807 14.8242 17.1387 14.8242Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "gamecontroller.circle.tag.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Generator: Apple Native CoreSVG 341-->
<!DOCTYPE svg
PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 19.2876 18.9351">
<g>
<rect height="18.9351" opacity="0" width="19.2876" x="0" y="0"/>
<path d="M9.46289 18.9258C14.686 18.9258 18.9258 14.686 18.9258 9.46289C18.9258 4.23975 14.686 0 9.46289 0C4.23975 0 0 4.23975 0 9.46289C0 14.686 4.23975 18.9258 9.46289 18.9258ZM9.46289 17.3486C5.10254 17.3486 1.57715 13.8232 1.57715 9.46289C1.57715 5.10254 5.10254 1.57715 9.46289 1.57715C13.8232 1.57715 17.3486 5.10254 17.3486 9.46289C17.3486 13.8232 13.8232 17.3486 9.46289 17.3486Z" fill="white"/>
<path d="M5.05615 12.7471C5.61279 12.7471 6.00244 12.5337 6.35498 12.1162L7.10645 11.1978C7.2085 11.0679 7.3291 11.0029 7.45898 11.0029L11.4482 11.0029C11.5781 11.0029 11.6987 11.0679 11.8008 11.1978L12.5615 12.1162C12.9048 12.5337 13.2944 12.7471 13.8511 12.7471C14.7974 12.7471 15.4282 12.1162 15.4282 11.1514C15.4282 10.7339 15.3354 10.27 15.1777 9.72266C14.918 8.8877 14.4727 7.72803 14.0459 6.82812C13.6934 6.08594 13.5171 5.74268 12.645 5.54785C11.8564 5.37158 10.7803 5.25098 9.45361 5.25098C8.12695 5.25098 7.05078 5.37158 6.26221 5.54785C5.39014 5.74268 5.21387 6.08594 4.86133 6.82812C4.43457 7.72803 3.99854 8.8877 3.73877 9.72266C3.58105 10.27 3.479 10.7339 3.479 11.1514C3.479 12.1162 4.10986 12.7471 5.05615 12.7471ZM5.98389 8.16406C5.98389 7.94141 6.12305 7.79297 6.35498 7.79297L7.10645 7.79297L7.10645 7.06934C7.10645 6.8374 7.23633 6.68896 7.45898 6.68896C7.68164 6.68896 7.81152 6.8374 7.81152 7.06934L7.81152 7.79297L8.52588 7.79297C8.77637 7.79297 8.9248 7.94141 8.9248 8.16406C8.9248 8.396 8.77637 8.53516 8.52588 8.53516L7.81152 8.53516L7.81152 9.27734C7.81152 9.5 7.68164 9.64844 7.45898 9.64844C7.23633 9.64844 7.10645 9.5 7.10645 9.27734L7.10645 8.53516L6.35498 8.53516C6.12305 8.53516 5.98389 8.396 5.98389 8.16406ZM12.1069 8.11768C11.7729 8.11768 11.4854 7.84863 11.4854 7.49609C11.4854 7.16211 11.7729 6.88379 12.1069 6.88379C12.4502 6.88379 12.7285 7.16211 12.7285 7.49609C12.7285 7.84863 12.4502 8.11768 12.1069 8.11768ZM10.8545 9.38867C10.5112 9.38867 10.2329 9.11035 10.2329 8.76709C10.2329 8.42383 10.5112 8.15479 10.8545 8.15479C11.1978 8.15479 11.4761 8.42383 11.4761 8.76709C11.4761 9.11035 11.1978 9.38867 10.8545 9.38867Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

+9 -4
View File
@@ -824,6 +824,9 @@ import ObjectiveC.runtime
private func setSquareWidgetCornerRadius(){
let shortSideLen = min(self.layer.bounds.size.width, self.layer.bounds.size.height)
self.layer.cornerRadius = shortSideLen/2 < 16 ? shortSideLen/3.2 : 16
if #available(iOS 13.0, *) {
self.layer.cornerCurve = .continuous
}
}
func containsNonLatin(_ text: String) -> Bool {
@@ -866,6 +869,7 @@ import ObjectiveC.runtime
)
label.attributedText = attr
label.textAlignment = .center
label.baselineAdjustment = .alignCenters
}
private func setupView() {
@@ -900,7 +904,6 @@ import ObjectiveC.runtime
self.translatesAutoresizingMaskIntoConstraints = true // this is mandatory to prevent unexpected key view location change
self.setSquareWidgetCornerRadius()
self.layer.borderWidth = self.borderWidth
self.tweakAlpha(tweakBorderAlpha: false, tweakLabelAlpha: false)
@@ -927,7 +930,7 @@ import ObjectiveC.runtime
label.isHidden = self.widgetLabel.uppercased() == self.touchPadString // allow touchPad label to be display if it's different from touchPad cmdString
}
}
if !self.functionalButtonString.isEmpty{
self.layer.borderWidth = self.borderWidth
}
@@ -935,11 +938,10 @@ import ObjectiveC.runtime
if self.shape == "round" {
//setup round buttons
self.layer.cornerRadius = self.frame.width/2
// self.layer.borderWidth = self.borderWidth
label.minimumScaleFactor = 0.15 // Adjust the scale factor for oscButtons
}
if self.shape == "square" || self.shape == "largeSquare" {
//just do nothing here
self.setSquareWidgetCornerRadius()
}
@@ -1809,6 +1811,9 @@ import ObjectiveC.runtime
buttonDownVisualEffectLayer.borderColor = standardHighlightColor.cgColor
buttonDownVisualEffectLayer.frame = self.bounds.insetBy(dx: -buttonDownVisualEffectLayer.borderWidth, dy: -buttonDownVisualEffectLayer.borderWidth) // Adjust the inset as needed
buttonDownVisualEffectLayer.cornerRadius = self.layer.cornerRadius + buttonDownVisualEffectLayer.borderWidth
if self.shape == "square" {if #available(iOS 13.0, *) {
buttonDownVisualEffectLayer.cornerCurve = .continuous
}}
buttonDownVisualEffectLayer.backgroundColor = UIColor.clear.cgColor;
buttonDownVisualEffectLayer.fillColor = UIColor.clear.cgColor;
+1 -1
View File
@@ -5465,7 +5465,7 @@
},
"zh-Hant" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "- 螢幕控制項佈局(包含虛擬手把、虛擬按鍵等),以及設定選單中標記 [手把圖示] 的選項(如體感控制參數),皆保存在遊戲配置中。\n\n- 串流過程中,由螢幕 %@ 邊緣向內滑動 %@ 螢幕寬度,即可在工具箱選單中開啟[切換遊戲配置]"
}
},
+5
View File
@@ -248,4 +248,9 @@ import Foundation
@objc static var screenHeight: CGFloat {
return UIScreen.main.bounds.height
}
@objc static var iOS18Available: Bool {
if #available(iOS 18.0, *) {return true}
else {return false}
}
}
@@ -1613,16 +1613,28 @@ static NSMutableSet* hostList;
[_profilesButton setAction:@selector(profilesButtonTapped)];
if (@available(iOS 13.0, *)) {
[_profilesButton setTitle:nil];
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:GenericUtils.liquidGlassEnabled ? 20.5 : 23 weight:UIImageSymbolWeightRegular ];
UIImage *image = [[UIImage systemImageNamed:@"gamecontroller.circle" withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[_profilesButton setImage:image];
_profilesButton.imageInsets = GenericUtils.liquidGlassEnabled ? UIEdgeInsetsMake(0, 0, 0, 0.55) : UIEdgeInsetsMake(10, 10, 0, 0);
if(GenericUtils.liquidGlassEnabled){
// if(@available(iOS 26.0, *)) _settingsButton.hidesSharedBackground = YES;
UIImageSymbolConfiguration *config;
UIImage *image;
if(GenericUtils.iOS18Available){
config = [UIImageSymbolConfiguration configurationWithPointSize:GenericUtils.liquidGlassEnabled ? 20.5 : 23 weight:UIImageSymbolWeightRegular ];
image = [[UIImage systemImageNamed: @"gamecontroller.circle" withConfiguration:config] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[_profilesButton setImage:image];
_profilesButton.imageInsets = GenericUtils.liquidGlassEnabled ? UIEdgeInsetsMake(0, 0, 0, 0.55) : UIEdgeInsetsMake(10, 10, 0, 0);
if(GenericUtils.liquidGlassEnabled){
_profilesButton.tintColor = ThemeManager.appPrimaryColor;
}
}
else{
image = [[UIImage imageNamed: @"gamecontroller.circle.regular"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[_profilesButton setImage:image];
_profilesButton.imageInsets = UIEdgeInsetsMake(-1.5, 0, -1.5, 0);
_profilesButton.tintColor = ThemeManager.appPrimaryColor;
}
} else {
[_profilesButton setTitle:[LocalizationHelper localizedStringForKey:@"Settings"]];
[_profilesButton setTitle:[LocalizationHelper localizedStringForKey:@"Game Profile"]];
}
if (@available(iOS 26.0, *)) {
@@ -1507,15 +1507,23 @@ BOOL isCustomResolution(int resolutionSelected) {
button = [UIButton buttonWithType:UIButtonTypeSystem];
if (@available(iOS 13.0, *)) {
if(stack.isGameProfileSetting){
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:14.5 weight:UIImageSymbolWeightRegular];
[button setImage:[UIImage systemImageNamed:@"gamecontroller.circle" withConfiguration:config] forState:UIControlStateNormal];
UIImage* image;
if(GenericUtils.iOS18Available){
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:14.5 weight:UIImageSymbolWeightRegular];
image = [UIImage systemImageNamed:@"gamecontroller.circle" withConfiguration:config];
}
else{
image = [[UIImage imageNamed: @"gamecontroller.circle.tag"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
[button setImage:image forState:UIControlStateNormal];
}
else{
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:13.5 weight:UIImageSymbolWeightMedium];
[button setImage:[UIImage systemImageNamed:@"info.circle" withConfiguration:config] forState:UIControlStateNormal];
}
} else {
[button setTitle:@"info" forState:UIControlStateNormal];
[button setTitle:stack.isGameProfileSetting ? @"game" : @"info" forState:UIControlStateNormal];
button.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold];
button.titleLabel.accessibilityIdentifier = @"infoButton";
}