Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Import from Rectangle (+ Pro) #500

Merged
merged 5 commits into from
Jul 11, 2024
Merged
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
25 changes: 11 additions & 14 deletions Loop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
0A6DC3EB2BB869DE002AB05F /* WindowAction+Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A6DC3EA2BB869DE002AB05F /* WindowAction+Image.swift */; };
0AFE802E2BB98E81009CF06F /* WindowDirection+LocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AFE802D2BB98E81009CF06F /* WindowDirection+LocalizedString.swift */; };
4C0F2ACF2C3CFD09006CB34D /* RectangleTranslationLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0F2ACE2C3CFD09006CB34D /* RectangleTranslationLayer.swift */; };
4C0F2AD42C3D211F006CB34D /* Luminare in Frameworks */ = {isa = PBXBuildFile; productRef = 4C0F2AD32C3D211F006CB34D /* Luminare */; };
4C6B93E72C1DCF6E00AFF832 /* TheLoopTimes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B93E12C1DCF6E00AFF832 /* TheLoopTimes.swift */; };
4C6B93E82C1DCF6E00AFF832 /* Updater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B93E22C1DCF6E00AFF832 /* Updater.swift */; };
4C6B93E92C1DCF6E00AFF832 /* UpdateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B93E32C1DCF6E00AFF832 /* UpdateView.swift */; };
Expand Down Expand Up @@ -55,7 +57,6 @@
A87DDD152B50A6A400A32C76 /* ScreenManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87DDD142B50A6A400A32C76 /* ScreenManager.swift */; };
A87F78942BAE28050087B1DE /* CustomWindowActionSizeMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87F78932BAE28050087B1DE /* CustomWindowActionSizeMode.swift */; };
A87F78962BAE333C0087B1DE /* CustomWindowActionPositionMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87F78952BAE333C0087B1DE /* CustomWindowActionPositionMode.swift */; };
A881FC2A2C38A67C00853711 /* Luminare in Frameworks */ = {isa = PBXBuildFile; productRef = A881FC292C38A67C00853711 /* Luminare */; };
A883642F298B7288005D6C19 /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A883642E298B7288005D6C19 /* ServiceManagement.framework */; };
A8878A252AA3B2C800850A66 /* WindowTransformAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8878A242AA3B2C800850A66 /* WindowTransformAnimation.swift */; };
A88E27AD2BDDE5300042CF04 /* CustomActionConfigurationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A88E27AC2BDDE5300042CF04 /* CustomActionConfigurationView.swift */; };
Expand Down Expand Up @@ -87,12 +88,12 @@
A8F0125B2AEDD7660017307F /* WindowAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F0125A2AEDD7660017307F /* WindowAction.swift */; };
A8F1E9662C253F5B00AAF871 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = A8F1E9652C253F5B00AAF871 /* Localizable.xcstrings */; };
A8F1E9692C253F8D00AAF871 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A8F1E9672C253F8D00AAF871 /* InfoPlist.strings */; };
A8FF7A942C373B4500AF106E /* Luminare in Frameworks */ = {isa = PBXBuildFile; productRef = A8FF7A932C373B4500AF106E /* Luminare */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0A6DC3EA2BB869DE002AB05F /* WindowAction+Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WindowAction+Image.swift"; sourceTree = "<group>"; };
0AFE802D2BB98E81009CF06F /* WindowDirection+LocalizedString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WindowDirection+LocalizedString.swift"; sourceTree = "<group>"; };
4C0F2ACE2C3CFD09006CB34D /* RectangleTranslationLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RectangleTranslationLayer.swift; sourceTree = "<group>"; };
4C6B93E12C1DCF6E00AFF832 /* TheLoopTimes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TheLoopTimes.swift; sourceTree = "<group>"; };
4C6B93E22C1DCF6E00AFF832 /* Updater.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Updater.swift; sourceTree = "<group>"; };
4C6B93E32C1DCF6E00AFF832 /* UpdateView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpdateView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -187,8 +188,7 @@
buildActionMask = 2147483647;
files = (
A8DCC97B2980D5F500D41065 /* Defaults in Frameworks */,
A881FC2A2C38A67C00853711 /* Luminare in Frameworks */,
A8FF7A942C373B4500AF106E /* Luminare in Frameworks */,
4C0F2AD42C3D211F006CB34D /* Luminare in Frameworks */,
A883642F298B7288005D6C19 /* ServiceManagement.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -210,6 +210,7 @@
A80900D12AA3F9F20085C63B /* Utilities */ = {
isa = PBXGroup;
children = (
4C0F2ACE2C3CFD09006CB34D /* RectangleTranslationLayer.swift */,
A8D4327A2C13ED3C007BE4F2 /* Icon.swift */,
A82DDBDD2AEC736300D7F974 /* AnimationConfiguration.swift */,
A80900D32AA3F9F20085C63B /* VisualEffectView.swift */,
Expand Down Expand Up @@ -467,8 +468,7 @@
name = Loop;
packageProductDependencies = (
A8DCC97A2980D5F500D41065 /* Defaults */,
A8FF7A932C373B4500AF106E /* Luminare */,
A881FC292C38A67C00853711 /* Luminare */,
4C0F2AD32C3D211F006CB34D /* Luminare */,
);
productName = WindowManager;
productReference = A8E59C35297F5E9A0064D4BA /* Loop.app */;
Expand Down Expand Up @@ -506,7 +506,7 @@
mainGroup = A8E59C2C297F5E9A0064D4BA;
packageReferences = (
A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */,
A881FC282C38A67C00853711 /* XCRemoteSwiftPackageReference "Luminare" */,
4C0F2AD22C3D211F006CB34D /* XCRemoteSwiftPackageReference "Luminare" */,
);
productRefGroup = A8E59C36297F5E9A0064D4BA /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -571,6 +571,7 @@
A8789F6729805B190040512E /* RadialMenuView.swift in Sources */,
A8330ABD2A3AC0CA00673C8D /* Bundle+Extensions.swift in Sources */,
A80D49BB2BAE479900493B67 /* WindowAction+Port.swift in Sources */,
4C0F2ACF2C3CFD09006CB34D /* RectangleTranslationLayer.swift in Sources */,
A8D4327B2C13ED3C007BE4F2 /* Icon.swift in Sources */,
A86B97AD2AB79E2500099D7F /* ShakeEffect.swift in Sources */,
A8D6D3032B6C8D750061B11F /* PaddingPreviewView.swift in Sources */,
Expand Down Expand Up @@ -868,7 +869,7 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
A881FC282C38A67C00853711 /* XCRemoteSwiftPackageReference "Luminare" */ = {
4C0F2AD22C3D211F006CB34D /* XCRemoteSwiftPackageReference "Luminare" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/MrKai77/Luminare";
requirement = {
Expand All @@ -887,20 +888,16 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
A881FC292C38A67C00853711 /* Luminare */ = {
4C0F2AD32C3D211F006CB34D /* Luminare */ = {
isa = XCSwiftPackageProductDependency;
package = A881FC282C38A67C00853711 /* XCRemoteSwiftPackageReference "Luminare" */;
package = 4C0F2AD22C3D211F006CB34D /* XCRemoteSwiftPackageReference "Luminare" */;
productName = Luminare;
};
A8DCC97A2980D5F500D41065 /* Defaults */ = {
isa = XCSwiftPackageProductDependency;
package = A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */;
productName = Defaults;
};
A8FF7A932C373B4500AF106E /* Luminare */ = {
isa = XCSwiftPackageProductDependency;
productName = Luminare;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = A8E59C2D297F5E9A0064D4BA /* Project object */;
Expand Down
2 changes: 2 additions & 0 deletions Loop/Extensions/Notification+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ extension Notification.Name {
static let didLoop = Notification.Name("didLoop")
static let activeStateChanged = Notification.Name("activeStateChanged")

static let keybindsUpdated = Notification.Name("keybindsUpdated")

@discardableResult
func onReceive(object: Any? = nil, using: @escaping (Notification) -> ()) -> NSObjectProtocol {
NotificationCenter.default.addObserver(
Expand Down
24 changes: 15 additions & 9 deletions Loop/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -3322,6 +3322,9 @@
}
}
}
},
"Import keybinds from Rectangle" : {

},
"Include development versions" : {
"localizations" : {
Expand Down Expand Up @@ -3482,6 +3485,9 @@
}
}
}
},
"Join Discord" : {

},
"Keybindings" : {
"localizations" : {
Expand Down Expand Up @@ -4343,7 +4349,7 @@
}
}
},
"No updates available message 1" : {
"No updates available message 01" : {
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
Expand All @@ -4354,7 +4360,7 @@
}
}
},
"No updates available message 2" : {
"No updates available message 02" : {
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
Expand All @@ -4365,7 +4371,7 @@
}
}
},
"No updates available message 3" : {
"No updates available message 03" : {
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
Expand All @@ -4376,7 +4382,7 @@
}
}
},
"No updates available message 4" : {
"No updates available message 04" : {
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
Expand All @@ -4387,7 +4393,7 @@
}
}
},
"No updates available message 5" : {
"No updates available message 05" : {
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
Expand All @@ -4398,7 +4404,7 @@
}
}
},
"No updates available message 6" : {
"No updates available message 06" : {
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
Expand All @@ -4409,7 +4415,7 @@
}
}
},
"No updates available message 7" : {
"No updates available message 07" : {
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
Expand All @@ -4420,7 +4426,7 @@
}
}
},
"No updates available message 8" : {
"No updates available message 08" : {
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
Expand All @@ -4431,7 +4437,7 @@
}
}
},
"No updates available message 9" : {
"No updates available message 09" : {
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
Expand Down
22 changes: 13 additions & 9 deletions Loop/Luminare/Loop/AboutConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ class AboutConfigurationModel: ObservableObject {

// A max of 28 W's can fit in here :)
var upToDateText: [String] = [
.init(localized: "No updates available message 1", defaultValue: "Engage! …in the current version, it's the latest."),
.init(localized: "No updates available message 2", defaultValue: "This app is more up to date than my diary entries!"),
.init(localized: "No updates available message 3", defaultValue: "You're in the clear, no updates in the atmosphere!"),
.init(localized: "No updates available message 4", defaultValue: "The odds are ever in your favor, no updates today!"),
.init(localized: "No updates available message 5", defaultValue: "Our app is on a digital diet. No new bytes allowed."),
.init(localized: "No updates available message 6", defaultValue: "New version? Sorry, we're too attached to this one."),
.init(localized: "No updates available message 7", defaultValue: "Your Loop is Loopier than ever, no updates found!"),
.init(localized: "No updates available message 8", defaultValue: "I'm giving it all she's got, Captain! No updates!"),
.init(localized: "No updates available message 9", defaultValue: "In a galaxy far, far away… still no updates!"),
.init(localized: "No updates available message 01", defaultValue: "Engage! …in the current version, it's the latest."),
.init(localized: "No updates available message 02", defaultValue: "This app is more up to date than my diary entries!"),
.init(localized: "No updates available message 03", defaultValue: "You're in the clear, no updates in the atmosphere!"),
.init(localized: "No updates available message 04", defaultValue: "The odds are ever in your favor, no updates today!"),
.init(localized: "No updates available message 05", defaultValue: "Our app is on a digital diet. No new bytes allowed."),
.init(localized: "No updates available message 06", defaultValue: "New version? Sorry, we're too attached to this one."),
.init(localized: "No updates available message 07", defaultValue: "Your Loop is Loopier than ever, no updates found!"),
.init(localized: "No updates available message 08", defaultValue: "I'm giving it all she's got, Captain! No updates!"),
.init(localized: "No updates available message 09", defaultValue: "In a galaxy far, far away… still no updates!"),
.init(localized: "No updates available message 10", defaultValue: "You've got the precious, no updates needed!"),
.init(localized: "No updates available message 11", defaultValue: "Riding at warp speed, no updates in sight!"),
.init(localized: "No updates available message 12", defaultValue: "This is not the update you're looking for!"),
Expand Down Expand Up @@ -236,6 +236,10 @@ struct AboutConfigurationView: View {
openURL(URL(string: "https://github.com/MrKai77/Loop")!)
}

Button("Join Discord") {
openURL(URL(string: "https://discord.gg/2CZ2N6PKjq")!)
}

Button("Donate") {
openURL(URL(string: "https://github.com/sponsors/MrKai77")!)
}
Expand Down
7 changes: 7 additions & 0 deletions Loop/Luminare/Loop/AdvancedConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ struct AdvancedConfigurationView: View {
}
}

LuminareSection {
Button("Import keybinds from Rectangle") {
RectangleTranslationLayer.initiateImportProcess()
}
.buttonStyle(LuminareButtonStyle())
}

LuminareSection("Permissions") {
HStack {
if model.isAccessibilityAccessGranted {
Expand Down
26 changes: 11 additions & 15 deletions Loop/Luminare/Settings/Keybindings/KeybindingsConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,30 @@
// Created by Kai Azim on 2024-04-20.
//

import Combine
import Defaults
import Luminare
import SwiftUI

class KeybindingsConfigurationModel: ObservableObject {
@Published var triggerKey = Defaults[.triggerKey] {
didSet {
Defaults[.triggerKey] = triggerKey
}
didSet { Defaults[.triggerKey] = triggerKey }
}

@Published var triggerDelay = Defaults[.triggerDelay] {
didSet {
Defaults[.triggerDelay] = triggerDelay
}
didSet { Defaults[.triggerDelay] = triggerDelay }
}

@Published var doubleClickToTrigger = Defaults[.doubleClickToTrigger] {
didSet {
Defaults[.doubleClickToTrigger] = doubleClickToTrigger
}
didSet { Defaults[.doubleClickToTrigger] = doubleClickToTrigger }
}

@Published var middleClickTriggersLoop = Defaults[.middleClickTriggersLoop] {
didSet {
Defaults[.middleClickTriggersLoop] = middleClickTriggersLoop
}
didSet { Defaults[.middleClickTriggersLoop] = middleClickTriggersLoop }
}

@Published var keybinds = Defaults[.keybinds] {
didSet {
Defaults[.keybinds] = keybinds
}
didSet { Defaults[.keybinds] = keybinds }
}

@Published var currentEventMonitor: NSEventMonitor?
Expand Down Expand Up @@ -75,6 +66,8 @@ struct KeybindingsConfigurationView: View {
selection: $model.selectedKeybinds,
addAction: {
model.keybinds.insert(.init(.noAction), at: 0)
// Post a notification that the keybinds have been updated
NotificationCenter.default.post(name: .keybindsUpdated, object: nil)
},
content: { keybind in
KeybindingItemView(keybind)
Expand All @@ -98,5 +91,8 @@ struct KeybindingsConfigurationView: View {
addText: "Add",
removeText: "Remove"
)
.onReceive(.keybindsUpdated) { _ in
model.keybinds = Defaults[.keybinds]
}
}
}
Loading
Loading