Explorar o código

Improved Widget

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana %!s(int64=2) %!d(string=hai) anos
pai
achega
5fc157d45a
Modificáronse 1 ficheiros con 7 adicións e 2 borrados
  1. 7 2
      Widget/Dashboard/DashboardData.swift

+ 7 - 2
Widget/Dashboard/DashboardData.swift

@@ -67,8 +67,13 @@ let dashboardDatasTest: [DashboardData] = [
 
 func getDashboardItems(displaySize: CGSize, withButton: Bool) -> Int {
     
-    let height = Int((displaySize.height - 55) / 50)
-    return withButton ? (height - 1) : height
+    if withButton {
+        let height = Int((displaySize.height - 75) / 50)
+        return height
+    } else {
+        let height = Int((displaySize.height - 55) / 50)
+        return height
+    }
 }
 
 func getDashboardDataEntry(intent: Applications, isPreview: Bool, displaySize: CGSize, completion: @escaping (_ entry: DashboardDataEntry) -> Void) {