Adapt visibility of password field upon toggling password checkbox
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 6 Mar 2024 17:30:57 +0000 (01:30 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 17 Apr 2024 08:38:59 +0000 (16:38 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareOptionsView.swift
shell_integration/MacOSX/NextcloudIntegration/FileProviderUIExt/ShareViewController.xib

index 22c3a4696ca19503cf20735baebd4fbd1604515f..914f50ee23f549714a2355dbe6fdca3f43855774 100644 (file)
@@ -10,6 +10,8 @@ import Combine
 import NextcloudKit
 import OSLog
 
+// TODO: Handle shareWith!
+// TODO: Handle visibility of textfields on relevant checkbox toggle
 class ShareOptionsView: NSView {
     @IBOutlet private weak var optionsTitleTextField: NSTextField!
     @IBOutlet private weak var shareRecipientTextField: NSTextField!  // Hide if public link share
@@ -133,6 +135,10 @@ class ShareOptionsView: NSView {
         deleteButton.isEnabled = enabled
     }
 
+    @IBAction func passwordCheckboxAction(_ sender: Any) {
+        passwordSecureField.isHidden = passwordProtectCheckbox.state == .off
+    }
+
     @IBAction func save(_ sender: Any) {
         Task { @MainActor in
             let password = passwordProtectCheckbox.state == .on
index 29d73d925cfda9a3546629fdff8ace227cb8da5b..5d02b3704cd181aa605d01d4cf047308d9a5ec25 100644 (file)
                                                 <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                                                 <font key="font" metaFont="system"/>
                                             </buttonCell>
+                                            <connections>
+                                                <action selector="passwordCheckboxAction:" target="EXb-m8-yzj" id="QMn-RM-jdf"/>
+                                            </connections>
                                         </button>
                                         <secureTextField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="pkv-9L-nhv">
                                             <rect key="frame" x="0.0" y="123" width="460" height="22"/>