Adapt visibility of expiration date field upon toggling checkbox

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-03-07 02:00:41 +08:00
parent 4be8bace48
commit f1adfcf8b7
2 changed files with 7 additions and 0 deletions

View file

@ -139,6 +139,10 @@ class ShareOptionsView: NSView {
passwordSecureField.isHidden = passwordProtectCheckbox.state == .off passwordSecureField.isHidden = passwordProtectCheckbox.state == .off
} }
@IBAction func expirationDateCheckboxAction(_ sender: Any) {
expirationDatePicker.isHidden = expirationDateCheckbox.state == .off
}
@IBAction func save(_ sender: Any) { @IBAction func save(_ sender: Any) {
Task { @MainActor in Task { @MainActor in
let password = passwordProtectCheckbox.state == .on let password = passwordProtectCheckbox.state == .on

View file

@ -315,6 +315,9 @@
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
<connections>
<action selector="expirationDateCheckboxAction:" target="EXb-m8-yzj" id="KHG-U0-rsG"/>
</connections>
</button> </button>
<datePicker verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="46m-5F-ME5"> <datePicker verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="46m-5F-ME5">
<rect key="frame" x="0.0" y="73" width="463" height="28"/> <rect key="frame" x="0.0" y="73" width="463" height="28"/>