Pref // Remove national flags from keyboard layout menu.
- for faster GUI rendering speed.
This commit is contained in:
parent
4ec1d3b1a8
commit
67af8b40b1
|
@ -112,20 +112,6 @@ extension RangeReplaceableCollection where Element: Hashable {
|
|||
menuItem.title = localizedName
|
||||
menuItem.representedObject = sourceID
|
||||
|
||||
if let iconPtr = TISGetInputSourceProperty(source, kTISPropertyIconRef) {
|
||||
let icon = IconRef(iconPtr)
|
||||
let image = NSImage(iconRef: icon)
|
||||
|
||||
func resize( _ image: NSImage) -> NSImage {
|
||||
let newImage = NSImage(size: NSSize(width: 16, height: 16))
|
||||
newImage.lockFocus()
|
||||
image.draw(in: NSRect(x: 0, y: 0, width: 16, height: 16))
|
||||
newImage.unlockFocus()
|
||||
return newImage
|
||||
}
|
||||
menuItem.image = resize(image)
|
||||
}
|
||||
|
||||
if sourceID == "com.apple.keylayout.US" {
|
||||
usKeyboardLayoutItem = menuItem
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue