- widget tool improvements

- tool box constraint fixes
This commit is contained in:
TrueZhuanjia
2025-06-22 15:57:29 +08:00
parent 9937b67509
commit cd6e08956c
8 changed files with 153 additions and 36 deletions
+17 -10
View File
@@ -1164,7 +1164,7 @@
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="z5Q-bW-WQ8" userLabel="widgetPanelStack" customClass="WidgetPanelStackView">
<rect key="frame" x="325" y="156" width="650" height="237"/>
<rect key="frame" x="325" y="156" width="650" height="267.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Profile:" textAlignment="center" lineBreakMode="tailTruncation" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iel-xl-xd9">
<rect key="frame" x="0.0" y="0.0" width="650" height="37"/>
@@ -1178,8 +1178,14 @@
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tap any widget to load configuration (per widget)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xfv-K0-1CO">
<rect key="frame" x="0.0" y="47" width="650" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GOp-1e-oUF" userLabel="widgetSizeStack">
<rect key="frame" x="0.0" y="47" width="650" height="30"/>
<rect key="frame" x="0.0" y="77.5" width="650" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZuV-4A-0Zb" userLabel="widgetSizeLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -1198,7 +1204,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9Zz-kb-7Ej" userLabel="widgetHeightStack">
<rect key="frame" x="0.0" y="87" width="650" height="30"/>
<rect key="frame" x="0.0" y="117.5" width="650" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sbd-0j-KWS" userLabel="widgetHeightLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -1217,7 +1223,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="9ZS-28-txW" userLabel="borderWidthAlphaStack">
<rect key="frame" x="0.0" y="127" width="650" height="30"/>
<rect key="frame" x="0.0" y="157.5" width="650" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Pwa-YK-6Q2" userLabel="widgetAlphaLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -1253,7 +1259,7 @@
</subviews>
</stackView>
<stackView contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="zfD-bd-GEN" userLabel="stickIndicatorOffsetStack">
<rect key="frame" x="0.0" y="167" width="650" height="30"/>
<rect key="frame" x="0.0" y="197.5" width="650" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tG7-oX-P9b" userLabel="stickIndicatorOffsetLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -1272,7 +1278,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="80D-qe-E5D" userLabel="sensitivityFactorStack">
<rect key="frame" x="0.0" y="207" width="650" height="30"/>
<rect key="frame" x="0.0" y="237.5" width="650" height="30"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vJs-pg-hHe" userLabel="sensitivityFactorLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="30"/>
@@ -1315,6 +1321,7 @@
<outlet property="editButton" destination="R45-lM-YPl" id="DNS-7N-3Kh"/>
<outlet property="exitButton" destination="7bp-Wn-j9n" id="Kku-3T-RSO"/>
<outlet property="loadButton" destination="OId-gk-Wkg" id="adP-54-1ir"/>
<outlet property="loadConfigTipLabel" destination="xfv-K0-1CO" id="GeX-Qc-CLA"/>
<outlet property="saveButton" destination="uda-zt-xrG" id="FyB-WY-rri"/>
<outlet property="sensitivityLabel" destination="vJs-pg-hHe" id="RRw-Zq-LUa"/>
<outlet property="sensitivitySlider" destination="DiG-XX-r8c" id="fz5-Et-1WV"/>
@@ -1337,7 +1344,7 @@
<outlet property="widgetPanelStack" destination="z5Q-bW-WQ8" id="AMp-OC-LsJ"/>
<outlet property="widgetSizeLabel" destination="ZuV-4A-0Zb" id="Nr8-Wg-POM"/>
<outlet property="widgetSizeSlider" destination="Xzq-VC-hP3" id="lW5-0R-s5U"/>
<outlet property="widgetSizeStack" destination="z5Q-bW-WQ8" id="pc5-Cm-OYY"/>
<outlet property="widgetSizeStack" destination="GOp-1e-oUF" id="v7q-w3-Tls"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dev-Ck-vTF" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
@@ -1435,16 +1442,16 @@
<image name="tray.full.fill" catalog="system" width="128" height="88"/>
<image name="video.and.waveform" catalog="system" width="128" height="94"/>
<systemColor name="linkColor">
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemBrownColor">
<color red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.63529411764705879" green="0.51764705882352946" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemTealColor">
<color red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.18823529411764706" green="0.69019607843137254" blue="0.7803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
+18 -11
View File
@@ -321,7 +321,7 @@
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="BVp-3O-vZ7" userLabel="widgetPanelStack" customClass="WidgetPanelStackView">
<rect key="frame" x="325" y="226" width="550" height="190"/>
<rect key="frame" x="325" y="226" width="550" height="217.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Profile:" textAlignment="center" lineBreakMode="tailTruncation" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="f46-Pt-0Pv">
<rect key="frame" x="0.0" y="0.0" width="550" height="28"/>
@@ -335,8 +335,14 @@
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tap any widget to load configuration (per widget)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Gg-66-UdB">
<rect key="frame" x="0.0" y="35" width="550" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xoH-wS-SS1" userLabel="widgetSizeStack">
<rect key="frame" x="0.0" y="35" width="550" height="20"/>
<rect key="frame" x="0.0" y="62.5" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kva-gQ-CZh" userLabel="widgetSizeLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="20"/>
@@ -358,7 +364,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4Vo-Zh-48b" userLabel="widgetHeightStack">
<rect key="frame" x="0.0" y="62" width="550" height="20"/>
<rect key="frame" x="0.0" y="89.5" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Idx-O1-5dn" userLabel="widgetHeightLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="20"/>
@@ -380,7 +386,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="50p-sC-ObU" userLabel="borderWidthAlphaStack">
<rect key="frame" x="0.0" y="89" width="550" height="20"/>
<rect key="frame" x="0.0" y="116.5" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qPQ-U2-aSg" userLabel="widgetAlphaLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="20"/>
@@ -419,7 +425,7 @@
</constraints>
</stackView>
<stackView contentMode="scaleToFill" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Ejp-Jq-phL" userLabel="stickIndicatorOffsetStack">
<rect key="frame" x="0.0" y="116" width="550" height="20"/>
<rect key="frame" x="0.0" y="143.5" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fcy-zp-LGa" userLabel="stickIndicatorOffsetLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="20"/>
@@ -441,7 +447,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fem-TG-vr3" userLabel="sensitivityFactorStack">
<rect key="frame" x="0.0" y="143" width="550" height="20"/>
<rect key="frame" x="0.0" y="170.5" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dJh-Ck-ugh" userLabel="sensitivityFactorLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="20"/>
@@ -463,7 +469,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gsG-6n-BAb" userLabel="vibrationStyleStack">
<rect key="frame" x="0.0" y="170" width="550" height="20"/>
<rect key="frame" x="0.0" y="197.5" width="550" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Vibration Style" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u3w-Se-xzH" userLabel="sensitivityFactorLabel">
<rect key="frame" x="0.0" y="0.0" width="160" height="20"/>
@@ -511,6 +517,7 @@
<outlet property="chevronImageView" destination="76O-3K-aa8" id="yGv-fM-Ohf"/>
<outlet property="chevronView" destination="Zll-IP-PFt" id="MGR-C0-h57"/>
<outlet property="currentProfileLabel" destination="f46-Pt-0Pv" id="BjA-jF-t86"/>
<outlet property="loadConfigTipLabel" destination="9Gg-66-UdB" id="cMS-ly-En0"/>
<outlet property="sensitivityLabel" destination="dJh-Ck-ugh" id="vso-QW-vxX"/>
<outlet property="sensitivitySlider" destination="Vqk-gH-0xO" id="CVC-XX-0LQ"/>
<outlet property="sensitivityStack" destination="fem-TG-vr3" id="O9M-Ip-ZlT"/>
@@ -1457,16 +1464,16 @@
<image name="trash.fill" catalog="system" width="117" height="128"/>
<image name="tray.full.fill" catalog="system" width="128" height="88"/>
<systemColor name="linkColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBrownColor">
<color red="0.63529411764705879" green="0.51764705882352946" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemGray2Color">
<color red="0.68235294117647061" green="0.68235294117647061" blue="0.69803921568627447" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.68235294120000001" green="0.68235294120000001" blue="0.69803921570000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemTealColor">
<color red="0.18823529411764706" green="0.69019607843137254" blue="0.7803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
@@ -78,6 +78,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic) IBOutlet UISegmentedControl *vibrationStyleSelector;
@property (strong, nonatomic) IBOutlet UIStackView *vibrationStyleStack;
@property (strong, nonatomic) IBOutlet UILabel *loadConfigTipLabel;
@@ -169,7 +169,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(setControllerCALayerSliderValues:)
selector:@selector(legacyOscLayerTapped:)
name:@"LegacyOscCALayerSelectedNotification"
object:nil];
@@ -624,10 +624,20 @@
if([self isIPhone]) [self updateClippedMaskForView:view];
}
- (void)enableCommonWidgetTools{
self.loadConfigTipLabel.hidden = YES;
self.widgetSizeStack.hidden = NO;
self.widgetHeightStack.hidden = NO;
self.borderWidthAlphaStack.hidden = NO;
if([self isIPhone]) self.vibrationStyleStack.hidden = NO;
}
- (void)widgetViewTapped: (NSNotification *)notification{
//self.undoButton.alpha = selectedWidgetView.layoutChanges.count>1 && !CGPointEqualToPoint(selectedWidgetView.layoutChanges.lastObject.CGPointValue, selectedWidgetView.initialCenter)? 1.0 : 0.3;
// receive the selected widgetView obj passed from the notification
[self enableCommonWidgetTools];
OnScreenWidgetView* widgetView = (OnScreenWidgetView* )notification.object;
@@ -676,8 +686,8 @@
}
}
- (void)setControllerCALayerSliderValues: (NSNotification *)notification{
// receive the selected widgetView obj passed from the notification
- (void)legacyOscLayerTapped: (NSNotification *)notification{
[self enableCommonWidgetTools];
CALayer* controllerLayer = (CALayer* )notification.object;
[self->selectedWidgetView.stickBallLayer removeFromSuperlayer];
[self->selectedWidgetView.crossMarkLayer removeFromSuperlayer];
@@ -705,6 +715,7 @@
NSNumber *style = [OnScreenControls.layerVibrationStyleDic objectForKey:selectedControllerLayer.name];
self.vibrationStyleSelector.selectedSegmentIndex = [style unsignedCharValue];
}
[self autoFitView:_widgetPanelStack];
}
- (void)widgetSizeSliderMoved:(UISlider* )sender{
@@ -821,6 +832,8 @@
- (void)setupWidgetPanel{
//[self handleMissingToolBarIcon];
self.widgetPanelStack.hidden = NO;
self.loadConfigTipLabel.hidden = NO;
self.widgetPanelStack.layoutMargins = UIEdgeInsetsMake(10, 10, 10, 10);
self.widgetPanelStack.layoutMarginsRelativeArrangement = YES;
self.widgetPanelStack.layer.cornerRadius = 16;
@@ -844,19 +857,19 @@
[self.widgetSizeSlider addTarget:self action:@selector(widgetSizeSliderMoved:) forControlEvents:(UIControlEventValueChanged)];
self.widgetSizeLabel.text = [LocalizationHelper localizedStringForKey:@"Size"];
self.widgetSizeStack.hidden = _quickSwitchEnabled;
self.widgetSizeStack.hidden = YES;
[self.widgetHeightSlider addTarget:self action:@selector(widgetHeightSliderMoved:) forControlEvents:(UIControlEventValueChanged)];
self.widgetHeightLabel.text = [LocalizationHelper localizedStringForKey:@"Height"];
self.widgetHeightStack.hidden = _quickSwitchEnabled;
self.widgetHeightStack.hidden = YES;
[self.widgetAlphaSlider addTarget:self action:@selector(widgetAlphaSliderMoved:) forControlEvents:(UIControlEventValueChanged)];
self.widgetAlphaLabel.text = [LocalizationHelper localizedStringForKey:@"Alpha"];
[self.widgetBorderWidthSlider addTarget:self action:@selector(widgetBorderWidthSliderMoved:) forControlEvents:(UIControlEventValueChanged)];
self.widgetBorderWidthLabel.text = [LocalizationHelper localizedStringForKey:@"Border Width"];
self.borderWidthAlphaStack.hidden = _quickSwitchEnabled;
self.borderWidthAlphaStack.hidden = YES;
[self.sensitivitySlider addTarget:self action:@selector(sensitivitySliderMoved:) forControlEvents:(UIControlEventValueChanged)];
self.sensitivityLabel.text = [LocalizationHelper localizedStringForKey:@"Sensitivity"];
@@ -871,7 +884,7 @@
if([self isIPhone]){
[self.vibrationStyleSelector addTarget:self action:@selector(vibrationStyleChanged:) forControlEvents:(UIControlEventValueChanged)];
self.vibrationStyleStack.hidden = NO;
self.vibrationStyleStack.hidden = YES;
NSDictionary *normalAttributes = @{
NSForegroundColorAttributeName: [UIColor whiteColor]
};
@@ -888,6 +901,8 @@
//frame.origin = CGPointMake(self.view.bounds.size.width/2, 100);
frame.origin = CGPointMake(self.view.bounds.size.width/2-self.widgetPanelStack.frame.size.width/2, 100);
self.widgetPanelStack.frame = frame;
[self autoFitView:self.widgetPanelStack];
if([self isIPhone]) {
@@ -128,7 +128,12 @@
}
- (void)presentCommandManagerViewController{
[self presentViewController:toolBoxViewController animated:YES completion:nil];
toolBoxViewController = [[ToolBoxViewController alloc] init];
toolBoxViewController.specialEntryDelegate = self;
[self configOscLayoutTool];
[self presentViewController:toolBoxViewController animated:YES completion:^{
//[self->toolBoxViewController setupConstraints];
}];
}
- (void)configSwipeGestures{
@@ -31,7 +31,7 @@ import UIKit
"widgetSwitchTool":SwiftLocalizationHelper.localizedString(forKey: "[ Switch among on-screen widget profiles ]"),
"widgetLayoutTool":SwiftLocalizationHelper.localizedString(forKey: "[ Open on-screen widget tool ]")
]
private var viewPinned: Bool = false
private var isEditingMode: Bool = false {
didSet {
@@ -57,10 +57,17 @@ import UIKit
override public func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
setupConstraints()
//setupConstraints()
reloadTableView()
}
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
//setupConstraints()
}
private func setupViews() {
// Set corner radius
@@ -76,7 +83,7 @@ import UIKit
view.backgroundColor = viewBackgroundColor
tableView.backgroundColor = .clear
tableView.rowHeight = 60
tableView.rowHeight = isIPhone() ? 47 : 60
tableView.separatorColor = highlightColor
// Configure buttons
addButton.setTitle(SwiftLocalizationHelper.localizedString(forKey: "Add / Duplicate"), for: .normal)
@@ -108,12 +115,23 @@ import UIKit
}
private func setupConstraints() {
public override func updateViewConstraints() {
self.setupConstraints()
super.updateViewConstraints()
}
private func isIPhone()->Bool {
return UIDevice.current.userInterfaceIdiom == .phone
}
@objc public func setupConstraints() {
guard view.superview != nil else {
return
}
NSLayoutConstraint.deactivate(view.constraints)
view.translatesAutoresizingMaskIntoConstraints = false
tableView.translatesAutoresizingMaskIntoConstraints = false
@@ -127,9 +145,13 @@ import UIKit
NSLayoutConstraint.activate([
// Set the width and height of the view
view.widthAnchor.constraint(equalTo: view.superview!.widthAnchor, multiplier: 1),
view.heightAnchor.constraint(equalTo: view.superview!.heightAnchor, multiplier: 1),
view.widthAnchor.constraint(equalTo: view.superview!.widthAnchor, multiplier: isIPhone() ? 0.7 : 0.8),
view.heightAnchor.constraint(equalTo: view.superview!.heightAnchor, multiplier: 0.99),
// Set the width and height of the view
//view.leadingAnchor.constraint(equalTo: view.superview!.leadingAnchor, constant: 60),
//view.trailingAnchor.constraint(equalTo: view.superview!.trailingAnchor, constant: -60),
// Center the view horizontally and vertically
view.centerXAnchor.constraint(equalTo: view.superview!.centerXAnchor),
view.centerYAnchor.constraint(equalTo: view.superview!.centerYAnchor),
+30
View File
@@ -2485,6 +2485,36 @@
}
}
},
"xfv-K0-1CO.text" : {
"comment" : "Class = \"UILabel\"; text = \"Tap any widget to load configuration (per widget)\"; ObjectID = \"xfv-K0-1CO\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Tap any widget to load configuration (per widget)"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "轻按任意控件加载配置 (各控件独立)"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "轻按任意控件加载配置 (各控件独立)"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "轻按任意控件加载配置 (各控件独立)"
}
}
}
},
"yY7-Sf-Zes.segmentTitles[0]" : {
"comment" : "Class = \"UISegmentedControl\"; yY7-Sf-Zes.segmentTitles[0] = \"Slide From Left Edge\"; ObjectID = \"yY7-Sf-Zes\";",
"extractionState" : "extracted_with_value",
+30
View File
@@ -679,6 +679,36 @@
}
}
},
"9Gg-66-UdB.text" : {
"comment" : "Class = \"UILabel\"; text = \"Tap any widget to load configuration (per widget)\"; ObjectID = \"9Gg-66-UdB\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Tap any widget to load configuration (per widget)"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "轻按任意控件加载配置 (各控件独立)"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "轻按任意控件加载配置 (各控件独立)"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "轻按任意控件加载配置 (各控件独立)"
}
}
}
},
"885-w2-VAD.text" : {
"comment" : "Class = \"UILabel\"; text = \"Swap A/B and X/Y Buttons\"; ObjectID = \"885-w2-VAD\";",
"extractionState" : "extracted_with_value",