marinofaggiana 3 жил өмнө
parent
commit
e954018290

+ 3 - 2
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -44,6 +44,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     internal var metadataTouch: tableMetadata?
     internal var dataSource = NCDataSource()
     internal var richWorkspaceText: String?
+    internal var header: UIView?
         
     internal var layoutForView: NCGlobal.layoutForViewType?
 
@@ -1283,6 +1284,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
         if kind == UICollectionView.elementKindSectionHeader {
                         
             let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeaderMenu", for: indexPath) as! NCSectionHeaderMenu
+            self.header = header
             
             if collectionView.collectionViewLayout == gridLayout {
                 header.buttonSwitch.setImage(UIImage.init(named: "switchList")!.image(color: NCBrandColor.shared.gray, size: 50), for: .normal)
@@ -1295,8 +1297,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             header.setTitleSorted(datasourceTitleButton: layoutForView?.titleButtonHeader ?? "")
             header.viewRichWorkspaceHeightConstraint.constant = headerRichWorkspaceHeight
             header.setRichWorkspaceText(richWorkspaceText: richWorkspaceText)
-            header.colorBackground = collectionView.backgroundColor
-            
+           
             return header
             
         } else {

+ 8 - 15
iOSClient/Main/Section Header Footer/NCSectionHeaderFooter.swift

@@ -37,8 +37,7 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
     @IBOutlet weak var separatorHeightConstraint: NSLayoutConstraint!
     
     var delegate: NCSectionHeaderMenuDelegate?
-    var colorBackground: UIColor?
-    
+
     private var markdownParser = MarkdownParser()
     private var richWorkspaceText: String?
     private var textViewColor: UIColor?
@@ -47,8 +46,8 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
     override func awakeFromNib() {
         super.awakeFromNib()
         
-        backgroundColor = colorBackground
-
+        backgroundColor = .clear
+        
         buttonSwitch.setImage(UIImage.init(named: "switchList")!.image(color: NCBrandColor.shared.gray, size: 25), for: .normal)
         
         buttonOrder.setTitle("", for: .normal)
@@ -56,7 +55,7 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
         buttonMore.setImage(UIImage.init(named: "more")!.image(color:  NCBrandColor.shared.gray, size: 25), for: .normal)
                 
         // Gradient
-        gradient.startPoint = CGPoint(x: 0, y: 0.60)
+        gradient.startPoint = CGPoint(x: 0, y: 0.50)
         gradient.endPoint = CGPoint(x: 0, y: 1)
         viewRichWorkspace.layer.addSublayer(gradient)
         setGradientColor()
@@ -87,19 +86,13 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
     }
     
     func setGradientColor() {
-        
-        var colorStart: UIColor = .black
-        var colorEnd: UIColor = .white
-        
+       /*
         if traitCollection.userInterfaceStyle == .dark {
-            colorStart = UIColor.init(white: 0, alpha: 0)
-            colorEnd = UIColor.black
+            gradient.colors = [UIColor.init(white: 0, alpha: 0).cgColor, UIColor.black.cgColor]
         } else {
-            colorStart = UIColor.init(white: 1, alpha: 0)
-            colorEnd = UIColor.white
+            gradient.colors = [UIColor.init(white: 1, alpha: 0).cgColor, UIColor.white.cgColor]
         }
-        
-        gradient.colors = [colorStart.cgColor, colorEnd.cgColor]
+        */
     }
     
     func setTitleSorted(datasourceTitleButton: String) {