|
@@ -73,49 +73,53 @@ struct NextcloudWidgetView: View {
|
|
|
|
|
|
HStack(spacing: 0) {
|
|
|
|
|
|
- Image("buttonAddImage")
|
|
|
- .resizable()
|
|
|
- .renderingMode(.template)
|
|
|
- .foregroundColor(Color(NCBrandColor.shared.brandText))
|
|
|
- .padding(10)
|
|
|
- .background(Color(NCBrandColor.shared.brand))
|
|
|
- .clipShape(Circle())
|
|
|
- .scaledToFit()
|
|
|
- .frame(width: geo.size.width/4, height: 50)
|
|
|
- .widgetURL(URL(string: "nextcloud://open-action?action=upload-asset")!)
|
|
|
+ Link(destination: URL(string: "nextcloud://open-action?action=upload-asset")!, label: {
|
|
|
+ Image("buttonAddImage")
|
|
|
+ .resizable()
|
|
|
+ .renderingMode(.template)
|
|
|
+ .foregroundColor(Color(NCBrandColor.shared.brandText))
|
|
|
+ .padding(10)
|
|
|
+ .background(Color(NCBrandColor.shared.brand))
|
|
|
+ .clipShape(Circle())
|
|
|
+ .scaledToFit()
|
|
|
+ .frame(width: geo.size.width/4, height: 50)
|
|
|
+ })
|
|
|
|
|
|
- Image("buttonAddScan")
|
|
|
- .resizable()
|
|
|
- .renderingMode(.template)
|
|
|
- .foregroundColor(Color(NCBrandColor.shared.brandText))
|
|
|
- .padding(10)
|
|
|
- .background(Color(NCBrandColor.shared.brand))
|
|
|
- .clipShape(Circle())
|
|
|
- .scaledToFit()
|
|
|
- .frame(width: geo.size.width/4, height: 50)
|
|
|
- .widgetURL(URL(string: "nextcloud://open-action?action=add-scan-document")!)
|
|
|
+ Link(destination: URL(string: "nextcloud://open-action?action=add-scan-document")!, label: {
|
|
|
+ Image("buttonAddScan")
|
|
|
+ .resizable()
|
|
|
+ .renderingMode(.template)
|
|
|
+ .foregroundColor(Color(NCBrandColor.shared.brandText))
|
|
|
+ .padding(10)
|
|
|
+ .background(Color(NCBrandColor.shared.brand))
|
|
|
+ .clipShape(Circle())
|
|
|
+ .scaledToFit()
|
|
|
+ .frame(width: geo.size.width/4, height: 50)
|
|
|
+ })
|
|
|
|
|
|
- Image("note.text")
|
|
|
- .resizable()
|
|
|
- .renderingMode(.template)
|
|
|
- .foregroundColor(Color(NCBrandColor.shared.brandText))
|
|
|
- .padding(10)
|
|
|
- .background(Color(NCBrandColor.shared.brand))
|
|
|
- .clipShape(Circle())
|
|
|
- .scaledToFit()
|
|
|
- .frame(width: geo.size.width/4, height: 50)
|
|
|
- .widgetURL(URL(string: "nextcloud://open-action?action=create-text-document")!)
|
|
|
+ Link(destination: URL(string: "nextcloud://open-action?action=create-text-document")!, label: {
|
|
|
+ Image("note.text")
|
|
|
+ .resizable()
|
|
|
+ .renderingMode(.template)
|
|
|
+ .foregroundColor(Color(NCBrandColor.shared.brandText))
|
|
|
+ .padding(10)
|
|
|
+ .background(Color(NCBrandColor.shared.brand))
|
|
|
+ .clipShape(Circle())
|
|
|
+ .scaledToFit()
|
|
|
+ .frame(width: geo.size.width/4, height: 50)
|
|
|
+ })
|
|
|
|
|
|
- Image("microphone")
|
|
|
- .resizable()
|
|
|
- .renderingMode(.template)
|
|
|
- .foregroundColor(Color(NCBrandColor.shared.brandText))
|
|
|
- .padding(10)
|
|
|
- .background(Color(NCBrandColor.shared.brand))
|
|
|
- .clipShape(Circle())
|
|
|
- .scaledToFit()
|
|
|
- .frame(width: geo.size.width/4, height: 50)
|
|
|
- .widgetURL(URL(string: "nextcloud://open-action?action=create-voice-memo")!)
|
|
|
+ Link(destination: URL(string: "nextcloud://open-action?action=create-voice-memo")!, label: {
|
|
|
+ Image("microphone")
|
|
|
+ .resizable()
|
|
|
+ .renderingMode(.template)
|
|
|
+ .foregroundColor(Color(NCBrandColor.shared.brandText))
|
|
|
+ .padding(10)
|
|
|
+ .background(Color(NCBrandColor.shared.brand))
|
|
|
+ .clipShape(Circle())
|
|
|
+ .scaledToFit()
|
|
|
+ .frame(width: geo.size.width/4, height: 50)
|
|
|
+ })
|
|
|
}
|
|
|
.frame(width: geo.size.width, height: geo.size.height-40, alignment: .bottomTrailing)
|
|
|
.redacted(reason: entry.isPlaceholder ? .placeholder : [])
|
|
@@ -139,7 +143,7 @@ struct NextcloudWidgetView: View {
|
|
|
|
|
|
struct NextcloudWidget_Previews: PreviewProvider {
|
|
|
static var previews: some View {
|
|
|
- let entry = NextcloudDataEntry(date: Date(), recentDatas: recentDatasTest, isPlaceholder: true, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " widget")
|
|
|
+ let entry = NextcloudDataEntry(date: Date(), recentDatas: recentDatasTest, isPlaceholder: false, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " widget")
|
|
|
NextcloudWidgetView(entry: entry).previewContext(WidgetPreviewContext(family: .systemLarge))
|
|
|
}
|
|
|
}
|