瀏覽代碼

Improved Widget

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 年之前
父節點
當前提交
5fc157d45a
共有 1 個文件被更改,包括 7 次插入2 次删除
  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) {