mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-09-21 02:51:04 +02:00
Update ThemeView.swift
Use dedicated function to add constraints
This commit is contained in:
parent
bcb139e882
commit
75ffe238ca
@ -53,39 +53,7 @@ class ThemeView: NSView, WebFrameLoadDelegate, WebUIDelegate {
|
|||||||
|
|
||||||
private func setup() {
|
private func setup() {
|
||||||
self.addSubview(self.webView)
|
self.addSubview(self.webView)
|
||||||
|
gAddConstraintsToFit(superView: self, subView: self.webView)
|
||||||
self.webView.translatesAutoresizingMaskIntoConstraints = false
|
|
||||||
let left = NSLayoutConstraint(item: self.webView,
|
|
||||||
attribute: .left,
|
|
||||||
relatedBy: .equal,
|
|
||||||
toItem: self,
|
|
||||||
attribute: .left,
|
|
||||||
multiplier: 1.0,
|
|
||||||
constant: 0.0)
|
|
||||||
let bottom = NSLayoutConstraint(item: self.webView,
|
|
||||||
attribute: .bottom,
|
|
||||||
relatedBy: .equal,
|
|
||||||
toItem: self,
|
|
||||||
attribute: .bottom,
|
|
||||||
multiplier: 1.0,
|
|
||||||
constant: 0.0)
|
|
||||||
let width = NSLayoutConstraint(item: self.webView,
|
|
||||||
attribute: .width,
|
|
||||||
relatedBy: .equal,
|
|
||||||
toItem: self,
|
|
||||||
attribute: .width,
|
|
||||||
multiplier: 1.0,
|
|
||||||
constant: 0.0)
|
|
||||||
let height = NSLayoutConstraint(item: self.webView,
|
|
||||||
attribute: .height,
|
|
||||||
relatedBy: .equal,
|
|
||||||
toItem: self,
|
|
||||||
attribute: .height,
|
|
||||||
multiplier: 1.0,
|
|
||||||
constant: 0.0)
|
|
||||||
self.addConstraints([left, bottom, height, width])
|
|
||||||
|
|
||||||
|
|
||||||
self.webView.uiDelegate = self
|
self.webView.uiDelegate = self
|
||||||
self.webView.frameLoadDelegate = self
|
self.webView.frameLoadDelegate = self
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user