mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: removed button to kill the process in the the Top Process (CPU/RAM/Battery) (#593)
This reverts commit d6362c5fb3.
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "baseline_cancel_white_12pt_1x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "baseline_cancel_white_12pt_2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "baseline_cancel_white_12pt_3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 150 B |
Binary file not shown.
|
Before Width: | Height: | Size: 222 B |
Binary file not shown.
|
Before Width: | Height: | Size: 301 B |
@@ -654,34 +654,15 @@ public class ProcessView: NSStackView {
|
||||
let imageBox = NSView(frame: NSRect(x: 0, y: 0, width: 0, height: 0))
|
||||
imageBox.addSubview(self.imageView)
|
||||
|
||||
let closeBox = NSView(frame: NSRect(x: 0, y: 0, width: 0, height: 0))
|
||||
let closeBtn = NSButton(frame: NSRect(x: 5, y: 5, width: 12, height: 12))
|
||||
closeBtn.bezelStyle = .regularSquare
|
||||
closeBtn.translatesAutoresizingMaskIntoConstraints = false
|
||||
closeBtn.imageScaling = .scaleNone
|
||||
closeBtn.image = Bundle(for: type(of: self)).image(forResource: "close_12pt")!
|
||||
if #available(OSX 10.14, *) {
|
||||
closeBtn.contentTintColor = .lightGray
|
||||
}
|
||||
closeBtn.isBordered = false
|
||||
closeBtn.action = #selector(closeApp)
|
||||
closeBtn.target = self
|
||||
closeBtn.toolTip = localizedString("Close application")
|
||||
closeBtn.focusRingType = .none
|
||||
closeBox.addSubview(closeBtn)
|
||||
|
||||
self.addArrangedSubview(imageBox)
|
||||
self.addArrangedSubview(self.labelView)
|
||||
self.addArrangedSubview(self.valueView)
|
||||
self.addArrangedSubview(closeBox)
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
imageBox.widthAnchor.constraint(equalToConstant: self.bounds.height),
|
||||
imageBox.heightAnchor.constraint(equalToConstant: self.bounds.height),
|
||||
self.labelView.heightAnchor.constraint(equalToConstant: 16),
|
||||
self.valueView.widthAnchor.constraint(equalToConstant: self.valueView.bounds.width),
|
||||
closeBox.widthAnchor.constraint(equalToConstant: self.bounds.height),
|
||||
closeBox.heightAnchor.constraint(equalToConstant: self.bounds.height),
|
||||
self.widthAnchor.constraint(equalToConstant: self.bounds.width),
|
||||
self.heightAnchor.constraint(equalToConstant: self.bounds.height)
|
||||
])
|
||||
@@ -705,12 +686,6 @@ public class ProcessView: NSStackView {
|
||||
self.pid = nil
|
||||
self.toolTip = ""
|
||||
}
|
||||
|
||||
@objc private func closeApp() {
|
||||
if let pid = self.pid {
|
||||
_ = syncShell("kill \(pid)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CAText: CATextLayer {
|
||||
|
||||
Reference in New Issue
Block a user