Revision: 27824 http://sourceforge.net/p/bibdesk/svn/27824 Author: hofman Date: 2022-08-22 21:09:13 +0000 (Mon, 22 Aug 2022) Log Message: ----------- add spinner directly to group cell view. Hide count bubble view when no image.
Modified Paths: -------------- trunk/bibdesk/BDSKGroupBubbleView.m trunk/bibdesk/BibDocument_Groups.m Modified: trunk/bibdesk/BDSKGroupBubbleView.m =================================================================== --- trunk/bibdesk/BDSKGroupBubbleView.m 2022-08-22 15:05:25 UTC (rev 27823) +++ trunk/bibdesk/BDSKGroupBubbleView.m 2022-08-22 21:09:13 UTC (rev 27824) @@ -51,12 +51,14 @@ - (id)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; - if (self && RUNNING_AFTER(10_15)) { - bgView = [[NSVisualEffectView alloc] initWithFrame:[self bounds]]; - [bgView setMaterial:BDSKHasHighContrastAppearance(NSApp) ? 4 : 7]; - [bgView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [bgView setHidden:YES]; - [self addSubview:bgView]; + if (self) { + if (RUNNING_AFTER(10_15)) { + bgView = [[NSVisualEffectView alloc] initWithFrame:[self bounds]]; + [bgView setMaterial:BDSKHasHighContrastAppearance(NSApp) ? 4 : 7]; + [bgView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + [self addSubview:bgView]; + } + [self setHidden:YES]; } return self; } @@ -63,12 +65,14 @@ - (id)initWithCoder:(NSCoder *)coder { self = [super initWithCoder:coder]; - if (self && RUNNING_AFTER(10_15)) { - bgView = [[NSVisualEffectView alloc] initWithFrame:[self bounds]]; - [bgView setMaterial:BDSKHasHighContrastAppearance(NSApp) ? 4 : 7]; - [bgView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [bgView setHidden:YES]; - [self addSubview:bgView]; + if (self) { + if (RUNNING_AFTER(10_15)) { + bgView = [[NSVisualEffectView alloc] initWithFrame:[self bounds]]; + [bgView setMaterial:BDSKHasHighContrastAppearance(NSApp) ? 4 : 7]; + [bgView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + [self addSubview:bgView]; + } + [self setHidden:YES]; } return self; } @@ -94,11 +98,9 @@ - (void)setImage:(NSImage *)image { [super setImage:image]; - if (RUNNING_AFTER(10_15)) { + if (RUNNING_AFTER(10_15)) [bgView setMaskImage:image]; - [bgView setHidden:image == nil]; - } -} + [self setHidden:image == nil];} - (void)handleKeyOrMainStateChangedNotification:(NSNotification *)note { if ([self image]) Modified: trunk/bibdesk/BibDocument_Groups.m =================================================================== --- trunk/bibdesk/BibDocument_Groups.m 2022-08-22 15:05:25 UTC (rev 27823) +++ trunk/bibdesk/BibDocument_Groups.m 2022-08-22 21:09:13 UTC (rev 27824) @@ -686,16 +686,13 @@ [spinner setUsesThreadedAnimation:YES]; [spinner setTranslatesAutoresizingMaskIntoConstraints:NO]; [spinner setContentCompressionResistancePriority:NSLayoutPriorityRequired forOrientation:NSLayoutConstraintOrientationHorizontal]; - [spinner setContentCompressionResistancePriority:NSLayoutPriorityRequired forOrientation:NSLayoutConstraintOrientationVertical]; } - NSView *bubbleView = [view bubbleView]; - [bubbleView addSubview:spinner]; + [view addSubview:spinner]; [view setProgressIndicator:spinner]; - [bubbleView addConstraints:[NSArray arrayWithObjects: - [NSLayoutConstraint constraintWithLeadingMargin:2.0 forItem:spinner toItem:bubbleView], - [NSLayoutConstraint constraintWithTrailingMargin:2.0 forItem:spinner toItem:bubbleView], - [NSLayoutConstraint constraintWithTopMargin:0.0 forItem:spinner toItem:bubbleView], - [NSLayoutConstraint constraintWithBottomMargin:0.0 forItem:spinner toItem:bubbleView], nil]]; + [view addConstraints:[NSArray arrayWithObjects: + [NSLayoutConstraint constraintWithLeadingSpacing:2.0 forItem:spinner toItem:[view nameField]], + [NSLayoutConstraint constraintWithTrailingMargin:2.0 forItem:spinner toItem:view], + [NSLayoutConstraint constraintWithCenterYOffset:0.0 forItem:spinner toItem:view], nil]]; [spinner startAnimation:nil]; [spinner release]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit