Browse Source

test

Signed-off-by: marinofaggiana <marino.faggiana@nextcloud.com>
marinofaggiana 2 years ago
parent
commit
8bfc5d843e
2 changed files with 14 additions and 12 deletions
  1. 7 8
      DashboardWidget/DashBoardList.swift
  2. 7 4
      DashboardWidget/DashboardWidget.swift

+ 7 - 8
DashboardWidget/DashBoardList.swift

@@ -12,8 +12,8 @@ import WidgetKit
 struct DashBoardList: View {
     var body: some View {
         VStack(alignment: .center) {
-            Text("Dashboard")
-                .font(.largeTitle)
+            Text("Good morning")
+                .font(.title)
                 .bold()
             VStack {
                 ForEach(NCDataDashboardList, id: \.id) { dataElement in
@@ -41,12 +41,11 @@ struct DashboardElement: View {
                     .foregroundColor(.accentColor)
             }
             Spacer()
-        }.padding()
-        .cornerRadius(8)
-        .overlay(
-            RoundedRectangle(cornerRadius: 8)
-                .stroke(Color(.sRGB, red: 150 / 255, green: 150 / 255, blue: 150 / 255, opacity: 0.4), lineWidth: 1)
-        )
+        }.padding(10)
+        //.overlay(
+            //RoundedRectangle(cornerRadius: 8)
+             //   .stroke(Color(.sRGB, red: 150 / 255, green: 150 / 255, blue: 150 / 255, opacity: 0.4), lineWidth: 1)
+        //)
         .shadow(radius: 1)
     }
 }

+ 7 - 4
DashboardWidget/DashboardWidget.swift

@@ -39,13 +39,15 @@ struct SimpleEntry: TimelineEntry {
     let date: Date
 }
 
-struct DashboardWidgetEntryView : View {
+/*
+struct DashboardWidgetEntryView: View {
     var entry: Provider.Entry
 
     var body: some View {
         Text(entry.date, style: .time)
     }
 }
+*/
 
 @main
 struct DashboardWidget: Widget {
@@ -53,7 +55,8 @@ struct DashboardWidget: Widget {
 
     var body: some WidgetConfiguration {
         StaticConfiguration(kind: kind, provider: Provider()) { entry in
-            DashboardWidgetEntryView(entry: entry)
+            //DashboardWidgetEntryView(entry: entry)
+            DashBoardList()
         }
         .configurationDisplayName("My Widget")
         .description("This is an example widget.")
@@ -62,7 +65,7 @@ struct DashboardWidget: Widget {
 
 struct DashboardWidget_Previews: PreviewProvider {
     static var previews: some View {
-        DashboardWidgetEntryView(entry: SimpleEntry(date: Date()))
-            .previewContext(WidgetPreviewContext(family: .systemLarge))
+        DashBoardList()
+            .previewContext(WidgetPreviewContext(family: .systemExtraLarge))
     }
 }