mirror of
https://github.com/neon443/DesktopGoose2.git
synced 2026-11-30 20:54:52 +00:00
base stuff done
This commit is contained in:
9 files changed
+147
-22
No files matched your search
@@ -10,13 +10,14 @@ import Cocoa
|
||||
|
||||
class GooseWindow {
|
||||
private var window: NSWindow
|
||||
private var duck: NSImageView
|
||||
private var goose: Goose
|
||||
private var angle: CGFloat = 90
|
||||
var shown: Bool = false
|
||||
private var x = 1
|
||||
private var time: Timer?
|
||||
|
||||
init() {
|
||||
goose = Goose()
|
||||
self.window = NSWindow(
|
||||
contentRect: CGRect(x: 0, y: 0, width: NSScreen.main!.frame.width, height: NSScreen.main!.frame.width),
|
||||
styleMask: .borderless,
|
||||
@@ -28,14 +29,12 @@ class GooseWindow {
|
||||
window.level = NSWindow.Level.screenSaver + 1
|
||||
window.ignoresMouseEvents = true
|
||||
window.hasShadow = false
|
||||
window.collectionBehavior = NSWindow.CollectionBehavior.canJoinAllApplications.union(.stationary)
|
||||
|
||||
duck = .init(image: NSImage(named: "pond")!)
|
||||
window.contentView?.addSubview(duck)
|
||||
duck.frame.origin.x = NSScreen.main!.frame.width/2
|
||||
duck.frame.origin.y = NSScreen.main!.frame.height/2
|
||||
window.collectionBehavior = NSWindow.CollectionBehavior.canJoinAllApplications.union(.stationary).union(.canJoinAllSpaces)
|
||||
|
||||
showHide()
|
||||
|
||||
// window.contentView?.addSubview(NSTextField(labelWithString: "hi"))
|
||||
window.contentView?.addSubview(goose.view)
|
||||
}
|
||||
|
||||
func showHide() {
|
||||
|
||||