浏览代码

coding

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 年之前
父节点
当前提交
b8300f443c
共有 1 个文件被更改,包括 6 次插入11 次删除
  1. 6 11
      Widget/Dashboard/DashboardWidgetView.swift

+ 6 - 11
Widget/Dashboard/DashboardWidgetView.swift

@@ -56,12 +56,7 @@ struct DashboardWidgetView: View {
                 VStack(alignment: .leading) {
                     
                     VStack(spacing: 0) {
-                        
-                        let datasCount = CGFloat(entry.datas.count)
-                        let heightFrame = (geo.size.height - 80) / datasCount
-                        let addSizeIcon = heightFrame / datasCount
-                        let spacing = (addSizeIcon - datasCount) / 2
-                        
+                                                
                         ForEach(entry.datas, id: \.id) { element in
                             
                             Link(destination: element.link) {
@@ -69,16 +64,16 @@ struct DashboardWidgetView: View {
                                 HStack {
                                     
                                     let subTitleColor = Color(white: 0.5)
-                                    let imageSize:CGFloat = 30
+                                    let imageSize:CGFloat = 35
                                     
                                     Image(uiImage: element.icon)
                                         .resizable()
                                         .scaledToFill()
-                                        .frame(width: imageSize+addSizeIcon, height: imageSize+addSizeIcon)
+                                        .frame(width: imageSize, height: imageSize)
                                         .clipped()
                                         .cornerRadius(5)
 
-                                    VStack(alignment: .leading, spacing: spacing) {
+                                    VStack(alignment: .leading, spacing: 2) {
 
                                         Text(element.title)
                                             .font(.system(size: 12))
@@ -91,10 +86,10 @@ struct DashboardWidgetView: View {
                                     Spacer()
                                 }
                                 .padding(.leading, 10)
-                                .frame(height: heightFrame)
+                                .frame(height: 45)
                             }
                             Divider()
-                                .padding(.leading, 48 + addSizeIcon)
+                                .padding(.leading, 54)
                         }
                     }
                 }