Skip to content

Commit

Permalink
#49 Finish all custom resize icons
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Oct 9, 2023
1 parent 46735c3 commit 330f4ad
Show file tree
Hide file tree
Showing 36 changed files with 641 additions and 33 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"symbols" : [
{
"filename" : "custom.backward.fill.rectangle.fill.svg",
"idiom" : "universal"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"symbols" : [
{
"filename" : "rectangle.bottomtwothirds.inset.filled.svg",
"idiom" : "universal"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"symbols" : [
{
"filename" : "rectangle.toptwothirds.inset.filled.svg",
"idiom" : "universal"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"symbols" : [
{
"filename" : "rectangle.verticalcenterthird.inset.filled.svg",
"idiom" : "universal"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Loop/MenuBarResizeButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct MenuBarResizeButton: View {
} label: {
HStack {
if let image = direction.image {
Image(nsImage: image)
image
}
Text(name)
}
Expand Down
63 changes: 31 additions & 32 deletions Loop/Window Management/WindowDirection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ enum WindowDirection: CaseIterable, Identifiable {

// These are used in the menubar item
static var general: [WindowDirection] {
[.maximize, .fullscreen, .center, .lastDirection]
[.maximize, .fullscreen, .center, .lastDirection, .initialFrame]
}
static var halves: [WindowDirection] {
[.topHalf, .bottomHalf, .leftHalf, .rightHalf]
Expand Down Expand Up @@ -99,9 +99,9 @@ enum WindowDirection: CaseIterable, Identifiable {
case .noAction: nil
case .maximize: "Maximize"
case .fullscreen: "Fullscreen"
case .lastDirection: nil
case .lastDirection: "Last Direction"
case .center: "Center"
case .initialFrame: "Restore Initial Frame"
case .initialFrame: "Initial Frame"

case .topHalf: "Top Half"
case .rightHalf: "Right Half"
Expand Down Expand Up @@ -129,7 +129,6 @@ enum WindowDirection: CaseIterable, Identifiable {

var keybind: [Set<CGKeyCode>] {
switch self {
case .noAction: [[]]
case .maximize: Defaults[.maximizeKeybind]
case .fullscreen: Defaults[.fullscreenKeybind]
case .lastDirection: Defaults[.lastDirectionKeybind]
Expand All @@ -156,35 +155,35 @@ enum WindowDirection: CaseIterable, Identifiable {
}
}

var image: NSImage? {
var image: Image? {
switch self {
case .maximize: NSImage(systemSymbolName: "rectangle.inset.filled", accessibilityDescription: nil)
case .fullscreen: NSImage(systemSymbolName: "rectangle.fill", accessibilityDescription: nil)
// case .lastDirection:
case .center: NSImage(systemSymbolName: "rectangle.center.inset.filled", accessibilityDescription: nil)
case .initialFrame: NSImage(systemSymbolName: "macwindow", accessibilityDescription: nil)

case .topHalf: NSImage(systemSymbolName: "rectangle.tophalf.inset.filled", accessibilityDescription: nil)
case .rightHalf: NSImage(systemSymbolName: "rectangle.righthalf.inset.filled", accessibilityDescription: nil)
case .bottomHalf: NSImage(systemSymbolName: "rectangle.bottomhalf.inset.filled", accessibilityDescription: nil)
case .leftHalf: NSImage(systemSymbolName: "rectangle.lefthalf.inset.filled", accessibilityDescription: nil)

case .topLeftQuarter: NSImage(systemSymbolName: "rectangle.inset.topleft.filled", accessibilityDescription: nil)
case .topRightQuarter: NSImage(systemSymbolName: "rectangle.inset.topright.filled", accessibilityDescription: nil)
case .bottomRightQuarter: NSImage(systemSymbolName: "rectangle.inset.bottomright.filled", accessibilityDescription: nil)
case .bottomLeftQuarter: NSImage(systemSymbolName: "rectangle.inset.bottomleft.filled", accessibilityDescription: nil)

case .rightThird: NSImage(systemSymbolName: "rectangle.rightthird.inset.filled", accessibilityDescription: nil)
case .rightTwoThirds: NSImage(named: "rectangle.righttwothirds.inset.filled")
case .horizontalCenterThird: NSImage(named: "rectangle.centerthird.inset.filled")
case .leftThird: NSImage(systemSymbolName: "rectangle.leftthird.inset.filled", accessibilityDescription: nil)
case .leftTwoThirds: NSImage(named: "rectangle.lefttwothirds.inset.filled")

case .topThird: NSImage(systemSymbolName: "rectangle.topthird.inset.filled", accessibilityDescription: nil)
// case .topTwoThirds:
// case .verticalCenterThird:
case .bottomThird: NSImage(systemSymbolName: "rectangle.bottomthird.inset.filled", accessibilityDescription: nil)
// case .bottomTwoThirds:
case .maximize: Image(systemName: "rectangle.inset.filled")
case .fullscreen: Image(systemName: "rectangle.fill")
case .center: Image(systemName: "rectangle.center.inset.filled")
case .lastDirection: Image("custom.backward.fill.rectangle.fill")
case .initialFrame: Image(systemName: "macwindow")

case .topHalf: Image(systemName: "rectangle.tophalf.inset.filled")
case .rightHalf: Image(systemName: "rectangle.righthalf.inset.filled")
case .bottomHalf: Image(systemName: "rectangle.bottomhalf.inset.filled")
case .leftHalf: Image(systemName: "rectangle.lefthalf.inset.filled")

case .topLeftQuarter: Image(systemName: "rectangle.inset.topleft.filled")
case .topRightQuarter: Image(systemName: "rectangle.inset.topright.filled")
case .bottomRightQuarter: Image(systemName: "rectangle.inset.bottomright.filled")
case .bottomLeftQuarter: Image(systemName: "rectangle.inset.bottomleft.filled")

case .rightThird: Image(systemName: "rectangle.rightthird.inset.filled")
case .rightTwoThirds: Image("custom.rectangle.righttwothirds.inset.filled")
case .horizontalCenterThird: Image("custom.rectangle.horizontalcenterthird.inset.filled")
case .leftThird: Image(systemName: "rectangle.leftthird.inset.filled")
case .leftTwoThirds: Image("custom.rectangle.lefttwothirds.inset.filled")

case .topThird: Image(systemName: "rectangle.topthird.inset.filled")
case .topTwoThirds: Image("custom.rectangle.toptwothirds.inset.filled")
case .verticalCenterThird: Image("custom.rectangle.verticalcenterthird.inset.filled")
case .bottomThird: Image(systemName: "rectangle.bottomthird.inset.filled")
case .bottomTwoThirds: Image("custom.rectangle.bottomtwothirds.inset.filled")
default: nil
}
}
Expand Down

0 comments on commit 330f4ad

Please sign in to comment.