Redesign of cardsview seems to have been a success!!
This commit is contained in:
parent
88a78dea92
commit
ece8660a1b
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -4,7 +4,15 @@
|
||||
"Localizable": [
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Card %lld"
|
||||
"key": "No Text In Card"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Add new card"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "%lld %@"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
@ -17,6 +25,14 @@
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Teleprompter"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "OK"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Add some text in the New Card field, then press + again."
|
||||
}
|
||||
]
|
||||
},
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -4,7 +4,15 @@
|
||||
"Localizable": [
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Card %lld"
|
||||
"key": "No Text In Card"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Add new card"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "%lld %@"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
@ -17,6 +25,14 @@
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Teleprompter"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "OK"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Add some text in the New Card field, then press + again."
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -11,9 +11,9 @@ import SwiftUI
|
||||
|
||||
extension CardsView {
|
||||
@_dynamicReplacement(for: deleteItems(offsets:)) private func __preview__deleteItems(offsets: IndexSet) {
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/View/CardsView.swift", line: 68)
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/View/CardsView.swift", line: 82)
|
||||
withAnimation {
|
||||
project.cards.remove(atOffsets: offsets)
|
||||
project.sortedCards.remove(atOffsets: offsets)
|
||||
try! ctx.save()
|
||||
}
|
||||
|
||||
@ -23,10 +23,16 @@ extension CardsView {
|
||||
|
||||
extension CardsView {
|
||||
@_dynamicReplacement(for: addNewCard(txt:)) private func __preview__addNewCard(txt: String) {
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/View/CardsView.swift", line: 62)
|
||||
let card = OCCard(content: txt, index: (project.sortedCards.last?.index ?? __designTimeInteger("#12918.[2].[6].[0].value.arg[1].value.[0]", fallback: -1)) + __designTimeInteger("#12918.[2].[6].[0].value.arg[1].value.[1]", fallback: 1)) // adds one to the index, unless there arent any cards in which case default to 0
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/View/CardsView.swift", line: 70)
|
||||
guard txt != "" else {
|
||||
showNoTextInNewCardError.toggle()
|
||||
return
|
||||
}
|
||||
|
||||
let card = OCCard(content: txt, index: (project.sortedCards.last?.index ?? __designTimeInteger("#12918.[2].[6].[1].value.arg[1].value.[0]", fallback: -1)) + __designTimeInteger("#12918.[2].[6].[1].value.arg[1].value.[1]", fallback: 1)) // adds one to the index, unless there arent any cards in which case default to 0
|
||||
project.cards.append(card)
|
||||
try! ctx.save()
|
||||
newCardText = __designTimeString("#12918.[2].[6].[4].[0]", fallback: "")
|
||||
|
||||
#sourceLocation()
|
||||
}
|
||||
@ -36,44 +42,52 @@ extension CardsView {
|
||||
@_dynamicReplacement(for: body) private var __preview__body: some View {
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/View/CardsView.swift", line: 20)
|
||||
List {
|
||||
ForEach(project.sortedCards) { card in
|
||||
Section {
|
||||
VStack(alignment: .trailing) {
|
||||
Text(card.content)
|
||||
}
|
||||
.frame(minHeight: __designTimeInteger("#12918.[2].[5].property.[0].[0].arg[0].value.[0].arg[1].value.[0].arg[0].value.[0].modifier[0].arg[0].value", fallback: 150))
|
||||
} header: {
|
||||
Text("Card \(card.index + __designTimeInteger("#12918.[2].[5].property.[0].[0].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[0].value.[1].value.arg[0].value.[0]", fallback: 1))")
|
||||
}
|
||||
Section {
|
||||
TextEditor(text: $newCardText)
|
||||
} header: {
|
||||
Text(__designTimeString("#12918.[2].[5].property.[0].[0].arg[0].value.[0].arg[1].value.[0].arg[0].value", fallback: "Add new card"))
|
||||
}
|
||||
.onDelete(perform: deleteItems)
|
||||
Section {
|
||||
ForEach(project.sortedCards) { card in
|
||||
Text(card.content)
|
||||
}
|
||||
.onDelete(perform: deleteItems)
|
||||
} header: {
|
||||
Text("\(project.cards.count) \(project.cards.count == __designTimeInteger("#12918.[2].[5].property.[0].[0].arg[0].value.[1].arg[1].value.[0].arg[0].value.[3].value.arg[0].value.if.[0]", fallback: 1) ? __designTimeString("#12918.[2].[5].property.[0].[0].arg[0].value.[1].arg[1].value.[0].arg[0].value.[3].value.arg[0].value.then", fallback: "Card") : __designTimeString("#12918.[2].[5].property.[0].[0].arg[0].value.[1].arg[1].value.[0].arg[0].value.[3].value.arg[0].value.else", fallback: "Cards"))")
|
||||
}
|
||||
|
||||
}
|
||||
.listStyle(.sidebar)
|
||||
.navigationTitle(project.name)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .topBarTrailing) {
|
||||
Button(action: { addNewCard.toggle() }) {
|
||||
Label(__designTimeString("#12918.[2].[5].property.[0].[0].modifier[3].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "Add Item"), systemImage: __designTimeString("#12918.[2].[5].property.[0].[0].modifier[3].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[1].value", fallback: "plus"))
|
||||
Button(action: { addNewCard(txt: newCardText) }) {
|
||||
Label(__designTimeString("#12918.[2].[5].property.[0].[0].modifier[2].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "Add Item"), systemImage: __designTimeString("#12918.[2].[5].property.[0].[0].modifier[2].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[1].value", fallback: "plus"))
|
||||
}
|
||||
}
|
||||
ToolbarItem(placement: .topBarTrailing) {
|
||||
Menu {
|
||||
NavigationLink(destination: {ProjectSlideshowView(project: project)}) {
|
||||
Label(title: { Text(__designTimeString("#12918.[2].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[0].value.[0].arg[1].value.[0].arg[0].value.[0].arg[0].value", fallback: "Cue Cards"))}, icon: {Image(systemName: __designTimeString("#12918.[2].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "rectangle.stack")) })
|
||||
Label(title: { Text(__designTimeString("#12918.[2].[5].property.[0].[0].modifier[2].arg[0].value.[1].arg[1].value.[0].arg[0].value.[0].arg[1].value.[0].arg[0].value.[0].arg[0].value", fallback: "Cue Cards"))}, icon: {Image(systemName: __designTimeString("#12918.[2].[5].property.[0].[0].modifier[2].arg[0].value.[1].arg[1].value.[0].arg[0].value.[0].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "rectangle.stack")) })
|
||||
}
|
||||
NavigationLink(destination: {TeleprompterView(project: project)}) {
|
||||
Label(title: { Text(__designTimeString("#12918.[2].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[0].value.[1].arg[1].value.[0].arg[0].value.[0].arg[0].value", fallback: "Teleprompter"))}, icon: {Image(systemName: __designTimeString("#12918.[2].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[0].value.[1].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "note.text")) })
|
||||
Label(title: { Text(__designTimeString("#12918.[2].[5].property.[0].[0].modifier[2].arg[0].value.[1].arg[1].value.[0].arg[0].value.[1].arg[1].value.[0].arg[0].value.[0].arg[0].value", fallback: "Teleprompter"))}, icon: {Image(systemName: __designTimeString("#12918.[2].[5].property.[0].[0].modifier[2].arg[0].value.[1].arg[1].value.[0].arg[0].value.[1].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "note.text")) })
|
||||
}
|
||||
} label: {
|
||||
Image(systemName: __designTimeString("#12918.[2].[5].property.[0].[0].modifier[3].arg[0].value.[1].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "play.fill"))
|
||||
Image(systemName: __designTimeString("#12918.[2].[5].property.[0].[0].modifier[2].arg[0].value.[1].arg[1].value.[0].arg[1].value.[0].arg[0].value", fallback: "play.fill"))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $addNewCard) {
|
||||
AddNewCardView(completionHandler: addNewCard)
|
||||
}
|
||||
.alert(__designTimeString("#12918.[2].[5].property.[0].[0].modifier[4].arg[0].value", fallback: "No Text In Card"), isPresented: $showNoTextInNewCardError) {
|
||||
Button(__designTimeString("#12918.[2].[5].property.[0].[0].modifier[4].arg[2].value.[0].arg[0].value", fallback: "OK"), role: .cancel) {}
|
||||
} message: {
|
||||
Text(__designTimeString("#12918.[2].[5].property.[0].[0].modifier[4].arg[3].value.[0].arg[0].value", fallback: "Add some text in the New Card field, then press + again."))
|
||||
}
|
||||
|
||||
|
||||
#sourceLocation()
|
||||
}
|
||||
|
Binary file not shown.
@ -4,7 +4,15 @@
|
||||
"Localizable": [
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Card %lld"
|
||||
"key": "No Text In Card"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Add new card"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "%lld %@"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
@ -17,6 +25,14 @@
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Teleprompter"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "OK"
|
||||
},
|
||||
{
|
||||
"comment": "",
|
||||
"key": "Add some text in the New Card field, then press + again."
|
||||
}
|
||||
]
|
||||
},
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -11,7 +11,7 @@ import SwiftData
|
||||
|
||||
extension OCProject {
|
||||
@_dynamicReplacement(for: addCards(cards:)) private func __preview__addCards(cards: OCCard...) {
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/Model/OCProject.swift", line: 42)
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/Model/OCProject.swift", line: 47)
|
||||
cards.forEach({ self.cards.append($0) })
|
||||
|
||||
#sourceLocation()
|
||||
@ -20,7 +20,7 @@ extension OCProject {
|
||||
|
||||
extension OCProject {
|
||||
@_dynamicReplacement(for: updateEditedDate(newDate:)) private func __preview__updateEditedDate(newDate: Date = Date()) {
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/Model/OCProject.swift", line: 38)
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/Model/OCProject.swift", line: 43)
|
||||
self.lastEditedDate = newDate
|
||||
|
||||
#sourceLocation()
|
||||
@ -29,17 +29,27 @@ extension OCProject {
|
||||
|
||||
extension OCProject {
|
||||
@_dynamicReplacement(for: sortedCards) private var __preview__sortedCards: [OCCard] {
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/Model/OCProject.swift", line: 26)
|
||||
return self.cards.sorted(by: { $0.index < $1.index })
|
||||
|
||||
get {
|
||||
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/Model/OCProject.swift", line: 27)
|
||||
return self.cards.sorted(by: { $0.index < $1.index })
|
||||
|
||||
#sourceLocation()
|
||||
}
|
||||
set {
|
||||
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/Model/OCProject.swift", line: 30)
|
||||
|
||||
#sourceLocation()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension OCProject {
|
||||
@_dynamicReplacement(for: script) private var __preview__script: String {
|
||||
#sourceLocation(file: "/Users/pradyun/Code/Apps/OnCue/OnCue/Model/OCProject.swift", line: 20)
|
||||
var txt = __designTimeString("#7544.[2].[5].property.[0].[0].value", fallback: "")
|
||||
var txt = __designTimeString("#34169.[2].[5].property.[0].[0].value", fallback: "")
|
||||
sortedCards.forEach { txt.append("\($0.content)\n---\n") }
|
||||
return txt
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user