mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Make some changes: fixes and stuff
This commit is contained in:
parent
05d41f6bb7
commit
d0448ec2cb
10 changed files with 209 additions and 150 deletions
|
|
@ -34,7 +34,7 @@ struct ContentView: View {
|
|||
@Default(.showNetworkGraph) var showNetworkGraph
|
||||
@Default(.showDiskGraph) var showDiskGraph
|
||||
|
||||
// Dynamic sizing based on view type and graph count with smooth transitions
|
||||
// Dynamic sizing based on view type and graph count with smooth transitions
|
||||
var dynamicNotchSize: CGSize {
|
||||
// Use minimalistic or normal size based on settings
|
||||
let baseSize = Defaults[.enableMinimalisticUI] ? minimalisticOpenNotchSize : openNotchSize
|
||||
|
|
@ -107,6 +107,8 @@ struct ContentView: View {
|
|||
}
|
||||
|
||||
var body: some View {
|
||||
let interactionsEnabled = !lockScreenManager.isLocked
|
||||
|
||||
ZStack(alignment: .top) {
|
||||
let mainLayout = NotchLayout()
|
||||
.frame(alignment: .top)
|
||||
|
|
@ -149,12 +151,12 @@ struct ContentView: View {
|
|||
.animation(notchStateAnimation, value: vm.notchState)
|
||||
.animation(viewTransitionAnimation, value: coordinator.currentView)
|
||||
}
|
||||
.conditionalModifier(Defaults[.openNotchOnHover]) { view in
|
||||
.conditionalModifier(Defaults[.openNotchOnHover] && interactionsEnabled) { view in
|
||||
view.onHover { hovering in
|
||||
handleHover(hovering)
|
||||
}
|
||||
}
|
||||
.conditionalModifier(!Defaults[.openNotchOnHover]) { view in
|
||||
.conditionalModifier(!Defaults[.openNotchOnHover] && interactionsEnabled) { view in
|
||||
view
|
||||
.onHover { hovering in
|
||||
handleSimpleHover(hovering)
|
||||
|
|
@ -165,14 +167,14 @@ struct ContentView: View {
|
|||
}
|
||||
doOpen()
|
||||
}
|
||||
.conditionalModifier(Defaults[.enableGestures]) { view in
|
||||
.conditionalModifier(Defaults[.enableGestures] && interactionsEnabled) { view in
|
||||
view
|
||||
.panGesture(direction: .down) { translation, phase in
|
||||
handleDownGesture(translation: translation, phase: phase)
|
||||
}
|
||||
}
|
||||
}
|
||||
.conditionalModifier(Defaults[.closeGestureEnabled] && Defaults[.enableGestures]) { view in
|
||||
.conditionalModifier(Defaults[.closeGestureEnabled] && Defaults[.enableGestures] && interactionsEnabled) { view in
|
||||
view
|
||||
.panGesture(direction: .up) { translation, phase in
|
||||
handleUpGesture(translation: translation, phase: phase)
|
||||
|
|
@ -417,7 +419,7 @@ struct ContentView: View {
|
|||
} else if coordinator.sneakPeek.show && Defaults[.inlineHUD] && (coordinator.sneakPeek.type != .music) && (coordinator.sneakPeek.type != .battery) {
|
||||
InlineHUD(type: $coordinator.sneakPeek.type, value: $coordinator.sneakPeek.value, icon: $coordinator.sneakPeek.icon, hoverAnimation: $isHovering, gestureProgress: $gestureProgress)
|
||||
.transition(.opacity)
|
||||
} else if (!coordinator.expandingView.show || coordinator.expandingView.type == .music) && vm.notchState == .closed && (musicManager.isPlaying || !musicManager.isPlayerIdle) && coordinator.musicLiveActivityEnabled && !vm.hideOnClosed {
|
||||
} else if (!coordinator.expandingView.show || coordinator.expandingView.type == .music) && vm.notchState == .closed && (musicManager.isPlaying || !musicManager.isPlayerIdle) && coordinator.musicLiveActivityEnabled && !vm.hideOnClosed && !lockScreenManager.isLocked {
|
||||
MusicLiveActivity()
|
||||
} else if (!coordinator.expandingView.show || coordinator.expandingView.type == .timer) && vm.notchState == .closed && timerManager.isTimerActive && coordinator.timerLiveActivityEnabled && !vm.hideOnClosed {
|
||||
TimerLiveActivity()
|
||||
|
|
@ -611,7 +613,9 @@ struct ContentView: View {
|
|||
|
||||
@ViewBuilder
|
||||
var dragDetector: some View {
|
||||
if Defaults[.dynamicShelf] && !Defaults[.enableMinimalisticUI] {
|
||||
if lockScreenManager.isLocked {
|
||||
EmptyView()
|
||||
} else if Defaults[.dynamicShelf] && !Defaults[.enableMinimalisticUI] {
|
||||
Color.clear
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.contentShape(Rectangle())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue