]> granicus.if.org Git - handbrake/commitdiff
MacGui: set the progress labels to a monospaced digit font.
authorDamiano Galassi <damiog@gmail.com>
Tue, 30 Jul 2019 08:29:01 +0000 (10:29 +0200)
committerDamiano Galassi <damiog@gmail.com>
Tue, 30 Jul 2019 08:29:01 +0000 (10:29 +0200)
macosx/HBController.m
macosx/HBQueueInfoViewController.m
macosx/HBQueueItemWorkingView.m

index 3c995deeedf6f89503295d82cd715d64d80bc56a..8b0e9f95c0536d25e91d9c92eecbd4b20f566950 100644 (file)
@@ -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;
 }
 
index 3b8a6e24748c30990625aa5d943747858f9d1274..0521ccc0497baa21b55e9992bd3198b8821e1529 100644 (file)
@@ -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
              [self updateReset];
          }
      }];
+
+    [center addObserverForName:HBQueueDidChangeItemNotification
+                        object:nil
+                         queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note)
+     {
+         [self updateLabels];
+         [self updateReset];
+     }];
+
 }
 
 - (void)updateReset
index cedfdb2245a1deb5515132db86799e0598848283..fcef2470768362a016e53ed1b9d3183832e95afc 100644 (file)
@@ -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