okay works and the resize works for the overlay too yay

undo
saint 2024-05-24 10:36:58 -04:00
parent c069860c43
commit 9eb488a87a
2 changed files with 7 additions and 9 deletions

View File

@ -89,13 +89,12 @@ struct Pane: View {
@State var refresh: Bool = false
@State var vertSep = CGFloat(20)
@Environment(\.appDatabase) private var appDatabase
// var handleVisibilityChanged: (String, VisibilityChange, VisibilityTracker<String>) -> Void
var body: some View {
var adjustedHeight = height - paneConnector.vertSep
ZStack {
ScrollViewReader { proxy in
VisibilityTrackingScrollView(action: handleVisibilityChanged) {
@ -191,7 +190,7 @@ struct Pane: View {
}
.zIndex(1)
.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 {
Rectangle()
@ -199,7 +198,7 @@ struct Pane: View {
.background(.ultraThinMaterial)
.opacity(0.98)
.offset(y: -50)
.frame(width: width, height: height + 100)
.frame(width: width, height: adjustedHeight + 100)
// .blur(radius: 0.8)
// .opacity(1)
@ -211,7 +210,7 @@ struct Pane: View {
.zIndex(2)
}
}
.frame(width: width, height: height)
.frame(width: width, height: adjustedHeight)
}
func handleVisibilityChanged(_: String, change _: VisibilityChange, tracker: VisibilityTracker<String>) {

View File

@ -191,6 +191,7 @@ class PaneConnector: NSObject, ObservableObject {
// var setScrollOffset: CGFloat
var showOverlay: Bool = false
@Published var refresh: Bool = false
@Published var vertSep = CGFloat(20)
var currentId = ""
var currentOffset = CGFloat()
var visibilityTracker: VisibilityTracker<String>?
@ -208,8 +209,6 @@ struct ContentView: View {
@State var refresh: Bool = false
@State var vertSep = CGFloat(20)
@State var endedDrag = true
@State var readOffset = CGPoint()
@ -277,7 +276,7 @@ struct ContentView: View {
segs: segs,
selectedRibbon: selectedRibbon,
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)))
@ -285,7 +284,7 @@ struct ContentView: View {
DragGesture()
.onChanged { gesture in
vertSep = vertSep - gesture.translation.height
paneConnector.vertSep = paneConnector.vertSep - gesture.translation.height
Print(gesture.translation.width)
Print(gesture.translation.height)