Revision: 28684
http://sourceforge.net/p/bibdesk/svn/28684
Author: hofman
Date: 2024-01-27 18:41:15 +0000 (Sat, 27 Jan 2024)
Log Message:
-----------
create arrow buttons lazily when needed
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2024-01-27
18:36:02 UTC (rev 28683)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2024-01-27
18:41:15 UTC (rev 28684)
@@ -415,16 +415,9 @@
[_subtitleCell setLineBreakMode:NSLineBreakByTruncatingTail];
[_subtitleCell setAlignment:NSTextAlignmentCenter];
- _leftArrow = [[FVArrowButton alloc] init];
- [[_leftArrow cell] setTag:FVArrowLeft];
- [_leftArrow setTarget:self];
- [_leftArrow setAction:@selector(arrowAction:)];
+ _leftArrow = nil;
+ _rightArrow = nil;
- _rightArrow = [[FVArrowButton alloc] init];
- [[_rightArrow cell] setTag:FVArrowRight];
- [_rightArrow setTarget:self];
- [_rightArrow setAction:@selector(arrowAction:)];
-
_minScale = 0.5;
_maxScale = 16.0;
@@ -3056,12 +3049,22 @@
if ([anIcon pageCount] > 1) {
- if ([_leftArrow alphaValue] > 0.0) {
- if (anIcon != [[_leftArrow cell] representedObject]) {
- [_leftArrow setAlphaValue:0.0];
- [_rightArrow setAlphaValue:0.0];
- }
+ if (_leftArrow == nil) {
+ _leftArrow = [[FVArrowButton alloc] init];
+ [[_leftArrow cell] setTag:FVArrowLeft];
+ [_leftArrow setTarget:self];
+ [_leftArrow setAction:@selector(arrowAction:)];
+
+ _rightArrow = [[FVArrowButton alloc] init];
+ [[_rightArrow cell] setTag:FVArrowRight];
+ [_rightArrow setTarget:self];
+ [_rightArrow setAction:@selector(arrowAction:)];
}
+
+ if ([_leftArrow alphaValue] > 0.0 && anIcon != [[_leftArrow cell]
representedObject]) {
+ [_leftArrow setAlphaValue:0.0];
+ [_rightArrow setAlphaValue:0.0];
+ }
// determine a min/max size for the arrow buttons
CGFloat side, sep;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit