diff --git a/Loop/Managers/KeybindMonitor.swift b/Loop/Managers/KeybindMonitor.swift index ffe6e530..fe6c0eee 100644 --- a/Loop/Managers/KeybindMonitor.swift +++ b/Loop/Managers/KeybindMonitor.swift @@ -25,7 +25,7 @@ class KeybindMonitor { // This is used when the user is pressing 2+ keys so that it doesn't switch back // to the one key direction when they're letting go of the keys. if event.type == .keyUp || - (event.type == .flagsChanged && + (event.type == .flagsChanged && !event.modifierFlags.intersection(.deviceIndependentFlagsMask).contains(.shift)) { if (abs(lastKeyReleaseTime.timeIntervalSinceNow)) > 0.1 { return diff --git a/Loop/Preview Window/PreviewView.swift b/Loop/Preview Window/PreviewView.swift index 5b7f0538..b0cb8811 100644 --- a/Loop/Preview Window/PreviewView.swift +++ b/Loop/Preview Window/PreviewView.swift @@ -10,16 +10,13 @@ import Defaults struct PreviewView: View { - // Used to preview inside the app's settings - @State var previewMode = false - @State var currentResizeDirection: WindowDirection = .noAction private let window: Window? - private var sidePadding: CGFloat = 0 + private let previewMode: Bool init(previewMode: Bool = false, window: Window?) { self.window = window - self.sidePadding = previewPadding + previewBorderThickness / 2 + self.previewMode = previewMode } @Default(.useSystemAccentColor) var useSystemAccentColor @@ -87,12 +84,11 @@ struct PreviewView: View { lineWidth: previewBorderThickness ) } - .padding(sidePadding) + .padding(previewPadding + previewBorderThickness / 2) .frame(width: currentResizeDirection == .noAction ? 0 : nil, height: currentResizeDirection == .noAction ? 0 : nil) - .frame(width: currentResizeDirection == .center ? (window?.size.width ?? 10) - sidePadding : nil, - height: currentResizeDirection == .center ? (window?.size.height ?? 10) - sidePadding : nil) - +// .frame(width: currentResizeDirection == .center ? (window?.size.width ?? 10) - sidePadding : nil, +// height: currentResizeDirection == .center ? (window?.size.height ?? 10) - sidePadding : nil) .frame(width: currentResizeDirection == .lastDirection ? 0 : nil, height: currentResizeDirection == .lastDirection ? 0 : nil) .frame(width: currentResizeDirection == .topTwoThirds ? geo.size.height / 3 * 2 : nil) @@ -138,16 +134,15 @@ struct PreviewView: View { .opacity(currentResizeDirection == .noAction ? 0 : 1) .animation(.interpolatingSpring(stiffness: 250, damping: 25), value: currentResizeDirection) .onReceive(.directionChanged) { obj in - if !previewMode { + if !self.previewMode { if let direction = obj.userInfo?["direction"] as? WindowDirection { currentResizeDirection = direction } } } - .onAppear { - if previewMode { - currentResizeDirection = .maximize + if self.previewMode { + self.currentResizeDirection = .maximize } } }