mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
feat: added feature to set keyboard shortcut to open/close popup window (#1976)
This commit is contained in:
@@ -13,8 +13,6 @@ import Cocoa
|
||||
import Kit
|
||||
|
||||
internal class Popup: PopupWrapper {
|
||||
private var title: String
|
||||
|
||||
private let orderTableView: OrderTableView = OrderTableView()
|
||||
private var list: [Clock_t] = []
|
||||
|
||||
@@ -22,9 +20,7 @@ internal class Popup: PopupWrapper {
|
||||
private var calendarState: Bool = true
|
||||
|
||||
public init(_ module: ModuleType) {
|
||||
self.title = module.rawValue
|
||||
|
||||
super.init(frame: NSRect(x: 0, y: 0, width: Constants.Popup.width, height: 0))
|
||||
super.init(module, frame: NSRect(x: 0, y: 0, width: Constants.Popup.width, height: 0))
|
||||
|
||||
self.orientation = .vertical
|
||||
self.spacing = Constants.Popup.margins
|
||||
@@ -87,6 +83,13 @@ internal class Popup: PopupWrapper {
|
||||
public override func settings() -> NSView? {
|
||||
let view = SettingsContainerView()
|
||||
|
||||
view.addArrangedSubview(PreferencesSection([
|
||||
PreferencesRow(localizedString("Keyboard shortcut"), component: KeyboardShartcutView(
|
||||
callback: self.setKeyboardShortcut,
|
||||
value: self.keyboardShortcut
|
||||
))
|
||||
]))
|
||||
|
||||
view.addArrangedSubview(PreferencesSection([
|
||||
PreferencesRow(localizedString("Calendar"), component: switchView(
|
||||
action: #selector(self.toggleCalendarState),
|
||||
|
||||
Reference in New Issue
Block a user