Skip to content

Commit

Permalink
Add icons to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Jan 20, 2024
1 parent f7795d0 commit b14e7b5
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions src/apps/Menu/src/MenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,19 @@ public class MenuController: NSObject, NSMenuDelegate {
// Profiles

menu.addItem(NSMenuItem.separator())
menu.addItem(
withTitle: "Profiles",
action: nil,
keyEquivalent: "")

do {
let newItem = NSMenuItem(
title: "Profiles",
action: nil,
keyEquivalent: "")

newItem.image = NSImage(
systemSymbolName: "person.3",
accessibilityDescription: nil)

menu.addItem(newItem)
}

LibKrbn.Settings.shared.profiles.forEach { profile in
let newItem = NSMenuItem(
Expand All @@ -133,11 +142,17 @@ public class MenuController: NSObject, NSMenuDelegate {
// Others

menu.addItem(NSMenuItem.separator())

do {
let newItem = NSMenuItem(
title: "Settings...",
action: #selector(openSettings),
keyEquivalent: "")

newItem.image = NSImage(
systemSymbolName: "gearshape",
accessibilityDescription: nil)

newItem.target = self
menu.addItem(newItem)
}
Expand All @@ -146,13 +161,19 @@ public class MenuController: NSObject, NSMenuDelegate {
title: "Launch EventViewer...",
action: #selector(launchEventViewer),
keyEquivalent: "")

newItem.image = NSImage(
systemSymbolName: "magnifyingglass",
accessibilityDescription: nil)

newItem.target = self
menu.addItem(newItem)
}

// Restart

menu.addItem(NSMenuItem.separator())

do {
let newItem = NSMenuItem(
title: "Restart Karabiner-Elements",
Expand Down

0 comments on commit b14e7b5

Please sign in to comment.