builds again
parent
82fec8363e
commit
a9b85c90d1
|
@ -46,6 +46,7 @@ func goToRibbon(selectedRibbon: Ribbon,
|
||||||
refresh: Binding<Bool>,
|
refresh: Binding<Bool>,
|
||||||
showOverlay: Binding<Bool>,
|
showOverlay: Binding<Bool>,
|
||||||
appDatabase: AppDatabase,
|
appDatabase: AppDatabase,
|
||||||
|
paneConnector: Binding<PaneConnector?>,
|
||||||
loading: Bool)
|
loading: Bool)
|
||||||
{
|
{
|
||||||
Task {
|
Task {
|
||||||
|
@ -119,6 +120,7 @@ struct RibbonCrown: View {
|
||||||
@Binding var scrollOffset: CGFloat?
|
@Binding var scrollOffset: CGFloat?
|
||||||
@Binding var showOverlay: Bool
|
@Binding var showOverlay: Bool
|
||||||
@Binding var refresh: Bool
|
@Binding var refresh: Bool
|
||||||
|
@Binding var paneConnector: PaneConnector?
|
||||||
var draggedRibbon: Ribbon?
|
var draggedRibbon: Ribbon?
|
||||||
var isDragging: Bool
|
var isDragging: Bool
|
||||||
|
|
||||||
|
@ -164,6 +166,7 @@ struct RibbonCrown: View {
|
||||||
refresh: $refresh,
|
refresh: $refresh,
|
||||||
showOverlay: $showOverlay,
|
showOverlay: $showOverlay,
|
||||||
appDatabase: appDatabase,
|
appDatabase: appDatabase,
|
||||||
|
paneConnector: $paneConnector,
|
||||||
loading: false)
|
loading: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,36 +198,44 @@ func makeVerseView(seg: SegDenorm) -> some View {
|
||||||
return retView
|
return retView
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class PaneConnector : NSObject {
|
||||||
|
var scrollId: String
|
||||||
|
var scrollOffset: CGFloat
|
||||||
|
var setScrollOffset: CGFloat
|
||||||
|
var showOverlay: Bool = false
|
||||||
|
var refresh: Bool = false
|
||||||
|
}
|
||||||
|
|
||||||
struct ContentView: View {
|
struct ContentView: View {
|
||||||
// this is for the whole view swiping
|
// this is for the whole view swiping
|
||||||
@State var viewState = CGSize.zero
|
@State var viewState = CGSize.zero
|
||||||
@State var pulledOut = CGSize.zero
|
@State var pulledOut = CGSize.zero
|
||||||
|
|
||||||
|
|
||||||
|
@State var paneConnector: PaneConnector?
|
||||||
|
|
||||||
// scroll location of the main fenestra
|
// scroll location of the main fenestra
|
||||||
@State var scrollId: String?
|
@State var scrollId: String?
|
||||||
@State var scrollOffset: CGFloat?
|
@State var scrollOffset: CGFloat?
|
||||||
|
|
||||||
@State var setScrollOffset: CGFloat?
|
@State var setScrollOffset: CGFloat?
|
||||||
@State var showOverlay: Bool = false
|
@State var showOverlay: Bool = false
|
||||||
|
@State var refresh: Bool = false
|
||||||
|
|
||||||
@State var vertSep = CGFloat(20)
|
@State var vertSep = CGFloat(20)
|
||||||
|
|
||||||
@Environment(\.appDatabase) private var appDatabase
|
|
||||||
@Query(SegDenormRequest(book: "bible.mark")) private var segs: [SegDenorm]
|
|
||||||
|
|
||||||
@State var endedDrag = true
|
@State var endedDrag = true
|
||||||
|
|
||||||
@State var readOffset = CGPoint()
|
@State var readOffset = CGPoint()
|
||||||
@State var dragOffset = CGFloat()
|
@State var dragOffset = CGFloat()
|
||||||
|
|
||||||
@State var refresh: Bool = false
|
|
||||||
@State var refresh2: Bool = false
|
@State var refresh2: Bool = false
|
||||||
|
|
||||||
@State var draggedRibbon: Ribbon?
|
@State var draggedRibbon: Ribbon?
|
||||||
@State var isDragging = false
|
@State var isDragging = false
|
||||||
|
|
||||||
@State var reorder = true
|
@Environment(\.appDatabase) private var appDatabase
|
||||||
|
@Query(SegDenormRequest(book: "bible.mark")) private var segs: [SegDenorm]
|
||||||
@Query(RibbonRequest()) private var ribbons: [Ribbon]
|
@Query(RibbonRequest()) private var ribbons: [Ribbon]
|
||||||
@Query<SelectedRibbonRequest> var selectedRibbon: [Ribbon]
|
@Query<SelectedRibbonRequest> var selectedRibbon: [Ribbon]
|
||||||
|
|
||||||
|
@ -251,6 +262,7 @@ struct ContentView: View {
|
||||||
scrollOffset: $scrollOffset,
|
scrollOffset: $scrollOffset,
|
||||||
showOverlay: $showOverlay,
|
showOverlay: $showOverlay,
|
||||||
refresh: $refresh,
|
refresh: $refresh,
|
||||||
|
paneConnector: $paneConnector,
|
||||||
draggedRibbon: draggedRibbon,
|
draggedRibbon: draggedRibbon,
|
||||||
isDragging: isDragging)
|
isDragging: isDragging)
|
||||||
.onDrag {
|
.onDrag {
|
||||||
|
@ -309,6 +321,7 @@ struct ContentView: View {
|
||||||
refresh: $refresh,
|
refresh: $refresh,
|
||||||
showOverlay: $showOverlay,
|
showOverlay: $showOverlay,
|
||||||
appDatabase: appDatabase,
|
appDatabase: appDatabase,
|
||||||
|
paneConnector: $paneConnector,
|
||||||
loading: true)
|
loading: true)
|
||||||
}
|
}
|
||||||
.onChange(of: refresh) { _ in
|
.onChange(of: refresh) { _ in
|
||||||
|
@ -440,7 +453,9 @@ struct ContentView: View {
|
||||||
|
|
||||||
if endedDrag {
|
if endedDrag {
|
||||||
endedDrag = false
|
endedDrag = false
|
||||||
scrollOffset = readOffset.y - 20
|
|
||||||
|
//TODO: should this still be adjusted
|
||||||
|
//scrollOffset = readOffset.y - 20
|
||||||
}
|
}
|
||||||
Print(viewState.width)
|
Print(viewState.width)
|
||||||
if abs(gesture.translation.width) > 20 {
|
if abs(gesture.translation.width) > 20 {
|
||||||
|
|
Loading…
Reference in New Issue