Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Core/Sources/SuggestionWidget/ChatPanelWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ final class ChatPanelWindow: WidgetWindow {
}())
titlebarAppearsTransparent = true
isReleasedWhenClosed = false
isOpaque = false
backgroundColor = .clear
level = widgetLevel(1)

hasShadow = true
contentView = NSHostingView(
rootView: ChatWindowView(
Expand Down
19 changes: 11 additions & 8 deletions Core/Sources/SuggestionWidget/WidgetWindowsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,6 @@ extension WidgetWindowsController {
)

if let suggestionPanelLocation = widgetLocation.suggestionPanelLocation {
print(suggestionPanelLocation)
windows.suggestionPanelWindow.setFrame(
suggestionPanelLocation.frame,
display: false,
Expand Down Expand Up @@ -705,7 +704,7 @@ public final class WidgetWindows {
defer: false
)
it.isReleasedWhenClosed = false
it.isOpaque = false
it.isOpaque = true
it.backgroundColor = .clear
it.collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary, .transient]
it.hasShadow = false
Expand All @@ -723,10 +722,10 @@ public final class WidgetWindows {
defer: false
)
it.isReleasedWhenClosed = false
it.isOpaque = false
it.isOpaque = true
it.backgroundColor = .clear
it.level = widgetLevel(0)
it.hasShadow = true
it.hasShadow = false
it.contentView = NSHostingView(
rootView: WidgetView(
store: store.scope(
Expand All @@ -749,11 +748,11 @@ public final class WidgetWindows {
defer: false
)
it.isReleasedWhenClosed = false
it.isOpaque = false
it.isOpaque = true
it.backgroundColor = .clear
it.level = widgetLevel(2)
it.hoveringLevel = widgetLevel(2)
it.hasShadow = true
it.hasShadow = false
it.contentView = NSHostingView(
rootView: SharedPanelView(
store: store.scope(
Expand Down Expand Up @@ -783,10 +782,12 @@ public final class WidgetWindows {
defer: false
)
it.isReleasedWhenClosed = false
it.isOpaque = false
it.isOpaque = true
it.backgroundColor = .clear
it.level = widgetLevel(2)
it.hasShadow = true
it.hasShadow = false
it.menu = nil
it.animationBehavior = .utilityWindow
it.contentView = NSHostingView(
rootView: SuggestionPanelView(
store: store.scope(
Expand Down Expand Up @@ -881,6 +882,8 @@ class WidgetWindow: CanBecomeKeyWindow {
}

var hoveringLevel: NSWindow.Level = widgetLevel(0)

override var isFloatingPanel: Bool { true }

var defaultCollectionBehavior: NSWindow.CollectionBehavior {
[.fullScreenAuxiliary, .transient]
Expand Down
20 changes: 10 additions & 10 deletions OverlayWindow/Sources/OverlayWindow/OverlayPanel.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AppKit
import Logger
import Perception
import SwiftUI
import Logger

struct OverlayFrameEnvironmentKey: EnvironmentKey {
static let defaultValue: CGRect = .zero
Expand All @@ -24,7 +24,7 @@ public extension EnvironmentValues {
}

@MainActor
final class OverlayPanel: NSPanel {
public final class OverlayPanel: NSPanel {
@MainActor
@Perceptible
final class PanelState {
Expand All @@ -35,7 +35,7 @@ final class OverlayPanel: NSPanel {
let panelState: PanelState = .init()
private var _canBecomeKey = true

init<Content: View>(
public init<Content: View>(
contentRect: NSRect,
@ViewBuilder content: @escaping () -> Content
) {
Expand All @@ -52,9 +52,9 @@ final class OverlayPanel: NSPanel {

isReleasedWhenClosed = false
menu = nil
isOpaque = false
isOpaque = true
backgroundColor = .clear
hasShadow = true
hasShadow = false
alphaValue = 1.0
collectionBehavior = [.fullScreenAuxiliary]
isFloatingPanel = true
Expand All @@ -71,21 +71,21 @@ final class OverlayPanel: NSPanel {
)
}

override var canBecomeKey: Bool {
override public var canBecomeKey: Bool {
return _canBecomeKey
}

override var canBecomeMain: Bool {
override public var canBecomeMain: Bool {
return false
}
override func setIsVisible(_ visible: Bool) {

override public func setIsVisible(_ visible: Bool) {
_canBecomeKey = false
defer { _canBecomeKey = true }
super.setIsVisible(visible)
}

func moveToActiveSpace() {
public func moveToActiveSpace() {
collectionBehavior = [.fullScreenAuxiliary, .moveToActiveSpace]
Task { @MainActor in
try await Task.sleep(nanoseconds: 50_000_000)
Expand Down
4 changes: 2 additions & 2 deletions Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_VERSION = 0.37.3
APP_BUILD = 492
APP_VERSION = 0.37.4
APP_BUILD = 494
RELEASE_CHANNEL =
RELEASE_NUMBER = 1