summaryrefslogtreecommitdiffstats
path: root/macosx/HBThumbnailItemView.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2018-11-11 12:07:13 +0100
committerDamiano Galassi <[email protected]>2018-11-11 12:07:13 +0100
commitefcf50c4a0ff04091de5acf01e3502038b7bfe0e (patch)
treefe36ac63674d124043ab8294ab54923aba18d3be /macosx/HBThumbnailItemView.m
parent32ee37822392081e96f1192197063bce54a27ba4 (diff)
MacGui: improve preview window touch bar.
Diffstat (limited to 'macosx/HBThumbnailItemView.m')
-rw-r--r--macosx/HBThumbnailItemView.m40
1 files changed, 18 insertions, 22 deletions
diff --git a/macosx/HBThumbnailItemView.m b/macosx/HBThumbnailItemView.m
index 9a96bda0f..21f8e7ac6 100644
--- a/macosx/HBThumbnailItemView.m
+++ b/macosx/HBThumbnailItemView.m
@@ -63,28 +63,24 @@
_imageView.hidden = YES;
- dispatch_async(dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), ^{
- HBPreviewGenerator *generator = self.generator;
-
- [generator copySmallImageAtIndex:thumbnailIndex completionHandler:^(CGImageRef _Nullable result)
- {
- if (result != NULL)
- {
- NSSize size = NSMakeSize(CGImageGetWidth(result), CGImageGetHeight(result));
- NSImage *thumbnail = [[NSImage alloc] initWithCGImage:result size:size];
-
- dispatch_async(dispatch_get_main_queue(), ^{
- [self setThumbnail:thumbnail];
- });
- }
- else
- {
- dispatch_async(dispatch_get_main_queue(), ^{
- [self setThumbnail:nil];
- });
- }
- }];
- });
+ [self.generator copySmallImageAtIndex:thumbnailIndex completionHandler:^(CGImageRef _Nullable result)
+ {
+ if (result != NULL)
+ {
+ NSSize size = NSMakeSize(CGImageGetWidth(result), CGImageGetHeight(result));
+ NSImage *thumbnail = [[NSImage alloc] initWithCGImage:result size:size];
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self setThumbnail:thumbnail];
+ });
+ }
+ else
+ {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self setThumbnail:nil];
+ });
+ }
+ }];
}
@end