diff options
author | Damiano Galassi <[email protected]> | 2019-07-30 10:29:01 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2019-07-30 10:29:01 +0200 |
commit | c24a22e18ce1142bf370d753d76ed2fbfd4df4ab (patch) | |
tree | 6830b8f4a19f6681f4223e92f893f67370420232 | |
parent | 4e2d5908db8f7103d0010e7e086e1ca07142efa1 (diff) |
MacGui: set the progress labels to a monospaced digit font.
-rw-r--r-- | macosx/HBController.m | 9 | ||||
-rw-r--r-- | macosx/HBQueueInfoViewController.m | 11 | ||||
-rw-r--r-- | macosx/HBQueueItemWorkingView.m | 4 |
3 files changed, 19 insertions, 5 deletions
diff --git a/macosx/HBController.m b/macosx/HBController.m index 3c995deee..8b0e9f95c 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -136,7 +136,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext; @property (nonatomic) BOOL visible; /// Queue progress info -@property (nonatomic, copy) NSAttributedString *progressInfo; +@property (nonatomic, copy) NSString *progressInfo; @property (nonatomic) double progress; @property (nonatomic, readwrite) NSColor *labelColor; @@ -183,7 +183,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext; _scanSpecificTitleIdx = 1; // Progress - _progressInfo = [[NSAttributedString alloc] initWithString:@""]; + _progressInfo = @""; // Check to see if the last destination has been set, use if so, if not, use Movies #ifdef __SANDBOX_ENABLED__ @@ -220,6 +220,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext; [self enableUI:NO]; // Bottom + fStatusField.font = [NSFont monospacedDigitSystemFontOfSize:NSFont.smallSystemFontSize weight:NSFontWeightRegular]; fRipIndicator.hidden = YES; [self updateProgress]; @@ -309,7 +310,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext; { info = note.userInfo[HBQueueProgressNotificationInfoKey]; } - self.progressInfo = info.HB_smallMonospacedString; + self.progressInfo = info; self.progress = [note.userInfo[HBQueueProgressNotificationPercentKey] doubleValue]; if (self->_visible) @@ -1027,7 +1028,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext; - (void)updateProgress { - fStatusField.attributedStringValue = self.progressInfo; + fStatusField.stringValue = self.progressInfo; fRipIndicator.doubleValue = self.progress; } diff --git a/macosx/HBQueueInfoViewController.m b/macosx/HBQueueInfoViewController.m index 3b8a6e247..0521ccc04 100644 --- a/macosx/HBQueueInfoViewController.m +++ b/macosx/HBQueueInfoViewController.m @@ -40,6 +40,8 @@ - (void)setUpObservers { + // It would be easier to just KVO the item state property, + // But we can't because the item is a NSProxy. NSNotificationCenter * __weak center = NSNotificationCenter.defaultCenter; [center addObserverForName:HBQueueDidStartItemNotification @@ -67,6 +69,15 @@ [self updateReset]; } }]; + + [center addObserverForName:HBQueueDidChangeItemNotification + object:nil + queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) + { + [self updateLabels]; + [self updateReset]; + }]; + } - (void)updateReset diff --git a/macosx/HBQueueItemWorkingView.m b/macosx/HBQueueItemWorkingView.m index cedfdb224..fcef24707 100644 --- a/macosx/HBQueueItemWorkingView.m +++ b/macosx/HBQueueItemWorkingView.m @@ -34,7 +34,7 @@ NSString *progressInfo = note.userInfo[HBQueueProgressNotificationInfoKey]; double progress = [note.userInfo[HBQueueProgressNotificationPercentKey] doubleValue]; - self.progressField.attributedStringValue = progressInfo.HB_smallMonospacedString; + self.progressField.stringValue = progressInfo; self.progressBar.doubleValue = progress; }]; @@ -47,6 +47,8 @@ [self removeObservers]; } }]; + + self.progressField.font = [NSFont monospacedDigitSystemFontOfSize:NSFont.smallSystemFontSize weight:NSFontWeightRegular]; } - (void)removeObservers |