summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-02-09 09:59:34 +0100
committerDamiano Galassi <[email protected]>2019-02-09 09:59:34 +0100
commit1728150b7e088eccc89f03ad03f9ea9dcb26cade (patch)
treec081f57de3a73482e6182ac320ad1c0f9ab3e8e7 /macosx
parent8a111ad881c006ed8eec6b9f4b4f00f5c3659b8b (diff)
MacGui: fix queue table items expanded/collapsed state after an undo/redo.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBQueueItemView.h1
-rw-r--r--macosx/HBQueueItemView.m22
2 files changed, 10 insertions, 13 deletions
diff --git a/macosx/HBQueueItemView.h b/macosx/HBQueueItemView.h
index 907108f47..4dedf3766 100644
--- a/macosx/HBQueueItemView.h
+++ b/macosx/HBQueueItemView.h
@@ -22,7 +22,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak, nullable) HBQueueItem *item;
@property (nonatomic, weak, nullable) id <HBQueueItemViewDelegate> delegate;
-@property (nonatomic) BOOL expanded;
- (void)expand;
- (void)collapse;
diff --git a/macosx/HBQueueItemView.m b/macosx/HBQueueItemView.m
index b6b8b80b1..d736fe59f 100644
--- a/macosx/HBQueueItemView.m
+++ b/macosx/HBQueueItemView.m
@@ -35,14 +35,14 @@
- (void)HB_updateLabel
{
- if (_expanded)
+ if (_item.expanded)
{
- self.textField.attributedStringValue = self.item.attributedDescription;
+ self.textField.attributedStringValue = _item.attributedDescription;
self.expandButton.state = NSOnState;
}
else
{
- self.textField.attributedStringValue = self.item.attributedTitleDescription;
+ self.textField.attributedStringValue = _item.attributedTitleDescription;
self.expandButton.state = NSOffState;
}
}
@@ -50,7 +50,7 @@
- (void)HB_updateState
{
NSImage *state = nil;
- switch (self.item.state) {
+ switch (_item.state) {
case HBQueueItemStateCompleted:
state = [NSImage imageNamed:@"EncodeComplete"];
break;
@@ -80,7 +80,7 @@
darkAqua = [self.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameDarkAqua]] == NSAppearanceNameDarkAqua ? YES : NO;
}
- if (self.item.state == HBQueueItemStateCompleted)
+ if (_item.state == HBQueueItemStateCompleted)
{
[_removeButton setAction: @selector(revealQueueItem:)];
if (self.backgroundStyle == NSBackgroundStyleEmphasized)
@@ -117,15 +117,13 @@
- (void)expand
{
self.expandButton.state = NSOnState;
- self.expanded = YES;
- self.textField.attributedStringValue = self.item.attributedDescription;
+ self.textField.attributedStringValue = _item.attributedDescription;
}
- (void)collapse
{
self.expandButton.state = NSOffState;
- self.expanded = NO;
- self.textField.attributedStringValue = self.item.attributedTitleDescription;
+ self.textField.attributedStringValue = _item.attributedTitleDescription;
}
- (BOOL)isFlipped
@@ -140,17 +138,17 @@
- (IBAction)revealQueueItem:(id)sender
{
- [self.delegate revealQueueItem:self.item];
+ [self.delegate revealQueueItem:_item];
}
- (IBAction)removeQueueItem:(id)sender
{
- [self.delegate removeQueueItem:self.item];
+ [self.delegate removeQueueItem:_item];
}
- (IBAction)toggleHeight:(id)sender
{
- [self.delegate toggleQueueItemHeight:self.item];
+ [self.delegate toggleQueueItemHeight:_item];
}
@end