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