diff --git a/Loop.xcodeproj/project.pbxproj b/Loop.xcodeproj/project.pbxproj index d887add8..ec3b6dd7 100644 --- a/Loop.xcodeproj/project.pbxproj +++ b/Loop.xcodeproj/project.pbxproj @@ -14,7 +14,6 @@ 4C6B93E82C1DCF6E00AFF832 /* Updater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B93E22C1DCF6E00AFF832 /* Updater.swift */; }; 4C6B93E92C1DCF6E00AFF832 /* UpdateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C6B93E32C1DCF6E00AFF832 /* UpdateView.swift */; }; 4CD883A42C30F0D7009A132A /* WallpaperColors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CD883A32C30F0D7009A132A /* WallpaperColors.swift */; }; - A800418A2C7C110F005AD0D3 /* Luminare in Frameworks */ = {isa = PBXBuildFile; productRef = A80041892C7C110F005AD0D3 /* Luminare */; }; A8055EC22AFEDE0B00459D13 /* Keycorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8055EC12AFEDE0B00459D13 /* Keycorder.swift */; }; A80900D52AA3F9F30085C63B /* VisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80900D32AA3F9F20085C63B /* VisualEffectView.swift */; }; A80D49BB2BAE479900493B67 /* WindowAction+Port.swift in Sources */ = {isa = PBXBuildFile; fileRef = A80D49BA2BAE479900493B67 /* WindowAction+Port.swift */; }; @@ -58,7 +57,6 @@ A87F78942BAE28050087B1DE /* CustomWindowActionSizeMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87F78932BAE28050087B1DE /* CustomWindowActionSizeMode.swift */; }; A87F78962BAE333C0087B1DE /* CustomWindowActionPositionMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87F78952BAE333C0087B1DE /* CustomWindowActionPositionMode.swift */; }; A883642F298B7288005D6C19 /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A883642E298B7288005D6C19 /* ServiceManagement.framework */; }; - A88699DE2C815E3B007EBF47 /* Luminare in Frameworks */ = {isa = PBXBuildFile; productRef = A88699DD2C815E3B007EBF47 /* Luminare */; }; A8878A252AA3B2C800850A66 /* WindowTransformAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8878A242AA3B2C800850A66 /* WindowTransformAnimation.swift */; }; A88E27AD2BDDE5300042CF04 /* CustomActionConfigurationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A88E27AC2BDDE5300042CF04 /* CustomActionConfigurationView.swift */; }; A88E83C52B37B354009D332F /* CGEvent+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A88E83C42B37B354009D332F /* CGEvent+Extensions.swift */; }; @@ -89,6 +87,7 @@ 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 */; }; + A8F404A02C82F69700C80DCC /* Luminare in Frameworks */ = {isa = PBXBuildFile; productRef = A8F4049F2C82F69700C80DCC /* Luminare */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -199,8 +198,7 @@ buildActionMask = 2147483647; files = ( A8DCC97B2980D5F500D41065 /* Defaults in Frameworks */, - A88699DE2C815E3B007EBF47 /* Luminare in Frameworks */, - A800418A2C7C110F005AD0D3 /* Luminare in Frameworks */, + A8F404A02C82F69700C80DCC /* Luminare in Frameworks */, A883642F298B7288005D6C19 /* ServiceManagement.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -486,8 +484,7 @@ name = Loop; packageProductDependencies = ( A8DCC97A2980D5F500D41065 /* Defaults */, - A80041892C7C110F005AD0D3 /* Luminare */, - A88699DD2C815E3B007EBF47 /* Luminare */, + A8F4049F2C82F69700C80DCC /* Luminare */, ); productName = WindowManager; productReference = A8E59C35297F5E9A0064D4BA /* Loop.app */; @@ -530,7 +527,7 @@ mainGroup = A8E59C2C297F5E9A0064D4BA; packageReferences = ( A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */, - A88699DC2C815E3B007EBF47 /* XCRemoteSwiftPackageReference "Luminare" */, + A8F4049E2C82F69700C80DCC /* XCRemoteSwiftPackageReference "Luminare" */, ); productRefGroup = A8E59C36297F5E9A0064D4BA /* Products */; projectDirPath = ""; @@ -897,17 +894,17 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - A88699DC2C815E3B007EBF47 /* XCRemoteSwiftPackageReference "Luminare" */ = { + A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/MrKai77/Luminare"; + repositoryURL = "https://github.com/sindresorhus/Defaults"; requirement = { branch = main; kind = branch; }; }; - A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */ = { + A8F4049E2C82F69700C80DCC /* XCRemoteSwiftPackageReference "Luminare" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/sindresorhus/Defaults"; + repositoryURL = "https://github.com/MrKai77/Luminare"; requirement = { branch = main; kind = branch; @@ -916,20 +913,16 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - A80041892C7C110F005AD0D3 /* Luminare */ = { - isa = XCSwiftPackageProductDependency; - productName = Luminare; - }; - A88699DD2C815E3B007EBF47 /* Luminare */ = { - isa = XCSwiftPackageProductDependency; - package = A88699DC2C815E3B007EBF47 /* XCRemoteSwiftPackageReference "Luminare" */; - productName = Luminare; - }; A8DCC97A2980D5F500D41065 /* Defaults */ = { isa = XCSwiftPackageProductDependency; package = A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */; productName = Defaults; }; + A8F4049F2C82F69700C80DCC /* Luminare */ = { + isa = XCSwiftPackageProductDependency; + package = A8F4049E2C82F69700C80DCC /* XCRemoteSwiftPackageReference "Luminare" */; + productName = Luminare; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = A8E59C2D297F5E9A0064D4BA /* Project object */; diff --git a/Loop/Localizable.xcstrings b/Loop/Localizable.xcstrings index 2443e8b1..4dfdc8b5 100644 --- a/Loop/Localizable.xcstrings +++ b/Loop/Localizable.xcstrings @@ -859,7 +859,7 @@ "ru" : { "stringUnit" : { "state" : "translated", - "value" : "%@ нуждается в разрешении универсального доступа" + "value" : "%@ нужны разрешения универсального доступа" } }, "zh-Hans" : { @@ -999,7 +999,7 @@ "ru" : { "stringUnit" : { "state" : "translated", - "value" : "Продвинутые" + "value" : "Дополнительные настройки" } }, "zh-Hans" : { @@ -3316,7 +3316,7 @@ "ru" : { "stringUnit" : { "state" : "translated", - "value" : "Двойное нажатие чтобы активировать" + "value" : "Двойное нажатие для активации" } }, "zh-Hans" : { @@ -7141,7 +7141,7 @@ "ru" : { "stringUnit" : { "state" : "translated", - "value" : "Зайти в Discord" + "value" : "Перейти в Discord" } }, "zh-Hans" : { @@ -7492,7 +7492,7 @@ "ru" : { "stringUnit" : { "state" : "translated", - "value" : "Влево %@" + "value" : "Левый %@" } }, "zh-Hans" : { @@ -9999,26 +9999,26 @@ "plural" : { "few" : { "stringUnit" : { - "state" : "new", - "value" : "%lld Loops left" + "state" : "translated", + "value" : "Осталось %lld Loop’ов" } }, "many" : { "stringUnit" : { - "state" : "new", - "value" : "%lld Loops left" + "state" : "translated", + "value" : "Осталось %lld Loop’ов" } }, "one" : { "stringUnit" : { - "state" : "new", - "value" : "%lld Loop left" + "state" : "translated", + "value" : "Остался %lld Loop" } }, "other" : { "stringUnit" : { - "state" : "new", - "value" : "%lld Loops left" + "state" : "translated", + "value" : "Осталось %lld Loop’ов" } } } @@ -10477,7 +10477,7 @@ "ru" : { "stringUnit" : { "state" : "translated", - "value" : "Двигать курсор за окном" + "value" : "Перемещать курсор за окном" } }, "zh-Hans" : { @@ -10547,7 +10547,7 @@ "ru" : { "stringUnit" : { "state" : "translated", - "value" : "Нет игнорированных приложений" + "value" : "Нет игнорируемых приложений" } }, "zh-Hans" : { @@ -16330,7 +16330,7 @@ "ru" : { "stringUnit" : { "state" : "translated", - "value" : "Вправо %@" + "value" : "Правый %@" } }, "zh-Hans" : { @@ -16621,7 +16621,7 @@ "ru" : { "stringUnit" : { "state" : "translated", - "value" : "Отправить" + "value" : "Обратная связь" } }, "zh-Hans" : { @@ -20768,6 +20768,12 @@ "value" : "Centro do macOS" } }, + "ru" : { + "stringUnit" : { + "state" : "translated", + "value" : "macOS Центр" + } + }, "zh-Hans" : { "stringUnit" : { "state" : "translated", @@ -22700,77 +22706,6 @@ } } }, - "Window Manipulation" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "تلاعب النافذة" - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Fenstermanipulation" - } - }, - "en-GB" : { - "stringUnit" : { - "state" : "translated", - "value" : "Window Manipulation" - } - }, - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Manipulación de ventanas" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Manipolazione finestra" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "윈도우 조작" - } - }, - "nl-BE" : { - "stringUnit" : { - "state" : "translated", - "value" : "Venster Manipulatie" - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "Manipulação de Janelas" - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "Управление окнами" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "窗口操作" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "視窗操作" - } - } - } - }, "Window snapping" : { "localizations" : { "ar" : { diff --git a/Loop/Luminare/Settings/Keybindings/CustomActionConfigurationView.swift b/Loop/Luminare/Settings/Keybindings/CustomActionConfigurationView.swift index d67e947c..66fa5846 100644 --- a/Loop/Luminare/Settings/Keybindings/CustomActionConfigurationView.swift +++ b/Loop/Luminare/Settings/Keybindings/CustomActionConfigurationView.swift @@ -46,6 +46,7 @@ struct CustomActionConfigurationView: View { ScreenView { GeometryReader { geo in let frame = action.getFrame(window: nil, bounds: CGRect(origin: .zero, size: geo.size), disablePadding: true) + let _ = print(frame) ZStack { if action.sizeMode == .custom { blurredWindow() @@ -73,10 +74,38 @@ struct CustomActionConfigurationView: View { unitToggle() } - if currentTab == .position { - positionConfiguration() - } else { - sizeConfiguration() + Group { + if currentTab == .position { + positionConfiguration() + } else { + sizeConfiguration() + } + } + .animation(LuminareSettingsWindow.animation, value: action.unit) + .onAppear { + if action.unit == nil { + action.unit = .percentage + } + + if action.sizeMode == nil { + action.sizeMode = .custom + } + + if action.width == nil { + action.width = 80 + } + + if action.height == nil { + action.height = 80 + } + + if action.positionMode == nil { + action.positionMode = .generic + } + + if action.anchor == nil { + action.anchor = .center + } } } @@ -96,21 +125,27 @@ struct CustomActionConfigurationView: View { @ViewBuilder private func actionButtons() -> some View { HStack(spacing: 8) { - Button("Preview") { - previewAction() - } - .disabled(action.sizeMode != .custom) + Button("Preview") {} + .onLongPressGesture( // Allows for a press-and-hold gesture to show the preview + minimumDuration: 100.0, + maximumDistance: .infinity, + pressing: { pressing in + if pressing { + guard let screen = NSScreen.main else { return } + previewController.open(screen: screen, startingAction: action) + } else { + previewController.close() + } + }, + perform: {} + ) + .disabled(action.sizeMode != .custom) Button("Close") { isPresented = false } } .buttonStyle(LuminareCompactButtonStyle()) } - private func previewAction() { - guard let screen = NSScreen.main else { return } - previewController.open(screen: screen, startingAction: action) - } - @ViewBuilder private func positionConfiguration() -> some View { LuminareSection { LuminareToggle( @@ -176,7 +211,7 @@ struct CustomActionConfigurationView: View { action.xPoint = $0 } ), - sliderRange: action.unit == .percentage ? + sliderRange: action.unit != .percentage ? 0...100 : 0...Double(screenSize.width), suffix: .init(action.unit?.suffix ?? CustomWindowActionUnit.percentage.suffix), @@ -193,7 +228,7 @@ struct CustomActionConfigurationView: View { action.yPoint = $0 } ), - sliderRange: action.unit == .percentage ? + sliderRange: action.unit != .percentage ? 0...100 : 0...Double(screenSize.height), suffix: .init(action.unit?.suffix ?? CustomWindowActionUnit.percentage.suffix),