remove IB menu and move everything to code
This commit is contained in:
Binary file not shown.
@@ -2,22 +2,4 @@
|
|||||||
<Bucket
|
<Bucket
|
||||||
type = "0"
|
type = "0"
|
||||||
version = "2.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>
|
</Bucket>
|
||||||
|
|||||||
@@ -15,11 +15,7 @@
|
|||||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="LiquipediaMenu" customModuleProvider="target"/>
|
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="LiquipediaMenu" customModuleProvider="target"/>
|
||||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||||
<customObject id="iMe-nY-DuT" customClass="StatusBarController" customModule="LiquipediaMenu" customModuleProvider="target">
|
<customObject id="iMe-nY-DuT" customClass="StatusBarController" customModule="LiquipediaMenu" customModuleProvider="target"/>
|
||||||
<connections>
|
|
||||||
<outlet property="statusBar" destination="o3m-Bx-rgD" id="NKW-1c-Hhh"/>
|
|
||||||
</connections>
|
|
||||||
</customObject>
|
|
||||||
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||||
<items>
|
<items>
|
||||||
<menuItem title="LiquipediaMenu" id="1Xt-HY-uBw">
|
<menuItem title="LiquipediaMenu" id="1Xt-HY-uBw">
|
||||||
@@ -682,9 +678,6 @@
|
|||||||
</items>
|
</items>
|
||||||
<point key="canvasLocation" x="277" y="-119"/>
|
<point key="canvasLocation" x="277" y="-119"/>
|
||||||
</menu>
|
</menu>
|
||||||
<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">
|
<customView id="mdA-hu-Y75" customClass="MatchView" customModule="LiquipediaMenu" customModuleProvider="target">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="389" height="108"/>
|
<rect key="frame" x="0.0" y="0.0" width="389" height="108"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
|
|||||||
@@ -9,6 +9,11 @@
|
|||||||
import Cocoa
|
import Cocoa
|
||||||
|
|
||||||
class StatusBarController: NSObject, NSUserInterfaceValidations {
|
class StatusBarController: NSObject, NSUserInterfaceValidations {
|
||||||
|
var statusBar = NSMenu()
|
||||||
|
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
||||||
|
let matchesAPI = MatchesAPI()
|
||||||
|
var matches = [Match]()
|
||||||
|
|
||||||
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
|
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
|
||||||
if let menuitem = item as? NSMenuItem {
|
if let menuitem = item as? NSMenuItem {
|
||||||
menuitem.state = .on
|
menuitem.state = .on
|
||||||
@@ -16,12 +21,6 @@ class StatusBarController: NSObject, NSUserInterfaceValidations {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@IBOutlet weak var statusBar: NSMenu!
|
|
||||||
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
|
||||||
let matchesAPI = MatchesAPI()
|
|
||||||
var matches = [Match]()
|
|
||||||
|
|
||||||
override func awakeFromNib() {
|
override func awakeFromNib() {
|
||||||
// Set the icon of the statusbar item and put it into the statusbar
|
// Set the icon of the statusbar item and put it into the statusbar
|
||||||
let icon = NSImage(named: "statusBarIcon")
|
let icon = NSImage(named: "statusBarIcon")
|
||||||
@@ -42,7 +41,7 @@ class StatusBarController: NSObject, NSUserInterfaceValidations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
statusBar.addItem(NSMenuItem.separator())
|
statusBar.addItem(NSMenuItem.separator())
|
||||||
statusBar.addItem(withTitle: "Quit", action: #selector(quitClicked), keyEquivalent: "")
|
statusBar.addItem(withTitle: "Quit", action: #selector(self.quitClicked), keyEquivalent: "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user