From 625c9425610ef90b9f0692d45de8b4c7f9c17b7a Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 4 Oct 2016 17:50:56 -0700 Subject: [PATCH 1/2] Update references to MaxCDN to StackPath The latter acquired the former and requested this change. --- README.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 9df7c0aa..0e9ac10d 100644 --- a/README.markdown +++ b/README.markdown @@ -1,4 +1,4 @@ -# Sparkle [![Build Status](https://travis-ci.org/sparkle-project/Sparkle.svg?branch=master)](https://travis-ci.org/sparkle-project/Sparkle) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CocoaPods](https://img.shields.io/cocoapods/v/Sparkle.svg?maxAge=2592000)]() sponsored by: MaxCDN +# Sparkle [![Build Status](https://travis-ci.org/sparkle-project/Sparkle.svg?branch=master)](https://travis-ci.org/sparkle-project/Sparkle) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CocoaPods](https://img.shields.io/cocoapods/v/Sparkle.svg?maxAge=2592000)]() sponsored by: StackPath An easy-to-use software update framework for Cocoa developers. @@ -54,4 +54,4 @@ We pledge to have an open and welcoming environment. See our [Code of Conduct](C ## Project Sponsor -[MaxCDN](https://www.maxcdn.com/?utm_source=sparkle-github&utm_medium=link&utm_campaign=readme-footer) +[StackPath](https://www.stackpath.com/?utm_source=sparkle-github&utm_medium=link&utm_campaign=readme-footer) From 07d28972505b5515c3c94f71785f434c9a31d9c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Sun, 30 Oct 2016 16:35:15 +0100 Subject: [PATCH 2/2] Fix flickering download progress status text Fix status text during download (e.g. "10MB of 22MB") so that it no longer distractingly jumps around and flickers. This was caused by two things: 1. Flicker on macOS >= 10.8 due to the use of NSByteCountFormatter's default mode which isn't optimized for stable display and is not suitable for rapidly updated values. 2. Smaller movements of text on macOS >= 10.11 due to the use of San Francisco font's default variant, where digits don't have fixed width. Fixed by using monospacedDigitSystemFontOfSize for the text field and enabling NSByteCountFormatter's zeroPadsFractionDigits mode. --- Sparkle/SUStatus.xib | 1 + Sparkle/SUStatusController.h | 1 + Sparkle/SUStatusController.m | 9 +++++++++ Sparkle/SUUIBasedUpdateDriver.m | 5 +++-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUStatus.xib b/Sparkle/SUStatus.xib index fca3d15d..d225d6c2 100644 --- a/Sparkle/SUStatus.xib +++ b/Sparkle/SUStatus.xib @@ -10,6 +10,7 @@ + diff --git a/Sparkle/SUStatusController.h b/Sparkle/SUStatusController.h index 8a279258..03407c87 100644 --- a/Sparkle/SUStatusController.h +++ b/Sparkle/SUStatusController.h @@ -15,6 +15,7 @@ @interface SUStatusController : SUWindowController @property (weak) IBOutlet NSButton *actionButton; @property (weak) IBOutlet NSProgressIndicator *progressBar; +@property (weak) IBOutlet NSTextField *statusTextField; @property (copy) NSString *statusText; @property double progressValue; diff --git a/Sparkle/SUStatusController.m b/Sparkle/SUStatusController.m index 290bfeae..23363248 100644 --- a/Sparkle/SUStatusController.m +++ b/Sparkle/SUStatusController.m @@ -11,6 +11,7 @@ #import "SUAppcast.h" #import "SUAppcastItem.h" #import "SUVersionComparisonProtocol.h" +#import "SUOperatingSystem.h" #import "SUStatusController.h" #import "SUHost.h" @@ -28,6 +29,7 @@ @synthesize host; @synthesize actionButton; @synthesize progressBar; +@synthesize statusTextField; - (instancetype)initWithHost:(SUHost *)aHost { @@ -51,6 +53,13 @@ [[self window] center]; [[self window] setFrameAutosaveName:@"SUStatusFrame"]; [self.progressBar setUsesThreadedAnimation:YES]; + + if ([SUOperatingSystem isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 11, 0}]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + [self.statusTextField setFont:[NSFont monospacedDigitSystemFontOfSize:0 weight:NSFontWeightRegular]]; +#pragma clang diagnostic pop + } } - (NSString *)windowTitle diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index 67782212..c13d5b84 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -167,8 +167,9 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpartial-availability" - return [NSByteCountFormatter stringFromByteCount:value - countStyle:NSByteCountFormatterCountStyleFile]; + NSByteCountFormatter *formatter = [[NSByteCountFormatter alloc] init]; + [formatter setZeroPadsFractionDigits:YES]; + return [formatter stringFromByteCount:value]; #pragma clang diagnostic pop }