marinofaggiana 3 years ago
parent
commit
a3fed897e9

+ 19 - 0
iOSClient/BackgroundImageColor/NCBackgroundImageColor.storyboard

@@ -25,7 +25,22 @@
                             </label>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iU2-DL-ICv">
                                 <rect key="frame" x="0.0" y="53" width="300" height="250"/>
+                                <subviews>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3E4-fA-LuC">
+                                        <rect key="frame" x="260" y="10" width="30" height="30"/>
+                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="width" constant="30" id="7gh-HI-7F4"/>
+                                            <constraint firstAttribute="height" constant="30" id="tN7-80-0OA"/>
+                                        </constraints>
+                                        <connections>
+                                            <action selector="whiteButtonAction:" destination="V0q-CP-xMJ" eventType="touchUpInside" id="qan-1S-lXZ"/>
+                                        </connections>
+                                    </button>
+                                </subviews>
                                 <constraints>
+                                    <constraint firstAttribute="trailing" secondItem="3E4-fA-LuC" secondAttribute="trailing" constant="10" id="UoS-lh-xRi"/>
+                                    <constraint firstItem="3E4-fA-LuC" firstAttribute="top" secondItem="iU2-DL-ICv" secondAttribute="top" constant="10" id="XPi-Om-9AW"/>
                                     <constraint firstAttribute="height" constant="250" id="v0B-oB-eD3"/>
                                 </constraints>
                             </view>
@@ -84,6 +99,9 @@
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Dy-77-TIC">
                                         <rect key="frame" x="10" y="95" width="280" height="30"/>
                                         <color key="backgroundColor" systemColor="systemGray4Color"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="30" id="ZKT-Su-3nU"/>
+                                        </constraints>
                                         <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                         <state key="normal" title="default color">
                                             <color key="titleColor" systemColor="labelColor"/>
@@ -159,6 +177,7 @@
                         <outlet property="titleLabel" destination="nZr-nE-ths" id="UbA-Dl-0Ad"/>
                         <outlet property="useForAllLabel" destination="byB-wK-0AW" id="HKs-m2-SBz"/>
                         <outlet property="useForAllSwitch" destination="ber-cK-0ag" id="D2m-GW-l2t"/>
+                        <outlet property="whiteButton" destination="3E4-fA-LuC" id="mNg-2f-rvs"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="qdm-Cl-C5l" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>

+ 14 - 2
iOSClient/BackgroundImageColor/NCBackgroundImageColor.swift

@@ -29,6 +29,8 @@ class NCBackgroundImageColor: UIViewController {
     @IBOutlet weak var titleLabel: UILabel!
     @IBOutlet weak var chromaColorPickerView: UIView!
     
+    @IBOutlet weak var whiteButton: UIButton!
+    
     @IBOutlet weak var darkmodeLabel: UILabel!
     @IBOutlet weak var darkmodeSwitch: UISwitch!
     
@@ -71,7 +73,12 @@ class NCBackgroundImageColor: UIViewController {
         cancelButton.setTitle(NSLocalizedString("_cancel_", comment: ""), for: .normal)
         okButton.setTitle(NSLocalizedString("_ok_", comment: ""), for: .normal)
         
-        defaultButton.layer.cornerRadius = 10
+        whiteButton.layer.cornerRadius = 5
+        whiteButton.layer.borderWidth = 0.5
+        whiteButton.layer.borderColor = NCBrandColor.shared.label.cgColor
+        whiteButton.layer.masksToBounds = true
+
+        defaultButton.layer.cornerRadius = 15
         defaultButton.layer.borderWidth = 0.5
         defaultButton.layer.borderColor = UIColor.gray.cgColor
         defaultButton.layer.masksToBounds = true
@@ -126,6 +133,10 @@ class NCBackgroundImageColor: UIViewController {
     
     // MARK: - Action
     
+    @IBAction func whiteButtonAction(_ sender: UIButton) {
+        
+    }
+    
     @IBAction func darkmodeAction(_ sender: UISwitch) {
                 
         if sender.isOn {
@@ -186,7 +197,8 @@ class NCBackgroundImageColor: UIViewController {
         view.addSubview(colorPicker)
 
         NSLayoutConstraint.activate([
-            colorPicker.centerXAnchor.constraint(equalTo: chromaColorPickerView.centerXAnchor),
+            colorPicker.leadingAnchor.constraint(equalTo: chromaColorPickerView.leadingAnchor, constant: 20),
+            //colorPicker.centerXAnchor.constraint(equalTo: chromaColorPickerView.centerXAnchor),
             colorPicker.topAnchor.constraint(equalTo: chromaColorPickerView.topAnchor),
             colorPicker.widthAnchor.constraint(equalToConstant: defaultColorPickerSize.width),
             colorPicker.heightAnchor.constraint(equalToConstant: defaultColorPickerSize.height)