From 8de91d9d74ab70f2b6de2a60a360e8bb92795677 Mon Sep 17 00:00:00 2001 From: Serhiy Mytrovtsiy Date: Fri, 17 Jan 2025 17:12:01 +0100 Subject: [PATCH] feat: added tooltips to the widgets that allow to read them with VoiceOver (#2321) --- Kit/module/widget.swift | 2 ++ Stats/Views/CombinedView.swift | 1 + 2 files changed, 3 insertions(+) diff --git a/Kit/module/widget.swift b/Kit/module/widget.swift index 8f297acd..f50b6022 100644 --- a/Kit/module/widget.swift +++ b/Kit/module/widget.swift @@ -343,6 +343,7 @@ public class SWidget { } self.menuBarItem?.button?.addSubview(self.item) self.menuBarItem?.button?.image = NSImage() + self.menuBarItem?.button?.toolTip = "\(localizedString(self.module)): \(self.type.name())" if let item = self.menuBarItem, !item.isVisible { self.menuBarItem?.isVisible = true @@ -487,6 +488,7 @@ public class MenuBar { self.menuBarItem?.button?.addSubview(self.view) self.menuBarItem?.button?.image = NSImage() + self.menuBarItem?.button?.toolTip = "\(localizedString(self.moduleName))" self.menuBarItem?.button?.target = self self.menuBarItem?.button?.action = #selector(self.togglePopup) self.menuBarItem?.button?.sendAction(on: [.leftMouseDown, .rightMouseDown]) diff --git a/Stats/Views/CombinedView.swift b/Stats/Views/CombinedView.swift index 7e2b53d9..56737248 100644 --- a/Stats/Views/CombinedView.swift +++ b/Stats/Views/CombinedView.swift @@ -69,6 +69,7 @@ internal class CombinedView: NSObject, NSGestureRecognizerDelegate { self.menuBarItem?.autosaveName = "CombinedModules" self.menuBarItem?.button?.addSubview(self.view) self.menuBarItem?.button?.image = NSImage() + self.menuBarItem?.button?.toolTip = localizedString("Combined modules") if !self.combinedModulesPopup { self.activeModules.forEach { (m: Module) in