mirror of
https://github.com/neon443/DesktopGoose2.git
synced 2026-11-30 12:44:52 +00:00
minor refactoring
This commit is contained in:
5 files changed
+32
-20
No files matched your search
@@ -25,7 +25,8 @@ class Goose: NSViewController {
|
||||
}
|
||||
|
||||
func setup() {
|
||||
gooseView.frame = NSRect(x: 100, y: 100, width: 25, height: 25)
|
||||
gooseView.translatesAutoresizingMaskIntoConstraints = false
|
||||
gooseView.frame = NSRect(x: 100, y: 100, width: 50, height: 50)
|
||||
self.view.addSubview(gooseView)
|
||||
|
||||
let bodyView = NSImageView(image: NSImage(named: "body")!)
|
||||
@@ -41,10 +42,15 @@ class Goose: NSViewController {
|
||||
gooseView.addSubview(neckView)
|
||||
neckView.translatesAutoresizingMaskIntoConstraints = false
|
||||
neckView.rotate(byDegrees: 90)
|
||||
neckView.frame = NSRect(x: 0, y: 0, width: 30, height: 30)
|
||||
NSLayoutConstraint.activate([
|
||||
neckView.widthAnchor.constraint(equalToConstant: 25),
|
||||
neckView.heightAnchor.constraint(equalToConstant: 25)
|
||||
neckView.leftAnchor.constraint(equalTo: bodyView.leftAnchor),
|
||||
neckView.bottomAnchor.constraint(equalTo: bodyView.bottomAnchor),
|
||||
neckView.widthAnchor.constraint(equalToConstant: 30),
|
||||
neckView.heightAnchor.constraint(equalToConstant: 30)
|
||||
])
|
||||
bodyView.alphaValue = 0.5
|
||||
neckView.alphaValue = 0.5
|
||||
}
|
||||
}
|
||||
|
||||
|
||||