From fa2d5712b7fcfeb72f2e1227421bbd19178a56ab Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Tue, 10 Mar 2026 11:14:41 +0100 Subject: [PATCH 1/7] cod --- iOSClient/Trash/Cell/NCTrashGridCell.swift | 44 ++++++++++++++++++++-- iOSClient/Trash/Cell/NCTrashListCell.swift | 2 - 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/iOSClient/Trash/Cell/NCTrashGridCell.swift b/iOSClient/Trash/Cell/NCTrashGridCell.swift index 3a83205a6b..6434dbb5f3 100644 --- a/iOSClient/Trash/Cell/NCTrashGridCell.swift +++ b/iOSClient/Trash/Cell/NCTrashGridCell.swift @@ -67,18 +67,56 @@ class NCTrashGridCell: UICollectionViewCell, NCTrashCellProtocol { imageVisualEffect.alpha = 0.5 labelTitle.text = "" - labelExtension?.text = "" - labelExtension?.isHidden = true + labelExtension.text = "" + labelExtension.isHidden = true labelInfo.text = "" labelSubinfo.text = "" - if labelExtension?.isHidden ?? true { + if labelExtension.isHidden { labelTitle.numberOfLines = 2 labelTitle.lineBreakMode = .byWordWrapping } else { labelTitle.numberOfLines = 1 labelTitle.lineBreakMode = .byTruncatingTail } + + // Dynamic Type Font Configuration + // + // These labels use fonts generated by the custom UIFont helpers defined in + // the UIFont extension (e.g. `.callout()`, `.caption1()`). + // + // Those helpers wrap `UIFontMetrics` to provide Dynamic Type scaling while + // applying an upper bound to the maximum font size. This ensures: + // + // - The text respects the user's preferred accessibility size. + // - The UI layout remains stable and does not grow indefinitely. + // + // `adjustsFontForContentSizeCategory` is enabled to allow UIKit to + // automatically update the font when the user changes the Dynamic Type + // setting while the application is running. + // + // Without this flag, the label would keep the initially computed font size + // and would not react to content size category changes. + // + // In summary: + // + // UIFont helper: + // Defines how the font scales and its maximum size. + // + // adjustsFontForContentSizeCategory: + // Enables live updates when accessibility settings change. + // + labelTitle.font = .callout() + labelTitle.adjustsFontForContentSizeCategory = true + + labelExtension.font = .callout() + labelExtension.adjustsFontForContentSizeCategory = true + + labelInfo.font = .caption1() + labelInfo.adjustsFontForContentSizeCategory = true + + labelSubinfo.font = .caption1() + labelSubinfo.adjustsFontForContentSizeCategory = true } override func snapshotView(afterScreenUpdates afterUpdates: Bool) -> UIView? { diff --git a/iOSClient/Trash/Cell/NCTrashListCell.swift b/iOSClient/Trash/Cell/NCTrashListCell.swift index 147fb86c01..d035c9ad00 100644 --- a/iOSClient/Trash/Cell/NCTrashListCell.swift +++ b/iOSClient/Trash/Cell/NCTrashListCell.swift @@ -81,8 +81,6 @@ class NCTrashListCell: UICollectionViewCell, NCTrashCellProtocol { imageItem.layer.cornerRadius = 6 imageItem.layer.masksToBounds = true - // MARK: - Dynamic Type Font Configuration - // // These labels use fonts generated by the custom UIFont helpers defined in // the UIFont extension (e.g. `.callout()`, `.caption1()`). // From 671651cd163b02e8fc106f76ce4ec2a15f131502 Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Tue, 10 Mar 2026 11:25:20 +0100 Subject: [PATCH 2/7] trash --- iOSClient/Trash/Cell/NCTrashGridCell.xib | 37 +++++++++++----------- iOSClient/Trash/Cell/NCTrashListCell.swift | 4 +-- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/iOSClient/Trash/Cell/NCTrashGridCell.xib b/iOSClient/Trash/Cell/NCTrashGridCell.xib index 096572cbbf..e4deeaa4a7 100644 --- a/iOSClient/Trash/Cell/NCTrashGridCell.xib +++ b/iOSClient/Trash/Cell/NCTrashGridCell.xib @@ -1,9 +1,8 @@ - + - - + @@ -39,17 +38,17 @@ - + - - diff --git a/iOSClient/Trash/Cell/NCTrashListCell.swift b/iOSClient/Trash/Cell/NCTrashListCell.swift index d035c9ad00..258ecf0599 100644 --- a/iOSClient/Trash/Cell/NCTrashListCell.swift +++ b/iOSClient/Trash/Cell/NCTrashListCell.swift @@ -73,8 +73,8 @@ class NCTrashListCell: UICollectionViewCell, NCTrashCellProtocol { ] - labelExtension?.text = "" - labelExtension?.isHidden = true + labelExtension.text = "" + labelExtension.isHidden = true imageRestore.image = NCUtility().loadImage(named: "arrow.counterclockwise", colors: [NCBrandColor.shared.iconImageColor]) imageMore.image = NCUtility().loadImage(named: "trash", colors: [.red]) From 916ef12d47c7ca7aaf303e127a4f0fe6b81b3e0e Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Tue, 10 Mar 2026 12:29:29 +0100 Subject: [PATCH 3/7] grid --- .../Collection Common/Cell/NCGridCell.swift | 42 ++++++++++++++++++- .../Collection Common/Cell/NCGridCell.xib | 38 ++++++++--------- 2 files changed, 59 insertions(+), 21 deletions(-) diff --git a/iOSClient/Main/Collection Common/Cell/NCGridCell.swift b/iOSClient/Main/Collection Common/Cell/NCGridCell.swift index 3a7d4bbf9f..549f93fb82 100644 --- a/iOSClient/Main/Collection Common/Cell/NCGridCell.swift +++ b/iOSClient/Main/Collection Common/Cell/NCGridCell.swift @@ -87,11 +87,49 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellMainP imageLocal.image = nil labelTitle.text = "" - labelExtension?.text = "" - labelExtension?.isHidden = true + labelExtension.text = "" + labelExtension.isHidden = true labelInfo.text = "" labelSubinfo.text = "" + // Dynamic Type Font Configuration + // + // These labels use fonts generated by the custom UIFont helpers defined in + // the UIFont extension (e.g. `.callout()`, `.caption1()`). + // + // Those helpers wrap `UIFontMetrics` to provide Dynamic Type scaling while + // applying an upper bound to the maximum font size. This ensures: + // + // - The text respects the user's preferred accessibility size. + // - The UI layout remains stable and does not grow indefinitely. + // + // `adjustsFontForContentSizeCategory` is enabled to allow UIKit to + // automatically update the font when the user changes the Dynamic Type + // setting while the application is running. + // + // Without this flag, the label would keep the initially computed font size + // and would not react to content size category changes. + // + // In summary: + // + // UIFont helper: + // Defines how the font scales and its maximum size. + // + // adjustsFontForContentSizeCategory: + // Enables live updates when accessibility settings change. + // + labelTitle.font = .callout() + labelTitle.adjustsFontForContentSizeCategory = true + + labelExtension.font = .callout() + labelExtension.adjustsFontForContentSizeCategory = true + + labelInfo.font = .caption1() + labelInfo.adjustsFontForContentSizeCategory = true + + labelSubinfo.font = .caption1() + labelSubinfo.adjustsFontForContentSizeCategory = true + imageVisualEffect.layer.cornerRadius = 6 imageVisualEffect.clipsToBounds = true imageVisualEffect.alpha = 0.5 diff --git a/iOSClient/Main/Collection Common/Cell/NCGridCell.xib b/iOSClient/Main/Collection Common/Cell/NCGridCell.xib index a32b9dfb83..bed4152326 100644 --- a/iOSClient/Main/Collection Common/Cell/NCGridCell.xib +++ b/iOSClient/Main/Collection Common/Cell/NCGridCell.xib @@ -1,8 +1,8 @@ - + - + @@ -37,17 +37,17 @@ - + - @@ -55,15 +55,15 @@ -