Skip to content

Commit

Permalink
Reorder fourths in menu and in code
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornorri committed Jun 29, 2021
1 parent 3a5e348 commit 4d9232d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions Rectangle/PrefsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ class PrefsViewController: NSViewController {

@IBOutlet weak var firstFourthShortcutView: MASShortcutView!
@IBOutlet weak var secondFourthShortcutView: MASShortcutView!
@IBOutlet weak var firstThreeFourthsShortcutView: MASShortcutView!
@IBOutlet weak var lastThreeFourthsShortcutView: MASShortcutView!
@IBOutlet weak var thirdFourthShortcutView: MASShortcutView!
@IBOutlet weak var lastFourthShortcutView: MASShortcutView!

@IBOutlet weak var firstThreeFourthsShortcutView: MASShortcutView!
@IBOutlet weak var lastThreeFourthsShortcutView: MASShortcutView!

@IBOutlet weak var topLeftSixthShortcutView: MASShortcutView!
@IBOutlet weak var topCenterSixthShortcutView: MASShortcutView!
@IBOutlet weak var topRightSixthShortcutView: MASShortcutView!
Expand Down Expand Up @@ -100,10 +100,10 @@ class PrefsViewController: NSViewController {
.moveDown: moveDownShortcutView,
.firstFourth: firstFourthShortcutView,
.secondFourth: secondFourthShortcutView,
.firstThreeFourths: firstThreeFourthsShortcutView,
.lastThreeFourths: lastThreeFourthsShortcutView,
.thirdFourth: thirdFourthShortcutView,
.lastFourth: lastFourthShortcutView,
.firstThreeFourths: firstThreeFourthsShortcutView,
.lastThreeFourths: lastThreeFourthsShortcutView,
.topLeftSixth: topLeftSixthShortcutView,
.topCenterSixth: topCenterSixthShortcutView,
.topRightSixth: topRightSixthShortcutView,
Expand Down
34 changes: 17 additions & 17 deletions Rectangle/WindowAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ enum WindowAction: Int {
centerHalf = 30,
firstFourth = 31,
secondFourth = 32,
firstThreeFourths = 33,
lastThreeFourths = 34,
thirdFourth = 35,
lastFourth = 36,
thirdFourth = 33,
lastFourth = 34,
firstThreeFourths = 35,
lastThreeFourths = 36,
topLeftSixth = 37,
topCenterSixth = 38,
topRightSixth = 39,
Expand All @@ -65,7 +65,7 @@ enum WindowAction: Int {
maximize, almostMaximize, maximizeHeight, smaller, larger, center, restore,
nextDisplay, previousDisplay,
moveLeft, moveRight, moveUp, moveDown,
firstFourth, secondFourth, firstThreeFourths, lastThreeFourths, thirdFourth, lastFourth,
firstFourth, secondFourth, thirdFourth, lastFourth, firstThreeFourths, lastThreeFourths,
topLeftSixth, topCenterSixth, topRightSixth, bottomLeftSixth, bottomCenterSixth, bottomRightSixth,
specified,
]
Expand Down Expand Up @@ -119,10 +119,10 @@ enum WindowAction: Int {
case .centerHalf: return "centerHalf"
case .firstFourth: return "firstFourth"
case .secondFourth: return "secondFourth"
case .firstThreeFourths: return "firstThreeFourths"
case .lastThreeFourths: return "lastThreeFourths"
case .thirdFourth: return "thirdFourth"
case .lastFourth: return "lastFourth"
case .firstThreeFourths: return "firstThreeFourths"
case .lastThreeFourths: return "lastThreeFourths"
case .topLeftSixth: return "topLeftSixth"
case .topCenterSixth: return "topCenterSixth"
case .topRightSixth: return "topRightSixth"
Expand Down Expand Up @@ -225,18 +225,18 @@ enum WindowAction: Int {
case .secondFourth:
key = "Fko-xs-gN5.title"
value = "Second Fourth"
case .firstThreeFourths:
key = "T9Z-QF-gwc.title"
value = "First Three Fourths"
case .lastThreeFourths:
key = "nwX-h6-fwm.title"
value = "Last Three Fourths"
case .thirdFourth:
key = "ZTK-rS-b17.title"
value = "Third Fourth"
case .lastFourth:
key = "6HX-rn-VIp.title"
value = "Last Fourth"
case .firstThreeFourths:
key = "T9Z-QF-gwc.title"
value = "First Three Fourths"
case .lastThreeFourths:
key = "nwX-h6-fwm.title"
value = "Last Three Fourths"
case .topLeftSixth:
key = "mFt-Kg-UYG.title"
value = "Top Left Sixth"
Expand Down Expand Up @@ -361,10 +361,10 @@ enum WindowAction: Int {
case .centerHalf: return NSImage(imageLiteralResourceName: "halfWidthCenterTemplate")
case .firstFourth: return NSImage(imageLiteralResourceName: "leftFourthTemplate")
case .secondFourth: return NSImage(imageLiteralResourceName: "centerLeftFourthTemplate")
case .firstThreeFourths: return NSImage(imageLiteralResourceName: "firstThreeFourthsTemplate")
case .lastThreeFourths: return NSImage(imageLiteralResourceName: "lastThreeFourthsTemplate")
case .thirdFourth: return NSImage(imageLiteralResourceName: "centerRightFourthTemplate")
case .lastFourth: return NSImage(imageLiteralResourceName: "rightFourthTemplate")
case .firstThreeFourths: return NSImage(imageLiteralResourceName: "firstThreeFourthsTemplate")
case .lastThreeFourths: return NSImage(imageLiteralResourceName: "lastThreeFourthsTemplate")
case .topLeftSixth: return NSImage(imageLiteralResourceName: "topLeftSixthTemplate")
case .topCenterSixth: return NSImage(imageLiteralResourceName: "topCenterSixthTemplate")
case .topRightSixth: return NSImage(imageLiteralResourceName: "topRightSixthTemplate")
Expand Down Expand Up @@ -397,7 +397,7 @@ enum WindowAction: Int {
var gapsApplicable: Dimension {
switch self {
case .leftHalf, .rightHalf, .bottomHalf, .topHalf, .centerHalf, .maximize, .bottomLeft, .bottomRight, .topLeft, .topRight, .firstThird, .firstTwoThirds, .centerThird, .lastTwoThirds, .lastThird,
.firstFourth, .secondFourth, .firstThreeFourths, .lastThreeFourths, .thirdFourth, .lastFourth, .topLeftSixth, .topCenterSixth, .topRightSixth, .bottomLeftSixth, .bottomCenterSixth, .bottomRightSixth:
.firstFourth, .secondFourth, .thirdFourth, .lastFourth, .firstThreeFourths, .lastThreeFourths, .topLeftSixth, .topCenterSixth, .topRightSixth, .bottomLeftSixth, .bottomCenterSixth, .bottomRightSixth:
return .both
case .moveUp, .moveDown:
return Defaults.resizeOnDirectionalMove.enabled ? .vertical : .none;
Expand All @@ -412,7 +412,7 @@ enum WindowAction: Int {

var category: WindowActionCategory? { // used to specify a submenu
switch self {
case .firstFourth, .secondFourth, .firstThreeFourths, .lastThreeFourths, .thirdFourth, .lastFourth: return .fourths
case .firstFourth, .secondFourth, .thirdFourth, .lastFourth, .firstThreeFourths, .lastThreeFourths: return .fourths
case .topLeftSixth, .topCenterSixth, .topRightSixth, .bottomLeftSixth, .bottomCenterSixth, .bottomRightSixth: return .sixths
case .moveUp, .moveDown, .moveLeft, .moveRight: return .move
default: return nil
Expand Down
8 changes: 4 additions & 4 deletions Rectangle/WindowCalculation/WindowCalculation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ class WindowCalculationFactory {
static let almostMaximizeCalculation = AlmostMaximizeCalculation()
static let firstFourthCalculation = FirstFourthCalculation()
static let secondFourthCalculation = SecondFourthCalculation()
static let firstThreeFourthsCalculation = FirstThreeFourthsCalculation()
static let lastThreeFourthsCalculation = LastThreeFourthsCalculation()
static let thirdFourthCalculation = ThirdFourthCalculation()
static let lastFourthCalculation = LastFourthCalculation()
static let firstThreeFourthsCalculation = FirstThreeFourthsCalculation()
static let lastThreeFourthsCalculation = LastThreeFourthsCalculation()
static let topLeftSixthCalculation = TopLeftSixthCalculation()
static let topCenterSixthCalculation = TopCenterSixthCalculation()
static let topRightSixthCalculation = TopRightSixthCalculation()
Expand Down Expand Up @@ -177,10 +177,10 @@ class WindowCalculationFactory {
.centerHalf: centerHalfCalculation,
.firstFourth: firstFourthCalculation,
.secondFourth: secondFourthCalculation,
.firstThreeFourths: firstThreeFourthsCalculation,
.lastThreeFourths: lastThreeFourthsCalculation,
.thirdFourth: thirdFourthCalculation,
.lastFourth: lastFourthCalculation,
.firstThreeFourths: firstThreeFourthsCalculation,
.lastThreeFourths: lastThreeFourthsCalculation,
.topLeftSixth: topLeftSixthCalculation,
.topCenterSixth: topCenterSixthCalculation,
.topRightSixth: topRightSixthCalculation,
Expand Down

0 comments on commit 4d9232d

Please sign in to comment.