mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
feat: added tooltips to the missing elements and enabled accessibility on some not natively supported (#2321)
This commit is contained in:
@@ -418,7 +418,7 @@ internal class HeaderView: NSStackView {
|
||||
fileprivate func setCloseButton(_ state: Bool) {
|
||||
if state && !self.isCloseAction {
|
||||
self.activityButton?.image = Bundle(for: type(of: self)).image(forResource: "close")!
|
||||
self.activityButton?.toolTip = localizedString("Close popup")
|
||||
self.activityButton?.toolTip = localizedString("Close")
|
||||
self.activityButton?.action = #selector(self.closePopup)
|
||||
self.isCloseAction = true
|
||||
} else if !state && self.isCloseAction {
|
||||
|
||||
@@ -496,7 +496,8 @@ private class WidgetPreview: NSStackView {
|
||||
self.layer?.backgroundColor = NSColor.white.cgColor
|
||||
|
||||
self.identifier = NSUserInterfaceItemIdentifier(rawValue: type.rawValue)
|
||||
self.toolTip = localizedString("Move widget", type.name())
|
||||
self.setAccessibilityElement(true)
|
||||
self.toolTip = type.name()
|
||||
|
||||
self.orientation = .vertical
|
||||
self.distribution = .fill
|
||||
|
||||
@@ -486,6 +486,8 @@ public class PieChartView: NSView {
|
||||
self.segments = segments
|
||||
|
||||
super.init(frame: frame)
|
||||
|
||||
self.setAccessibilityElement(true)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
@@ -575,6 +577,15 @@ public class HalfCircleGraphView: NSView {
|
||||
|
||||
public var color: NSColor = NSColor.systemBlue
|
||||
|
||||
public override init(frame: NSRect) {
|
||||
super.init(frame: frame)
|
||||
self.setAccessibilityElement(true)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
public override func draw(_ rect: CGRect) {
|
||||
let arcWidth: CGFloat = 7.0
|
||||
let radius = (min(self.frame.width, self.frame.height) - arcWidth) / 2
|
||||
|
||||
Reference in New Issue
Block a user