working menu validation method
This commit is contained in:
Binary file not shown.
@@ -2,4 +2,22 @@
|
||||
<Bucket
|
||||
type = "0"
|
||||
version = "2.0">
|
||||
<Breakpoints>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "LiquipediaMenu/StatusBarController.swift"
|
||||
timestampString = "560951757.643116"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "45"
|
||||
endingLineNumber = "45"
|
||||
landmarkName = "generateMenu()"
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
||||
|
||||
@@ -682,7 +682,7 @@
|
||||
</items>
|
||||
<point key="canvasLocation" x="277" y="-119"/>
|
||||
</menu>
|
||||
<menu id="o3m-Bx-rgD">
|
||||
<menu autoenablesItems="NO" id="o3m-Bx-rgD">
|
||||
<point key="canvasLocation" x="379" y="145"/>
|
||||
</menu>
|
||||
<customView id="mdA-hu-Y75" customClass="MatchView" customModule="LiquipediaMenu" customModuleProvider="target">
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
import Foundation
|
||||
import SwiftSoup
|
||||
|
||||
protocol MatchesAPIDelegate {
|
||||
|
||||
}
|
||||
|
||||
class MatchesAPI {
|
||||
|
||||
func fetchMatches(for game: String) -> [Match]? {
|
||||
|
||||
@@ -8,7 +8,15 @@
|
||||
|
||||
import Cocoa
|
||||
|
||||
class StatusBarController: NSObject, NSMenuDelegate {
|
||||
class StatusBarController: NSObject, NSUserInterfaceValidations {
|
||||
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
|
||||
if let menuitem = item as? NSMenuItem {
|
||||
menuitem.state = .on
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@IBOutlet weak var statusBar: NSMenu!
|
||||
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
||||
let matchesAPI = MatchesAPI()
|
||||
|
||||
Reference in New Issue
Block a user