okay works and the resize works for the overlay too yay
parent
c069860c43
commit
9eb488a87a
|
@ -89,13 +89,12 @@ struct Pane: View {
|
||||||
|
|
||||||
@State var refresh: Bool = false
|
@State var refresh: Bool = false
|
||||||
|
|
||||||
@State var vertSep = CGFloat(20)
|
|
||||||
|
|
||||||
@Environment(\.appDatabase) private var appDatabase
|
@Environment(\.appDatabase) private var appDatabase
|
||||||
|
|
||||||
// var handleVisibilityChanged: (String, VisibilityChange, VisibilityTracker<String>) -> Void
|
// var handleVisibilityChanged: (String, VisibilityChange, VisibilityTracker<String>) -> Void
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
var adjustedHeight = height - paneConnector.vertSep
|
||||||
ZStack {
|
ZStack {
|
||||||
ScrollViewReader { proxy in
|
ScrollViewReader { proxy in
|
||||||
VisibilityTrackingScrollView(action: handleVisibilityChanged) {
|
VisibilityTrackingScrollView(action: handleVisibilityChanged) {
|
||||||
|
@ -191,7 +190,7 @@ struct Pane: View {
|
||||||
}
|
}
|
||||||
.zIndex(1)
|
.zIndex(1)
|
||||||
.background(Color(red: 0.2, green: 0.2, blue: 0.2))
|
.background(Color(red: 0.2, green: 0.2, blue: 0.2))
|
||||||
.frame(width: width, height: height)
|
.frame(width: width, height: adjustedHeight)
|
||||||
|
|
||||||
if self.paneConnector.showOverlay {
|
if self.paneConnector.showOverlay {
|
||||||
Rectangle()
|
Rectangle()
|
||||||
|
@ -199,7 +198,7 @@ struct Pane: View {
|
||||||
.background(.ultraThinMaterial)
|
.background(.ultraThinMaterial)
|
||||||
.opacity(0.98)
|
.opacity(0.98)
|
||||||
.offset(y: -50)
|
.offset(y: -50)
|
||||||
.frame(width: width, height: height + 100)
|
.frame(width: width, height: adjustedHeight + 100)
|
||||||
|
|
||||||
// .blur(radius: 0.8)
|
// .blur(radius: 0.8)
|
||||||
// .opacity(1)
|
// .opacity(1)
|
||||||
|
@ -211,7 +210,7 @@ struct Pane: View {
|
||||||
.zIndex(2)
|
.zIndex(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(width: width, height: height)
|
.frame(width: width, height: adjustedHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleVisibilityChanged(_: String, change _: VisibilityChange, tracker: VisibilityTracker<String>) {
|
func handleVisibilityChanged(_: String, change _: VisibilityChange, tracker: VisibilityTracker<String>) {
|
||||||
|
|
|
@ -191,6 +191,7 @@ class PaneConnector: NSObject, ObservableObject {
|
||||||
// var setScrollOffset: CGFloat
|
// var setScrollOffset: CGFloat
|
||||||
var showOverlay: Bool = false
|
var showOverlay: Bool = false
|
||||||
@Published var refresh: Bool = false
|
@Published var refresh: Bool = false
|
||||||
|
@Published var vertSep = CGFloat(20)
|
||||||
var currentId = ""
|
var currentId = ""
|
||||||
var currentOffset = CGFloat()
|
var currentOffset = CGFloat()
|
||||||
var visibilityTracker: VisibilityTracker<String>?
|
var visibilityTracker: VisibilityTracker<String>?
|
||||||
|
@ -208,8 +209,6 @@ struct ContentView: View {
|
||||||
|
|
||||||
@State var refresh: Bool = false
|
@State var refresh: Bool = false
|
||||||
|
|
||||||
@State var vertSep = CGFloat(20)
|
|
||||||
|
|
||||||
@State var endedDrag = true
|
@State var endedDrag = true
|
||||||
|
|
||||||
@State var readOffset = CGPoint()
|
@State var readOffset = CGPoint()
|
||||||
|
@ -277,7 +276,7 @@ struct ContentView: View {
|
||||||
segs: segs,
|
segs: segs,
|
||||||
selectedRibbon: selectedRibbon,
|
selectedRibbon: selectedRibbon,
|
||||||
width: geometry.size.width - 50,
|
width: geometry.size.width - 50,
|
||||||
height: geometry.size.height / 2 - vertSep)
|
height: geometry.size.height / 2)
|
||||||
//////
|
//////
|
||||||
|
|
||||||
Text("separator").foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
|
Text("separator").foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
|
||||||
|
@ -285,7 +284,7 @@ struct ContentView: View {
|
||||||
DragGesture()
|
DragGesture()
|
||||||
.onChanged { gesture in
|
.onChanged { gesture in
|
||||||
|
|
||||||
vertSep = vertSep - gesture.translation.height
|
paneConnector.vertSep = paneConnector.vertSep - gesture.translation.height
|
||||||
Print(gesture.translation.width)
|
Print(gesture.translation.width)
|
||||||
Print(gesture.translation.height)
|
Print(gesture.translation.height)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue