mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 08:17:16 +00:00
Set accessibility details in commonInit.
This commit is contained in:
1 parent
cb72a3a801
commit
648632c8a7
1 file changed
+10
-3
@@ -35,13 +35,12 @@ final class StatusBarGearButton: NSView {
|
||||
|
||||
override init(frame frameRect: NSRect) {
|
||||
super.init(frame: frameRect)
|
||||
setAccessibilityElement(true)
|
||||
setAccessibilityRole(.popUpButton)
|
||||
setAccessibilityLabel(NSLocalizedString("Actions", comment: "Status bar gear menu accessibility label"))
|
||||
commonInit()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
override var intrinsicContentSize: NSSize {
|
||||
@@ -77,6 +76,14 @@ final class StatusBarGearButton: NSView {
|
||||
|
||||
private extension StatusBarGearButton {
|
||||
|
||||
func commonInit() {
|
||||
let description = NSLocalizedString("Actions", comment: "Status bar gear menu accessibility label")
|
||||
setAccessibilityElement(true)
|
||||
setAccessibilityRole(.popUpButton)
|
||||
setAccessibilityLabel(description)
|
||||
toolTip = description
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
func popUpMenu() -> Bool {
|
||||
guard let menu = delegate?.gearButtonMenu(self) else {
|
||||
|
||||
Reference in new issue
Block a user