Skip to content

Commit

Permalink
Merge pull request #158 from edw4rddx/main
Browse files Browse the repository at this point in the history
Added cut, copy, paste edit menu items
  • Loading branch information
twostraws authored Aug 17, 2022
2 parents 9f1bd84 + 8763866 commit 18873e2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 17 additions & 1 deletion ControlRoom/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,28 @@ CA
<action selector="deleteSelectedSimulators:" target="Ady-hI-5gd" id="DXU-j3-jKE"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="m7H-iA-6aX"/>
<menuItem isSeparatorItem="YES" id="VlF-Lz-b50"/>
<menuItem title="Cut" keyEquivalent="x" id="fuj-su-hDM">
<connections>
<action selector="cut:" target="Ady-hI-5gd" id="Iic-AZ-esb"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="crV-ox-do9" userLabel="Copy">
<connections>
<action selector="copy:" target="Ady-hI-5gd" id="gBe-Db-CS8"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="f5u-Np-Ehc" userLabel="Paste">
<connections>
<action selector="paste:" target="Ady-hI-5gd" id="8AP-N5-VFw"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
<connections>
<action selector="selectAll:" target="Ady-hI-5gd" id="VNm-Mi-diN"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="l8R-YC-BZg"/>
</items>
</menu>
</menuItem>
Expand Down
2 changes: 2 additions & 0 deletions ControlRoom/Main Window/MainWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class MainWindowController: NSWindowController {
self?.adjustWindowLevel()
}).store(in: &cancellables)
}

private func adjustWindowLevel() {
window?.level = preferences.wantsFloatingWindow ? .floating : .normal
}
Expand All @@ -80,6 +81,7 @@ class MainWindowController: NSWindowController {
}

extension MainWindowController: NSMenuItemValidation {

func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
if menuItem.action == #selector(toggleFloatingWindow(_:)) {
menuItem.state = preferences.wantsFloatingWindow ? .on : .off
Expand Down

0 comments on commit 18873e2

Please sign in to comment.