diff options
author | Damiano Galassi <[email protected]> | 2020-01-29 15:57:51 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2020-01-29 15:57:51 +0100 |
commit | 1d4fb22294f7c33358cde3c1dd8a741f6a489f2f (patch) | |
tree | e4d790081850315560b56fe9b1a1b8fe8d7e99f6 | |
parent | 2056dda7f2662d54eb585ca91aa73952dff6b3c9 (diff) |
MacGui: improve divider and scrollbar flashes in the queue info panel.
-rw-r--r-- | macosx/HBQueueInfoViewController.m | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/macosx/HBQueueInfoViewController.m b/macosx/HBQueueInfoViewController.m index 83659c2c5..e2e0872c6 100644 --- a/macosx/HBQueueInfoViewController.m +++ b/macosx/HBQueueInfoViewController.m @@ -53,8 +53,7 @@ if (startedItem == self.item) { - [self updateLabels]; - [self updateReset]; + [self updateUI]; } }]; @@ -66,8 +65,7 @@ if (completedItem == self.item) { - [self updateLabels]; - [self updateReset]; + [self updateUI]; } }]; @@ -75,12 +73,20 @@ object:nil queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) { - [self updateLabels]; - [self updateReset]; + [self updateUI]; }]; } +- (void)updateUI +{ + [self updateLabels]; + [self updateReset]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateDivider]; + }); +} + - (void)updateReset { self.canReset = self.item && (self.item.state != HBQueueItemStateWorking && self.item.state != HBQueueItemStateReady); @@ -97,7 +103,9 @@ self.statisticsLabel.attributedStringValue = self.item.attributedStatistics; self.summaryLabel.attributedStringValue = self.item.attributedDescription; - [self.scrollView flashScrollers]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self.scrollView flashScrollers]; + }); } else { @@ -107,17 +115,21 @@ } } +- (void)updateDivider +{ + self.divider.hidden = self.scrollView.frame.size.height > self.scrollView.contentView.documentView.frame.size.height; +} + - (void)viewDidLayout { [super viewDidLayout]; - self.divider.hidden = self.scrollView.frame.size.height > self.scrollView.contentView.documentView.frame.size.height; + [self updateDivider]; } - (void)setItem:(HBQueueItem *)item { _item = item; - [self updateLabels]; - [self updateReset]; + [self updateUI]; } - (IBAction)editItem:(id)sender |