mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Prefer using layout anchors
This commit is contained in:
parent
05682d3fe4
commit
c8d3135460
@ -7,8 +7,8 @@ Change Log
|
||||
|
||||
### Improvements
|
||||
|
||||
- [beta][Big Sur] Match the inspector background to desktop color.
|
||||
- Round the corners of current line highlight.
|
||||
- [beta][Big Sur] Match the inspector background to desktop color.
|
||||
- [beta][tirivial] Update titlebar color.
|
||||
|
||||
### Fixes
|
||||
|
@ -117,7 +117,10 @@ final class ColorCodePanelController: NSViewController, NSWindowDelegate {
|
||||
|
||||
// make position of accessory view center
|
||||
if let superview = panel.accessoryView?.superview {
|
||||
superview.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "|[accessory]|", metrics: nil, views: ["accessory": self.view]))
|
||||
NSLayoutConstraint.activate([
|
||||
superview.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
|
||||
superview.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
|
||||
])
|
||||
}
|
||||
|
||||
self.panel = panel
|
||||
|
@ -72,10 +72,12 @@ final class InspectorTabView: NSTabView {
|
||||
backgroundView.material = .windowBackground
|
||||
backgroundView.translatesAutoresizingMaskIntoConstraints = false
|
||||
self.addSubview(backgroundView)
|
||||
self.addConstraints(
|
||||
NSLayoutConstraint.constraints(withVisualFormat: "H:|[view]|", metrics: nil, views: ["view": backgroundView]) +
|
||||
NSLayoutConstraint.constraints(withVisualFormat: "V:|[view]|", metrics: nil, views: ["view": backgroundView])
|
||||
)
|
||||
NSLayoutConstraint.activate([
|
||||
self.topAnchor.constraint(equalTo: backgroundView.topAnchor),
|
||||
self.bottomAnchor.constraint(equalTo: backgroundView.bottomAnchor),
|
||||
self.leadingAnchor.constraint(equalTo: backgroundView.leadingAnchor),
|
||||
self.trailingAnchor.constraint(equalTo: backgroundView.trailingAnchor),
|
||||
])
|
||||
|
||||
// add control parts
|
||||
self.addSubview(self.segmentedControl)
|
||||
|
Loading…
Reference in New Issue
Block a user