-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
1,377 additions
and
889 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
ShiftWindow/Assets.xcassets/AccentColor.colorset/Contents.json
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
ShiftWindow/Assets.xcassets/Preferences/Checkmark.imageset/Contents.json
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-1.04 KB
ShiftWindow/Assets.xcassets/Preferences/Checkmark.imageset/checkmark.png
Binary file not shown.
Binary file removed
BIN
-406 Bytes
ShiftWindow/Assets.xcassets/Preferences/Checkmark.imageset/checkmark@2x.png
Binary file not shown.
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
ShiftWindow/Assets.xcassets/Preferences/General.imageset/Contents.json
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-1.86 KB
ShiftWindow/Assets.xcassets/Preferences/General.imageset/general.png
Binary file not shown.
Binary file removed
BIN
-3.14 KB
ShiftWindow/Assets.xcassets/Preferences/General.imageset/general@2x.png
Binary file not shown.
21 changes: 0 additions & 21 deletions
21
ShiftWindow/Assets.xcassets/Preferences/Shortcuts.imageset/Contents.json
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-1.48 KB
ShiftWindow/Assets.xcassets/Preferences/Shortcuts.imageset/shortcuts.png
Binary file not shown.
Binary file removed
BIN
-2.69 KB
ShiftWindow/Assets.xcassets/Preferences/Shortcuts.imageset/shortcuts@2x.png
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// SettingsTabType.swift | ||
// ShiftWindow | ||
// | ||
// Created by Takuto Nakamura on 2023/01/24. | ||
// | ||
// Copyright 2023 Takuto Nakamura (Kyome22) | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
enum SettingsTabType { | ||
case general | ||
case shortcuts | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// | ||
// ShiftPattern.swift | ||
// ShiftWindow | ||
// | ||
// Created by Takuto Nakamura on 2021/07/31. | ||
// | ||
// Copyright 2021 Takuto Nakamura (Kyome22) | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import AppKit | ||
import SwiftUI | ||
import SpiceKey | ||
|
||
final class ShiftPattern: Codable { | ||
enum CodingKeys: String, CodingKey { | ||
case shiftType | ||
case spiceKeyData | ||
} | ||
|
||
let shiftType: ShiftType | ||
var spiceKeyData: SpiceKeyData? | ||
|
||
var titleKey: LocalizedStringKey { | ||
return shiftType.titleKey | ||
} | ||
var title: String { | ||
return shiftType.id.localized | ||
} | ||
var imageTitle: String { | ||
return shiftType.imageTitle | ||
} | ||
var image: NSImage { | ||
return shiftType.image | ||
} | ||
var keyString: String? { | ||
return spiceKeyData?.key?.string | ||
} | ||
var modifierMask: NSEvent.ModifierFlags? { | ||
return spiceKeyData?.modifierFlags?.flags | ||
} | ||
var keyCombination: KeyCombination? { | ||
return spiceKeyData?.keyCombination | ||
} | ||
var description: String { | ||
let str = spiceKeyData?.keyCombination?.string ?? "nil" | ||
return "type: \(titleKey), spiceKeyData: \(str)" | ||
} | ||
|
||
init(shiftType: ShiftType) { | ||
self.shiftType = shiftType | ||
} | ||
|
||
init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
shiftType = try container.decode(ShiftType.self, forKey: .shiftType) | ||
spiceKeyData = try container.decodeIfPresent(SpiceKeyData.self, forKey: .spiceKeyData) | ||
} | ||
|
||
func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encode(shiftType, forKey: .shiftType) | ||
try container.encodeIfPresent(spiceKeyData, forKey: .spiceKeyData) | ||
} | ||
|
||
static let `defaults`: [ShiftPattern] = [ | ||
ShiftPattern(shiftType: .topHalf), | ||
ShiftPattern(shiftType: .bottomHalf), | ||
ShiftPattern(shiftType: .leftHalf), | ||
ShiftPattern(shiftType: .rightHalf), | ||
ShiftPattern(shiftType: .leftThird), | ||
ShiftPattern(shiftType: .leftTwoThirds), | ||
ShiftPattern(shiftType: .middleThird), | ||
ShiftPattern(shiftType: .rightTwoThirds), | ||
ShiftPattern(shiftType: .rightThird), | ||
ShiftPattern(shiftType: .maximize) | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// WindowType.swift | ||
// ShiftWindow | ||
// | ||
// Created by Takuto Nakamura on 2023/01/24. | ||
// | ||
// Copyright 2023 Takuto Nakamura (Kyome22) | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
enum WindowType { | ||
case preferences | ||
case about | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.