Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Rectangle/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var updatesMenuItem: NSMenuItem!
@IBOutlet weak var quitMenuItem: NSMenuItem!

var eighthsMenuItem: NSMenuItem?

static var instance: AppDelegate {
NSApp.delegate as! AppDelegate
}
Expand Down Expand Up @@ -411,10 +409,6 @@ extension AppDelegate: NSMenuDelegate {
for categoryMenu in categoryMenus {
categoryMenu.menu.delegate = self
let menuMenuItem = NSMenuItem(title: categoryMenu.category.displayName, action: nil, keyEquivalent: "")
if categoryMenu.category == .eighths {
eighthsMenuItem = menuMenuItem
eighthsMenuItem?.isHidden = !Defaults.showEighthsInMenu.userEnabled
}
mainStatusMenu.insertItem(menuMenuItem, at: menuIndex)
mainStatusMenu.setSubmenu(categoryMenu.menu, for: menuMenuItem)
menuIndex += 1
Expand Down
1 change: 0 additions & 1 deletion Rectangle/PrefsWindow/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class SettingsViewController: NSViewController {
@objc func toggleShowEighthsInMenu(_ sender: NSButton) {
let enabled: Bool = sender.state == .on
Defaults.showEighthsInMenu.enabled = enabled
AppDelegate.instance.eighthsMenuItem?.isHidden = !enabled
}

@IBAction func checkForUpdates(_ sender: Any) {
Expand Down
4 changes: 3 additions & 1 deletion Rectangle/WindowAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ enum WindowAction: Int, Codable {
// Determines where separators should be used in the menu
var firstInGroup: Bool {
switch self {
case .leftHalf, .topLeft, .firstThird, .maximize, .nextDisplay, .moveLeft, .firstFourth, .topLeftSixth, .topLeftEighth:
case .leftHalf, .topLeft, .firstThird, .maximize, .almostMaximize, .nextDisplay, .moveLeft, .firstFourth, .topLeftSixth, .topLeftEighth:
return true
default:
return false
Expand Down Expand Up @@ -652,10 +652,12 @@ enum WindowAction: Int, Codable {

var category: WindowActionCategory? { // used to specify a submenu
switch self {
case .firstThird, .centerThird, .lastThird, .firstTwoThirds, .centerTwoThirds, .lastTwoThirds: return .thirds
case .firstFourth, .secondFourth, .thirdFourth, .lastFourth, .firstThreeFourths, .centerThreeFourths, .lastThreeFourths: return .fourths
case .topLeftSixth, .topCenterSixth, .topRightSixth, .bottomLeftSixth, .bottomCenterSixth, .bottomRightSixth: return .sixths
case .topLeftEighth, .topCenterLeftEighth, .topCenterRightEighth, .topRightEighth, .bottomLeftEighth, .bottomCenterLeftEighth, .bottomCenterRightEighth, .bottomRightEighth: return .eighths
case .moveUp, .moveDown, .moveLeft, .moveRight: return .move
case .almostMaximize, .maximizeHeight, .larger, .smaller, .largerWidth, .smallerWidth, .largerHeight, .smallerHeight: return .size
default: return nil
}
}
Expand Down