Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 29, 2020
1 parent c114d1f commit 0453b21
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 124 deletions.
2 changes: 1 addition & 1 deletion Gifski/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
NSApp.isAutomaticCustomizeTouchBarMenuItemEnabled = true
NSApp.servicesProvider = self

// Set launch completions option if the notification center could not be set up already
// Set launch completions option if the notification center could not be set up already.
LaunchCompletions.applicationDidLaunch()
}

Expand Down
2 changes: 1 addition & 1 deletion Gifski/Constants.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Cocoa
import Defaults

struct Constants {
enum Constants {
static let defaultWindowSize = CGSize(width: 360, height: 240)
static let backgroundImage = NSImage(named: "BackgroundImage")!
static let allowedFrameRate = 5.0...50.0
Expand Down
8 changes: 5 additions & 3 deletions Gifski/EditVideoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ final class EditVideoViewController: NSViewController {
NSAlert.showModal(
for: view.window,
message: "Animated GIF Limitation",
informativeText: "Exporting GIFs with a frame rate higher than 50 is not supported as browsers will throttle and play them at 10 FPS."
informativeText: "Exporting GIFs with a frame rate higher than 50 is not supported as browsers will throttle and play them at 10 FPS.",
defaultButtonIndex: -1
)
}
}
Expand All @@ -309,7 +310,8 @@ final class EditVideoViewController: NSViewController {
NSAlert.showModal(
for: view.window,
message: "Animated GIF Preview Limitation",
informativeText: "Due to a bug in the macOS GIF animation handling, the after-conversion preview and Quick Look may not loop as expected. The GIF will work properly in web browsers and other image viewing apps."
informativeText: "Due to a bug in the macOS GIF handling, the after-conversion preview and Quick Look may not loop as expected. The GIF will loop correctly in web browsers and other image viewing apps.",
defaultButtonIndex: -1
)
}
}
Expand Down Expand Up @@ -481,7 +483,7 @@ final class EditVideoViewController: NSViewController {
let gifski = Gifski()
self.gifski = gifski

setEstimatedFileSize(getNaiveEstimate().attributedString + " Calculating Accurate Estimate…".attributedString.withColor(.secondaryLabelColor).withFontSize(NSFont.smallSystemFontSize.double))
setEstimatedFileSize(getNaiveEstimate().attributedString + " Calculating Estimate…".attributedString.withColor(.secondaryLabelColor).withFontSize(NSFont.smallSystemFontSize.double))

gifski.run(conversionSettings, isEstimation: true) { [weak self] result in
guard let self = self else {
Expand Down
2 changes: 1 addition & 1 deletion Gifski/MainWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class MainWindowController: NSWindowController {
message: "Feedback Welcome 🙌🏻",
informativeText:
"""
If you have any feedback, bug reports, or feature requests, kindly use the “Send Feedback” button in the “Help” menu. We respond to all submissions. It's preferable that you report bugs this way rather than as an App Store review, since the App Store will not allow us to contact you for more information.
If you have any feedback, bug report, or feature request, there's a feedback button in the “Help” menu. We respond to all submissions.
""",
buttonTitles: [
"Get Started"
Expand Down
2 changes: 1 addition & 1 deletion Gifski/Shared.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct Shared {
enum Shared {
static let appIdentifierPrefix = Bundle.main.infoDictionary!["AppIdentifierPrefix"] as! String
static let videoShareGroupIdentifier = "\(appIdentifierPrefix)gifski_video_share_group"
}
9 changes: 8 additions & 1 deletion Gifski/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ enum AVFormat: String {
case hevc
case h264
case av1
case vp9
case appleProResRAWHQ
case appleProResRAW
case appleProRes4444XQ
Expand Down Expand Up @@ -751,6 +752,8 @@ enum AVFormat: String {
self = .h264
case "av01":
self = .av1
case "vp09":
self = .vp9
case "aprh": // From https://avpres.net/Glossar/ProResRAW.html
self = .appleProResRAWHQ
case "aprn":
Expand Down Expand Up @@ -802,6 +805,8 @@ enum AVFormat: String {
return "avc1"
case .av1:
return "av01"
case .vp9:
return "vp09"
case .appleProResRAWHQ:
return "aprh"
case .appleProResRAW:
Expand Down Expand Up @@ -867,6 +872,8 @@ extension AVFormat: CustomStringConvertible {
return "H264"
case .av1:
return "AV1"
case .vp9:
return "VP9"
case .appleProResRAWHQ:
return "Apple ProRes RAW HQ"
case .appleProResRAW:
Expand Down Expand Up @@ -3518,7 +3525,7 @@ extension NSFont {
Self(descriptor: descriptor, size: 0) ?? self
}

// TODO: When Xcode 12.2 is out, use `[NSFont fontWithSize:]` when available.
// TODO: Remove this when targeting macOS 10.15 as it's then built-in.
/// Returns a font with the size replaced.
/// UIKit polyfill.
func withSize(_ size: CGFloat) -> NSFont {
Expand Down

0 comments on commit 0453b21

Please sign in to comment.