Browse Source

Fix H separator menu

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 3 years ago
parent
commit
54dcf14272
2 changed files with 4 additions and 3 deletions
  1. 1 1
      iOSClient/Menu/NCMenu.swift
  2. 3 2
      iOSClient/Menu/NCMenuAction.swift

+ 1 - 1
iOSClient/Menu/NCMenu.swift

@@ -105,7 +105,7 @@ class NCMenu: UITableViewController {
     // MARK: - Tabel View Layout
     // MARK: - Tabel View Layout
 
 
     override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
     override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        actions[indexPath.row].title == NCMenuAction.seperatorIdentifier ? 3 : UITableView.automaticDimension
+        actions[indexPath.row].title == NCMenuAction.seperatorIdentifier ? NCMenuAction.seperatorHeight : UITableView.automaticDimension
     }
     }
 }
 }
 extension NCMenu: FloatingPanelControllerDelegate {
 extension NCMenu: FloatingPanelControllerDelegate {

+ 3 - 2
iOSClient/Menu/NCMenuAction.swift

@@ -19,7 +19,7 @@ class NCMenuAction {
     var selected: Bool = false
     var selected: Bool = false
     var isOn: Bool = false
     var isOn: Bool = false
     var action: ((_ menuAction: NCMenuAction) -> Void)?
     var action: ((_ menuAction: NCMenuAction) -> Void)?
-    var rowHeight: CGFloat { self.title == NCMenuAction.seperatorIdentifier ? 3 : self.details != nil ? 80 : 60 }
+    var rowHeight: CGFloat { self.title == NCMenuAction.seperatorIdentifier ? NCMenuAction.seperatorHeight : self.details != nil ? 80 : 60 }
 
 
     init(title: String, details: String? = nil, icon: UIImage, action: ((_ menuAction: NCMenuAction) -> Void)?) {
     init(title: String, details: String? = nil, icon: UIImage, action: ((_ menuAction: NCMenuAction) -> Void)?) {
         self.title = title
         self.title = title
@@ -45,7 +45,8 @@ class NCMenuAction {
 // MARK: - Actions
 // MARK: - Actions
 
 
 extension NCMenuAction {
 extension NCMenuAction {
-    static let seperatorIdentifier = "NCMenuAction.SEPERATOR"
+    static let seperatorIdentifier = "NCMenuAction.SEPARATOR"
+    static let seperatorHeight: CGFloat = 0.5
 
 
     /// A static seperator, with no actions, text, or icons
     /// A static seperator, with no actions, text, or icons
     static var seperator: NCMenuAction {
     static var seperator: NCMenuAction {