You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2025-03-25 22:56:21
|
Revision: 15023 http://sourceforge.net/p/skim-app/code/15023 Author: hofman Date: 2025-03-25 22:56:08 +0000 (Tue, 25 Mar 2025) Log Message: ----------- use macro Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-25 18:35:22 UTC (rev 15022) +++ trunk/SKColorSwatch.m 2025-03-25 22:56:08 UTC (rev 15023) @@ -243,7 +243,7 @@ NSInteger i = anIndex; if (collapsedIndex != -1 && anIndex > collapsedIndex) i--; - NSRect rect = NSInsetRect([self frameForColorAtIndex:i], -2.0, -2.0); + NSRect rect = NSInsetRect([self frameForColorAtIndex:i], -COLOR_INSET, -COLOR_INSET); if (collapsedIndex == anIndex) rect.size.width -= DISTANCE_BETWEEN_COLORS; return rect; @@ -991,7 +991,7 @@ NSRect rect = [self bounds]; if (NSWidth(rect) < 5.0) return; - rect = NSInsetRect(rect, 2.0, 2.0); + rect = NSInsetRect(rect, COLOR_INSET, COLOR_INSET); CGFloat r = swatchRadius([(SKColorSwatch *)[self superview] controlSize]); BOOL disabled = NO; if (@available(macOS 10.14, *)) @@ -1049,9 +1049,9 @@ [path lineToPoint:NSMakePoint(NSMaxX(rect) + 0.5, NSMaxY(rect) + 1.0)]; } [path setLineWidth:3.0]; - if ((dropLocation == SKColorSwatchDropBefore && NSMinX([[self superview] bounds]) + 2.0 >= NSMinX([self frame])) || - (dropLocation == SKColorSwatchDropAfter && NSMaxX([[self superview] bounds]) - 2.0 <= NSMaxX([self frame]))) - [[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(rect, -2.0, -2.0) xRadius:r + 2.0 yRadius:r + 2.0] addClip]; + if ((dropLocation == SKColorSwatchDropBefore && NSMinX([[self superview] bounds]) + COLOR_INSET >= NSMinX([self frame])) || + (dropLocation == SKColorSwatchDropAfter && NSMaxX([[self superview] bounds]) - COLOR_INSET <= NSMaxX([self frame]))) + [[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(rect, -COLOR_INSET, -COLOR_INSET) xRadius:r + COLOR_INSET yRadius:r + COLOR_INSET] addClip]; [path stroke]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-25 18:35:31
|
Revision: 15022 http://sourceforge.net/p/skim-app/code/15022 Author: hofman Date: 2025-03-25 18:35:22 +0000 (Tue, 25 Mar 2025) Log Message: ----------- define bezel width offsets in inline function Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-25 18:28:16 UTC (rev 15021) +++ trunk/SKColorSwatch.m 2025-03-25 18:35:22 UTC (rev 15022) @@ -67,11 +67,6 @@ #define LARGE_SIZE_HEIGHT_OUTSET 4.5 #define LARGE_SIZE_WIDTH_OUTSET 5.0 -#define BEZEL_WIDTH_OFFSET_REGULAR 4.0 -#define BEZEL_WIDTH_OFFSET_SMALL 0.0 -#define BEZEL_WIDTH_OFFSET_MINI 0.0 -#define BEZEL_WIDTH_OFFSET_LARGE 2.0 - #define SKControlSizeLarge 3 static inline CGFloat swatchRadius(NSControlSize controlSize) { @@ -93,6 +88,16 @@ } } +static inline CGFloat bezelWidthOffset(NSControlSize controlSize) { + switch (controlSize) { + case NSControlSizeRegular: return 4.0; + case NSControlSizeSmall: return 0.0; + case NSControlSizeMini: return 0.0; + case SKControlSizeLarge: return 2.0; + default: return 4.0; + } +} + @interface SKColorSwatchBackgroundView : NSControl @property (nonatomic) CGFloat bezelWidth; @end @@ -900,7 +905,7 @@ NSSegmentedCell *cell = [[NSSegmentedCell alloc] init]; [cell setSegmentCount:1]; [cell setSegmentStyle:NSSegmentStyleTexturedSquare]; - [cell setWidth:fmax(0.0, NSWidth(frameRect) - BEZEL_WIDTH_OFFSET_REGULAR - BEZEL_INSET_LEFT - BEZEL_INSET_RIGHT) forSegment:0]; + [cell setWidth:fmax(0.0, NSWidth(frameRect) - bezelWidthOffset(NSControlSizeRegular) - BEZEL_INSET_LEFT - BEZEL_INSET_RIGHT) forSegment:0]; [self setCell:cell]; } return self; @@ -908,22 +913,12 @@ - (BOOL)canBecomeKeyView { return NO; } -- (CGFloat)bezelWidthOffset { - switch ([self controlSize]) { - case NSControlSizeRegular: return BEZEL_WIDTH_OFFSET_REGULAR; - case NSControlSizeSmall: return BEZEL_WIDTH_OFFSET_SMALL; - case NSControlSizeMini: return BEZEL_WIDTH_OFFSET_MINI; - case SKControlSizeLarge: return BEZEL_WIDTH_OFFSET_LARGE; - default: return BEZEL_WIDTH_OFFSET_REGULAR; - } -} - - (CGFloat)bezelWidth { - return [[self cell] widthForSegment:0] + [self bezelWidthOffset]; + return [[self cell] widthForSegment:0] + bezelWidthOffset([self controlSize]); } - (void)setBezelWidth:(CGFloat)width { - [[self cell] setWidth:width - [self bezelWidthOffset] forSegment:0]; + [[self cell] setWidth:width - bezelWidthOffset([self controlSize]) forSegment:0]; [self setNeedsDisplay:YES]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-25 18:28:21
|
Revision: 15021 http://sourceforge.net/p/skim-app/code/15021 Author: hofman Date: 2025-03-25 18:28:16 +0000 (Tue, 25 Mar 2025) Log Message: ----------- Derive swatch drawing radius from controlSize Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-25 18:12:07 UTC (rev 15020) +++ trunk/SKColorSwatch.m 2025-03-25 18:28:16 UTC (rev 15021) @@ -74,6 +74,25 @@ #define SKControlSizeLarge 3 +static inline CGFloat swatchRadius(NSControlSize controlSize) { + if (@available(macOS 11.0, *)) { + switch (controlSize) { + case NSControlSizeRegular: return 3.0; + case NSControlSizeSmall: return 2.0; + case NSControlSizeMini: return 1.0; + case NSControlSizeLarge: return 4.0; + default: return 3.0; + } + } else { + switch (controlSize) { + case NSControlSizeRegular: return 2.0; + case NSControlSizeSmall: return 1.0; + case NSControlSizeMini: return 0.5; + default: return 2.0; + } + } +} + @interface SKColorSwatchBackgroundView : NSControl @property (nonatomic) CGFloat bezelWidth; @end @@ -312,12 +331,7 @@ - (void)drawFocusRingMask { NSRect rect = [self focusRingMaskBounds]; if (NSIsEmptyRect(rect) == NO) { - CGFloat r = 3.0; - if (@available(macOS 11.0, *)) - r = ceil(0.25 * bezelHeight) - 3.0; - else - r = floor(0.25 * bezelHeight) - 3.0; - r = fmax(0.5, r); + CGFloat r = swatchRadius([self controlSize]); [[NSBezierPath bezierPathWithRoundedRect:rect xRadius:r yRadius:r] fill]; } } @@ -386,9 +400,7 @@ NSColor *color = [colors objectAtIndex:i]; - CGFloat r = 1.5; - if (@available(macOS 11.0, *)) - r = 2.5; + CGFloat r = swatchRadius(NSControlSizeRegular) - 0.5; NSImage *image = [NSImage bitmapImageWithSize:NSMakeSize(12.0, 12.0) forView:self drawingHandler:^(NSRect rect){ [color drawSwatchInRect:NSInsetRect(rect, 1.0, 1.0)]; @@ -985,12 +997,7 @@ if (NSWidth(rect) < 5.0) return; rect = NSInsetRect(rect, 2.0, 2.0); - CGFloat r = 3.0; - if (@available(macOS 11.0, *)) - r = ceil(0.25 * NSHeight(rect)) - 2.0; - else - r = floor(0.25 * NSHeight(rect) - 2.0); - r = fmax(0.5, r); + CGFloat r = swatchRadius([(SKColorSwatch *)[self superview] controlSize]); BOOL disabled = NO; if (@available(macOS 10.14, *)) disabled = [[self window] isMainWindow] == NO && [[self window] isKeyWindow] == NO && ([self isDescendantOf:[[self window] contentView]] == NO || [[self window] isKindOfClass:NSClassFromString(@"NSToolbarSnapshotWindow")]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-25 18:12:19
|
Revision: 15020 http://sourceforge.net/p/skim-app/code/15020 Author: hofman Date: 2025-03-25 18:12:07 +0000 (Tue, 25 Mar 2025) Log Message: ----------- Fix layout of color swatch background with large size. Make radius of color swatches dependent on size. Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-24 17:09:26 UTC (rev 15019) +++ trunk/SKColorSwatch.m 2025-03-25 18:12:07 UTC (rev 15020) @@ -58,15 +58,22 @@ #define COLOR_KEY @"color" -#define BEZEL_INSET_LEFTRIGHT 1.0 -#define BEZEL_INSET_TOP 1.0 -#define BEZEL_INSET_BOTTOM 2.0 -#define COLOR_INSET 2.0 +#define BEZEL_INSET_LEFT 1.0 +#define BEZEL_INSET_RIGHT 1.0 +#define BEZEL_INSET_TOP 1.0 +#define BEZEL_INSET_BOTTOM 2.0 +#define COLOR_INSET 2.0 -#define LARGE_SIZE_HEIGHT_OFFSET 10.0 -#define LARGE_SIZE_WIDTH_OUTSET 6.0 -#define REGULAR_BEZEL_WIDTH_OFFSET 4.0 +#define LARGE_SIZE_HEIGHT_OUTSET 4.5 +#define LARGE_SIZE_WIDTH_OUTSET 5.0 +#define BEZEL_WIDTH_OFFSET_REGULAR 4.0 +#define BEZEL_WIDTH_OFFSET_SMALL 0.0 +#define BEZEL_WIDTH_OFFSET_MINI 0.0 +#define BEZEL_WIDTH_OFFSET_LARGE 2.0 + +#define SKControlSizeLarge 3 + @interface SKColorSwatchBackgroundView : NSControl @property (nonatomic) CGFloat bezelWidth; @end @@ -257,7 +264,7 @@ } - (NSEdgeInsets)alignmentRectInsets { - return NSEdgeInsetsMake(BEZEL_INSET_TOP, BEZEL_INSET_LEFTRIGHT, BEZEL_INSET_BOTTOM, BEZEL_INSET_LEFTRIGHT); + return NSEdgeInsetsMake(BEZEL_INSET_TOP, BEZEL_INSET_LEFT, BEZEL_INSET_BOTTOM, BEZEL_INSET_RIGHT); } - (void)updateSubviewLayout { @@ -269,10 +276,8 @@ - (void)updateBezelHeight { CGFloat height = [[backgroundView cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; - if (@available(macOS 11.0, *)) { - if ([backgroundView controlSize] == NSControlSizeLarge) - height -= LARGE_SIZE_HEIGHT_OFFSET; - } + if ([backgroundView controlSize] == SKControlSizeLarge) + height -= 2.0 * LARGE_SIZE_HEIGHT_OUTSET; if (fabs(height - bezelHeight) > 0.0) { bezelHeight = height; [self updateSubviewLayout]; @@ -286,7 +291,12 @@ if (controlSize != [self controlSize]) { [super setControlSize:controlSize]; [backgroundView setControlSize:controlSize]; - [backgroundView setFrame:controlSize == 3 ? NSInsetRect([self bounds], -LARGE_SIZE_WIDTH_OUTSET, 0.0) : [self bounds]]; + NSRect bgFrame = [self bounds]; + if (controlSize == SKControlSizeLarge) { + bgFrame = NSInsetRect(bgFrame, -LARGE_SIZE_WIDTH_OUTSET, -LARGE_SIZE_HEIGHT_OUTSET); + bgFrame.origin.y = ceil(bgFrame.origin.y); + } + [backgroundView setFrame:bgFrame]; [self updateBezelHeight]; } } @@ -302,9 +312,12 @@ - (void)drawFocusRingMask { NSRect rect = [self focusRingMaskBounds]; if (NSIsEmptyRect(rect) == NO) { - CGFloat r = 2.0; + CGFloat r = 3.0; if (@available(macOS 11.0, *)) - r = 3.0; + r = ceil(0.25 * bezelHeight) - 3.0; + else + r = floor(0.25 * bezelHeight) - 3.0; + r = fmax(0.5, r); [[NSBezierPath bezierPathWithRoundedRect:rect xRadius:r yRadius:r] fill]; } } @@ -601,7 +614,7 @@ for (SKColorSwatchItemView *itemView in itemViews) [[itemView animator] setFrame:[self frameForItemViewAtIndex:i++ collapsedIndex:collapsedIndex]]; if (NSEqualSizes(size, NSZeroSize) == NO) { - [[backgroundView animator] setBezelWidth:size.width - 2.0 * BEZEL_INSET_LEFTRIGHT]; + [[backgroundView animator] setBezelWidth:size.width - BEZEL_INSET_LEFT - BEZEL_INSET_RIGHT]; if (autoResizes) [[self animator] setFrameSize:size]; } @@ -875,7 +888,7 @@ NSSegmentedCell *cell = [[NSSegmentedCell alloc] init]; [cell setSegmentCount:1]; [cell setSegmentStyle:NSSegmentStyleTexturedSquare]; - [cell setWidth:fmax(0.0, NSWidth(frameRect) - REGULAR_BEZEL_WIDTH_OFFSET - 2.0 * BEZEL_INSET_LEFTRIGHT) forSegment:0]; + [cell setWidth:fmax(0.0, NSWidth(frameRect) - BEZEL_WIDTH_OFFSET_REGULAR - BEZEL_INSET_LEFT - BEZEL_INSET_RIGHT) forSegment:0]; [self setCell:cell]; } return self; @@ -883,14 +896,22 @@ - (BOOL)canBecomeKeyView { return NO; } -#define BEZEL_WIDTH_OFFSET ([self controlSize] == NSControlSizeRegular ? REGULAR_BEZEL_WIDTH_OFFSET : 0.0) +- (CGFloat)bezelWidthOffset { + switch ([self controlSize]) { + case NSControlSizeRegular: return BEZEL_WIDTH_OFFSET_REGULAR; + case NSControlSizeSmall: return BEZEL_WIDTH_OFFSET_SMALL; + case NSControlSizeMini: return BEZEL_WIDTH_OFFSET_MINI; + case SKControlSizeLarge: return BEZEL_WIDTH_OFFSET_LARGE; + default: return BEZEL_WIDTH_OFFSET_REGULAR; + } +} - (CGFloat)bezelWidth { - return [[self cell] widthForSegment:0] + BEZEL_WIDTH_OFFSET; + return [[self cell] widthForSegment:0] + [self bezelWidthOffset]; } - (void)setBezelWidth:(CGFloat)width { - [[self cell] setWidth:width - BEZEL_WIDTH_OFFSET forSegment:0]; + [[self cell] setWidth:width - [self bezelWidthOffset] forSegment:0]; [self setNeedsDisplay:YES]; } @@ -964,9 +985,12 @@ if (NSWidth(rect) < 5.0) return; rect = NSInsetRect(rect, 2.0, 2.0); - CGFloat r = 2.0; + CGFloat r = 3.0; if (@available(macOS 11.0, *)) - r = 3.0; + r = ceil(0.25 * NSHeight(rect)) - 2.0; + else + r = floor(0.25 * NSHeight(rect) - 2.0); + r = fmax(0.5, r); BOOL disabled = NO; if (@available(macOS 10.14, *)) disabled = [[self window] isMainWindow] == NO && [[self window] isKeyWindow] == NO && ([self isDescendantOf:[[self window] contentView]] == NO || [[self window] isKindOfClass:NSClassFromString(@"NSToolbarSnapshotWindow")]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 17:09:28
|
Revision: 15019 http://sourceforge.net/p/skim-app/code/15019 Author: hofman Date: 2025-03-24 17:09:26 +0000 (Mon, 24 Mar 2025) Log Message: ----------- Use macro instead of method Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-24 17:03:06 UTC (rev 15018) +++ trunk/SKColorSwatch.m 2025-03-24 17:09:26 UTC (rev 15019) @@ -197,9 +197,7 @@ #pragma mark Layout -- (CGFloat)distanceBetweenColors { - return bezelHeight - COLOR_INSET; -} +#define DISTANCE_BETWEEN_COLORS (bezelHeight - COLOR_INSET) - (NSRect)frameForColorAtIndex:(NSInteger)anIndex { NSEdgeInsets insets = [self alignmentRectInsets]; @@ -206,7 +204,7 @@ NSRect rect = NSMakeRect(insets.left, insets.bottom, bezelHeight, bezelHeight); rect = NSInsetRect(rect, COLOR_INSET, COLOR_INSET); if (anIndex > 0) - rect.origin.x += anIndex * [self distanceBetweenColors]; + rect.origin.x += anIndex * DISTANCE_BETWEEN_COLORS; return rect; } @@ -216,7 +214,7 @@ i--; NSRect rect = NSInsetRect([self frameForColorAtIndex:i], -2.0, -2.0); if (collapsedIndex == anIndex) - rect.size.width -= [self distanceBetweenColors]; + rect.size.width -= DISTANCE_BETWEEN_COLORS; return rect; } @@ -227,7 +225,7 @@ for (i = 0; i < count; i++) { if (NSMouseInRect(point, rect, [self isFlipped])) return i; - rect.origin.x += [self distanceBetweenColors]; + rect.origin.x += DISTANCE_BETWEEN_COLORS; } return -1; } @@ -240,7 +238,7 @@ for (i = 0; i < count; i++) { if (point.x < x) return i; - x += [self distanceBetweenColors]; + x += DISTANCE_BETWEEN_COLORS; } return count; } @@ -247,11 +245,11 @@ - (NSSize)sizeForNumberOfColors:(NSUInteger)count { NSEdgeInsets insets = [self alignmentRectInsets]; - return NSMakeSize(COLOR_INSET + count * [self distanceBetweenColors] + insets.left + insets.right, bezelHeight + insets.bottom + insets.top); + return NSMakeSize(COLOR_INSET + count * DISTANCE_BETWEEN_COLORS + insets.left + insets.right, bezelHeight + insets.bottom + insets.top); } - (NSSize)intrinsicContentSize { - return NSMakeSize(COLOR_INSET + [colors count] * [self distanceBetweenColors], bezelHeight); + return NSMakeSize(COLOR_INSET + [colors count] * DISTANCE_BETWEEN_COLORS, bezelHeight); } - (void)sizeToFit { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 17:03:08
|
Revision: 15018 http://sourceforge.net/p/skim-app/code/15018 Author: hofman Date: 2025-03-24 17:03:06 +0000 (Mon, 24 Mar 2025) Log Message: ----------- remove convenience intermediate method Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-24 16:48:16 UTC (rev 15017) +++ trunk/SKColorSwatch.m 2025-03-24 17:03:06 UTC (rev 15018) @@ -201,10 +201,6 @@ return bezelHeight - COLOR_INSET; } -- (NSSize)contentSizeForNumberOfColors:(NSUInteger)count { - return NSMakeSize(COLOR_INSET + count * [self distanceBetweenColors], bezelHeight); -} - - (NSRect)frameForColorAtIndex:(NSInteger)anIndex { NSEdgeInsets insets = [self alignmentRectInsets]; NSRect rect = NSMakeRect(insets.left, insets.bottom, bezelHeight, bezelHeight); @@ -250,15 +246,12 @@ } - (NSSize)sizeForNumberOfColors:(NSUInteger)count { - NSSize size = [self contentSizeForNumberOfColors:count]; NSEdgeInsets insets = [self alignmentRectInsets]; - size.height += insets.bottom + insets.top; - size.width += insets.left + insets.right; - return size; + return NSMakeSize(COLOR_INSET + count * [self distanceBetweenColors] + insets.left + insets.right, bezelHeight + insets.bottom + insets.top); } - (NSSize)intrinsicContentSize { - return [self contentSizeForNumberOfColors:[colors count]]; + return NSMakeSize(COLOR_INSET + [colors count] * [self distanceBetweenColors], bezelHeight); } - (void)sizeToFit { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 16:48:26
|
Revision: 15017 http://sourceforge.net/p/skim-app/code/15017 Author: hofman Date: 2025-03-24 16:48:16 +0000 (Mon, 24 Mar 2025) Log Message: ----------- separate method to update bezel height Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-24 15:52:08 UTC (rev 15016) +++ trunk/SKColorSwatch.m 2025-03-24 16:48:16 UTC (rev 15017) @@ -69,7 +69,6 @@ @interface SKColorSwatchBackgroundView : NSControl @property (nonatomic) CGFloat bezelWidth; -@property (nonatomic, readonly) CGFloat bezelHeight; @end typedef NS_ENUM(NSUInteger, SKColorSwatchDropLocation) { @@ -275,9 +274,32 @@ for (i = 0; i < iMax; i++) [[itemViews objectAtIndex:i] setFrame:[self frameForItemViewAtIndex:i collapsedIndex:-1]]; [backgroundView setBezelWidth:[self intrinsicContentSize].width]; - [self invalidateIntrinsicContentSize]; } +- (void)updateBezelHeight { + CGFloat height = [[backgroundView cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; + if (@available(macOS 11.0, *)) { + if ([backgroundView controlSize] == NSControlSizeLarge) + height -= LARGE_SIZE_HEIGHT_OFFSET; + } + if (fabs(height - bezelHeight) > 0.0) { + bezelHeight = height; + [self updateSubviewLayout]; + [self invalidateIntrinsicContentSize]; + if (autoResizes) + [self sizeToFit]; + } +} + +- (void)setControlSize:(NSControlSize)controlSize { + if (controlSize != [self controlSize]) { + [super setControlSize:controlSize]; + [backgroundView setControlSize:controlSize]; + [backgroundView setFrame:controlSize == 3 ? NSInsetRect([self bounds], -LARGE_SIZE_WIDTH_OUTSET, 0.0) : [self bounds]]; + [self updateBezelHeight]; + } +} + #pragma mark Drawing - (NSRect)focusRingMaskBounds { @@ -296,21 +318,6 @@ } } -- (void)setControlSize:(NSControlSize)controlSize { - if (controlSize != [self controlSize]) { - [super setControlSize:controlSize]; - [backgroundView setControlSize:controlSize]; - [backgroundView setFrame:controlSize == 3 ? NSInsetRect([self bounds], -LARGE_SIZE_WIDTH_OUTSET, 0.0) : [self bounds]]; - CGFloat height = [backgroundView bezelHeight]; - if (fabs(height - bezelHeight) > 0.0) { - bezelHeight = height; - [self updateSubviewLayout]; - if (autoResizes) - [self sizeToFit]; - } - } -} - #pragma mark Notification handling - (void)deactivate:(NSNotification *)note { @@ -347,15 +354,8 @@ - (void)viewDidMoveToWindow { [super viewDidMoveToWindow]; - if ([self window]) { - CGFloat height = [backgroundView bezelHeight]; - if (fabs(height - bezelHeight) > 0.0) { - bezelHeight = height; - [self updateSubviewLayout]; - if (autoResizes) - [self sizeToFit]; - } - } + if ([self window]) + [self updateBezelHeight]; } #pragma mark Event handling and actions @@ -498,6 +498,7 @@ [itemViews removeObjectAtIndex:iMax]; } [self updateSubviewLayout]; + [self invalidateIntrinsicContentSize]; [[NSNotificationCenter defaultCenter] postNotificationName:SKColorSwatchColorsChangedNotification object:self]; } @@ -866,7 +867,7 @@ @implementation SKColorSwatchBackgroundView -@dynamic bezelWidth, bezelHeight; +@dynamic bezelWidth; + (id)defaultAnimationForKey:(NSString *)key { if ([key isEqualToString:@"bezelWidth"]) { @@ -902,15 +903,6 @@ [self setNeedsDisplay:YES]; } -- (CGFloat)bezelHeight { - CGFloat height = [[self cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; - if (@available(macOS 11.0, *)) { - if ([self controlSize] == NSControlSizeLarge) - height -= LARGE_SIZE_HEIGHT_OFFSET; - } - return height; -} - - (void)mouseDown:(NSEvent *)event { [[self superview] mouseDown:event]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 15:52:09
|
Revision: 15016 http://sourceforge.net/p/skim-app/code/15016 Author: hofman Date: 2025-03-24 15:52:08 +0000 (Mon, 24 Mar 2025) Log Message: ----------- Use enum value behind @available Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-24 15:48:39 UTC (rev 15015) +++ trunk/SKColorSwatch.m 2025-03-24 15:52:08 UTC (rev 15016) @@ -904,8 +904,10 @@ - (CGFloat)bezelHeight { CGFloat height = [[self cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; - if ([self controlSize] == 3) - height -= LARGE_SIZE_HEIGHT_OFFSET; + if (@available(macOS 11.0, *)) { + if ([self controlSize] == NSControlSizeLarge) + height -= LARGE_SIZE_HEIGHT_OFFSET; + } return height; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 15:48:50
|
Revision: 15015 http://sourceforge.net/p/skim-app/code/15015 Author: hofman Date: 2025-03-24 15:48:39 +0000 (Mon, 24 Mar 2025) Log Message: ----------- rename macro Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-24 15:47:29 UTC (rev 15014) +++ trunk/SKColorSwatch.m 2025-03-24 15:48:39 UTC (rev 15015) @@ -891,14 +891,14 @@ - (BOOL)canBecomeKeyView { return NO; } -#define WIDTH_OFFSET ([self controlSize] == NSControlSizeRegular ? REGULAR_BEZEL_WIDTH_OFFSET : 0.0) +#define BEZEL_WIDTH_OFFSET ([self controlSize] == NSControlSizeRegular ? REGULAR_BEZEL_WIDTH_OFFSET : 0.0) - (CGFloat)bezelWidth { - return [[self cell] widthForSegment:0] + WIDTH_OFFSET; + return [[self cell] widthForSegment:0] + BEZEL_WIDTH_OFFSET; } - (void)setBezelWidth:(CGFloat)width { - [[self cell] setWidth:width - WIDTH_OFFSET forSegment:0]; + [[self cell] setWidth:width - BEZEL_WIDTH_OFFSET forSegment:0]; [self setNeedsDisplay:YES]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 15:47:35
|
Revision: 15014 http://sourceforge.net/p/skim-app/code/15014 Author: hofman Date: 2025-03-24 15:47:29 +0000 (Mon, 24 Mar 2025) Log Message: ----------- rename macro Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-24 15:31:20 UTC (rev 15013) +++ trunk/SKColorSwatch.m 2025-03-24 15:47:29 UTC (rev 15014) @@ -65,10 +65,8 @@ #define LARGE_SIZE_HEIGHT_OFFSET 10.0 #define LARGE_SIZE_WIDTH_OUTSET 6.0 +#define REGULAR_BEZEL_WIDTH_OFFSET 4.0 -#define BACKGROUND_WIDTH_OFFSET 4.0 -#define ALT_BACKGROUND_WIDTH_OFFSET 0.0 - @interface SKColorSwatchBackgroundView : NSControl @property (nonatomic) CGFloat bezelWidth; @property (nonatomic, readonly) CGFloat bezelHeight; @@ -885,7 +883,7 @@ NSSegmentedCell *cell = [[NSSegmentedCell alloc] init]; [cell setSegmentCount:1]; [cell setSegmentStyle:NSSegmentStyleTexturedSquare]; - [cell setWidth:fmax(0.0, NSWidth(frameRect) - BACKGROUND_WIDTH_OFFSET - 2.0 * BEZEL_INSET_LEFTRIGHT) forSegment:0]; + [cell setWidth:fmax(0.0, NSWidth(frameRect) - REGULAR_BEZEL_WIDTH_OFFSET - 2.0 * BEZEL_INSET_LEFTRIGHT) forSegment:0]; [self setCell:cell]; } return self; @@ -893,7 +891,7 @@ - (BOOL)canBecomeKeyView { return NO; } -#define WIDTH_OFFSET ([self controlSize] == NSControlSizeRegular ? BACKGROUND_WIDTH_OFFSET : ALT_BACKGROUND_WIDTH_OFFSET) +#define WIDTH_OFFSET ([self controlSize] == NSControlSizeRegular ? REGULAR_BEZEL_WIDTH_OFFSET : 0.0) - (CGFloat)bezelWidth { return [[self cell] widthForSegment:0] + WIDTH_OFFSET; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 15:31:22
|
Revision: 15013 http://sourceforge.net/p/skim-app/code/15013 Author: hofman Date: 2025-03-24 15:31:20 +0000 (Mon, 24 Mar 2025) Log Message: ----------- Animatable property is renamed to bezelWidth Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-24 10:01:00 UTC (rev 15012) +++ trunk/SKColorSwatch.m 2025-03-24 15:31:20 UTC (rev 15013) @@ -871,7 +871,7 @@ @dynamic bezelWidth, bezelHeight; + (id)defaultAnimationForKey:(NSString *)key { - if ([key isEqualToString:@"width"]) { + if ([key isEqualToString:@"bezelWidth"]) { CABasicAnimation *anim = [CABasicAnimation animation]; [anim setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]]; return anim; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 10:01:03
|
Revision: 15012 http://sourceforge.net/p/skim-app/code/15012 Author: hofman Date: 2025-03-24 10:01:00 +0000 (Mon, 24 Mar 2025) Log Message: ----------- check for NSNotFound Modified Paths: -------------- trunk/PDFAnnotationMarkup_SKExtensions.m Modified: trunk/PDFAnnotationMarkup_SKExtensions.m =================================================================== --- trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-24 10:00:25 UTC (rev 15011) +++ trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-24 10:01:00 UTC (rev 15012) @@ -119,7 +119,7 @@ - (instancetype)initSkimNoteWithSelection:(PDFSelection *)selection forPage:(PDFPage *)page forType:(NSString *)type { NSRect bounds = NSZeroRect; NSPointerArray *lines = nil; - if ([selection safeIndexOfFirstCharacterOnPage:page]) { + if ([selection safeIndexOfFirstCharacterOnPage:page] != NSNotFound) { for (PDFSelection *sel in [selection connectedSelectionsOnPage:page]) { NSRect lineRect = [sel boundsForPage:page]; if (NSIsEmptyRect(lineRect) == NO && [[sel string] rangeOfCharacterFromSet:[NSCharacterSet nonWhitespaceAndNewlineCharacterSet]].length) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 10:00:34
|
Revision: 15011 http://sourceforge.net/p/skim-app/code/15011 Author: hofman Date: 2025-03-24 10:00:25 +0000 (Mon, 24 Mar 2025) Log Message: ----------- check selection on the requested page first Modified Paths: -------------- trunk/PDFAnnotationMarkup_SKExtensions.m Modified: trunk/PDFAnnotationMarkup_SKExtensions.m =================================================================== --- trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-24 09:51:47 UTC (rev 15010) +++ trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-24 10:00:25 UTC (rev 15011) @@ -119,7 +119,7 @@ - (instancetype)initSkimNoteWithSelection:(PDFSelection *)selection forPage:(PDFPage *)page forType:(NSString *)type { NSRect bounds = NSZeroRect; NSPointerArray *lines = nil; - if ([selection hasCharacters]) { + if ([selection safeIndexOfFirstCharacterOnPage:page]) { for (PDFSelection *sel in [selection connectedSelectionsOnPage:page]) { NSRect lineRect = [sel boundsForPage:page]; if (NSIsEmptyRect(lineRect) == NO && [[sel string] rangeOfCharacterFromSet:[NSCharacterSet nonWhitespaceAndNewlineCharacterSet]].length) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-24 09:51:53
|
Revision: 15010 http://sourceforge.net/p/skim-app/code/15010 Author: hofman Date: 2025-03-24 09:51:47 +0000 (Mon, 24 Mar 2025) Log Message: ----------- no need to clear pointer array we just initialized Modified Paths: -------------- trunk/PDFAnnotationMarkup_SKExtensions.m Modified: trunk/PDFAnnotationMarkup_SKExtensions.m =================================================================== --- trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-23 16:31:30 UTC (rev 15009) +++ trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-24 09:51:47 UTC (rev 15010) @@ -175,9 +175,6 @@ NSPoint origin = [self bounds].origin; NSRange range = NSMakeRange(0, 4); - while ([lineRects count]) - [lineRects removePointerAtIndex:0]; - for (j = 0; j < jMax; j++) { range.location = 4 * j; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-23 16:31:39
|
Revision: 15009 http://sourceforge.net/p/skim-app/code/15009 Author: hofman Date: 2025-03-23 16:31:30 +0000 (Sun, 23 Mar 2025) Log Message: ----------- convenience property for bezelHeight of background view Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-23 16:21:06 UTC (rev 15008) +++ trunk/SKColorSwatch.m 2025-03-23 16:31:30 UTC (rev 15009) @@ -71,6 +71,7 @@ @interface SKColorSwatchBackgroundView : NSControl @property (nonatomic) CGFloat bezelWidth; +@property (nonatomic, readonly) CGFloat bezelHeight; @end typedef NS_ENUM(NSUInteger, SKColorSwatchDropLocation) { @@ -301,13 +302,8 @@ if (controlSize != [self controlSize]) { [super setControlSize:controlSize]; [backgroundView setControlSize:controlSize]; - CGFloat height = [[backgroundView cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; - if (controlSize == 3) { - height -= LARGE_SIZE_HEIGHT_OFFSET; - [backgroundView setFrame:NSInsetRect([self bounds], -LARGE_SIZE_WIDTH_OUTSET, 0.0)]; - } else { - [backgroundView setFrame:[self bounds]]; - } + [backgroundView setFrame:controlSize == 3 ? NSInsetRect([self bounds], -LARGE_SIZE_WIDTH_OUTSET, 0.0) : [self bounds]]; + CGFloat height = [backgroundView bezelHeight]; if (fabs(height - bezelHeight) > 0.0) { bezelHeight = height; [self updateSubviewLayout]; @@ -354,9 +350,7 @@ - (void)viewDidMoveToWindow { [super viewDidMoveToWindow]; if ([self window]) { - CGFloat height = [[backgroundView cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; - if ([backgroundView controlSize] == 3) - height -= LARGE_SIZE_HEIGHT_OFFSET; + CGFloat height = [backgroundView bezelHeight]; if (fabs(height - bezelHeight) > 0.0) { bezelHeight = height; [self updateSubviewLayout]; @@ -874,7 +868,7 @@ @implementation SKColorSwatchBackgroundView -@dynamic bezelWidth; +@dynamic bezelWidth, bezelHeight; + (id)defaultAnimationForKey:(NSString *)key { if ([key isEqualToString:@"width"]) { @@ -910,6 +904,13 @@ [self setNeedsDisplay:YES]; } +- (CGFloat)bezelHeight { + CGFloat height = [[self cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; + if ([self controlSize] == 3) + height -= LARGE_SIZE_HEIGHT_OFFSET; + return height; +} + - (void)mouseDown:(NSEvent *)event { [[self superview] mouseDown:event]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-23 16:21:08
|
Revision: 15008 http://sourceforge.net/p/skim-app/code/15008 Author: hofman Date: 2025-03-23 16:21:06 +0000 (Sun, 23 Mar 2025) Log Message: ----------- Set bezel width instead of 'frame' width Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-23 09:44:53 UTC (rev 15007) +++ trunk/SKColorSwatch.m 2025-03-23 16:21:06 UTC (rev 15008) @@ -66,11 +66,11 @@ #define LARGE_SIZE_HEIGHT_OFFSET 10.0 #define LARGE_SIZE_WIDTH_OUTSET 6.0 -#define BACKGROUND_WIDTH_OFFSET 6.0 -#define SMALL_BACKGROUND_WIDTH_OFFSET 2.0 +#define BACKGROUND_WIDTH_OFFSET 4.0 +#define ALT_BACKGROUND_WIDTH_OFFSET 0.0 @interface SKColorSwatchBackgroundView : NSControl -@property (nonatomic) CGFloat width; +@property (nonatomic) CGFloat bezelWidth; @end typedef NS_ENUM(NSUInteger, SKColorSwatchDropLocation) { @@ -103,7 +103,6 @@ @interface SKColorSwatch () @property (nonatomic) NSInteger selectedColorIndex; -@property (nonatomic, readonly) CGFloat fitWidth; - (NSRect)frameForItemViewAtIndex:(NSInteger)anIndex collapsedIndex:(NSInteger)collapsedIndex; - (void)setColor:(NSColor *)color atIndex:(NSInteger)i fromPanel:(BOOL)fromPanel; @end @@ -111,7 +110,7 @@ @implementation SKColorSwatch @synthesize colors, autoResizes, selects, alternate, clickedColorIndex=clickedIndex, selectedColorIndex=selectedIndex; -@dynamic color, fitWidth; +@dynamic color; - (Class)valueClassForBinding:(NSString *)binding { if ([binding isEqualToString:COLORS_KEY]) @@ -143,7 +142,7 @@ SKColorSwatchBackgroundView *view = [[SKColorSwatchBackgroundView alloc] initWithFrame:[self bounds]]; [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; - [view setWidth:[self fitWidth]]; + [view setBezelWidth:[self intrinsicContentSize].width]; [self addSubview:view]; backgroundView = view; @@ -260,10 +259,6 @@ return size; } -- (CGFloat)fitWidth { - return [self sizeForNumberOfColors:[colors count]].width; -} - - (NSSize)intrinsicContentSize { return [self contentSizeForNumberOfColors:[colors count]]; } @@ -280,7 +275,7 @@ NSUInteger i, iMax = [itemViews count]; for (i = 0; i < iMax; i++) [[itemViews objectAtIndex:i] setFrame:[self frameForItemViewAtIndex:i collapsedIndex:-1]]; - [backgroundView setWidth:[self fitWidth]]; + [backgroundView setBezelWidth:[self intrinsicContentSize].width]; [self invalidateIntrinsicContentSize]; } @@ -622,7 +617,7 @@ for (SKColorSwatchItemView *itemView in itemViews) [[itemView animator] setFrame:[self frameForItemViewAtIndex:i++ collapsedIndex:collapsedIndex]]; if (NSEqualSizes(size, NSZeroSize) == NO) { - [[backgroundView animator] setWidth:size.width]; + [[backgroundView animator] setBezelWidth:size.width - 2.0 * BEZEL_INSET_LEFTRIGHT]; if (autoResizes) [[self animator] setFrameSize:size]; } @@ -879,7 +874,7 @@ @implementation SKColorSwatchBackgroundView -@dynamic width; +@dynamic bezelWidth; + (id)defaultAnimationForKey:(NSString *)key { if ([key isEqualToString:@"width"]) { @@ -890,10 +885,6 @@ return [super defaultAnimationForKey:key]; } -- (CGFloat)widthOffset { - return [self controlSize] == NSControlSizeRegular ? BACKGROUND_WIDTH_OFFSET : SMALL_BACKGROUND_WIDTH_OFFSET; -} - - (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { @@ -900,7 +891,7 @@ NSSegmentedCell *cell = [[NSSegmentedCell alloc] init]; [cell setSegmentCount:1]; [cell setSegmentStyle:NSSegmentStyleTexturedSquare]; - [cell setWidth:fmax(0.0, NSWidth(frameRect) - [self widthOffset]) forSegment:0]; + [cell setWidth:fmax(0.0, NSWidth(frameRect) - BACKGROUND_WIDTH_OFFSET - 2.0 * BEZEL_INSET_LEFTRIGHT) forSegment:0]; [self setCell:cell]; } return self; @@ -908,12 +899,14 @@ - (BOOL)canBecomeKeyView { return NO; } -- (CGFloat)width { - return [[self cell] widthForSegment:0] + [self widthOffset]; +#define WIDTH_OFFSET ([self controlSize] == NSControlSizeRegular ? BACKGROUND_WIDTH_OFFSET : ALT_BACKGROUND_WIDTH_OFFSET) + +- (CGFloat)bezelWidth { + return [[self cell] widthForSegment:0] + WIDTH_OFFSET; } -- (void)setWidth:(CGFloat)width { - [[self cell] setWidth:width - [self widthOffset] forSegment:0]; +- (void)setBezelWidth:(CGFloat)width { + [[self cell] setWidth:width - WIDTH_OFFSET forSegment:0]; [self setNeedsDisplay:YES]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-23 09:45:00
|
Revision: 15007 http://sourceforge.net/p/skim-app/code/15007 Author: hofman Date: 2025-03-23 09:44:53 +0000 (Sun, 23 Mar 2025) Log Message: ----------- Always invalidate intrinsic content size when updating color swatch subview layout Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-22 17:56:42 UTC (rev 15006) +++ trunk/SKColorSwatch.m 2025-03-23 09:44:53 UTC (rev 15007) @@ -281,6 +281,7 @@ for (i = 0; i < iMax; i++) [[itemViews objectAtIndex:i] setFrame:[self frameForItemViewAtIndex:i collapsedIndex:-1]]; [backgroundView setWidth:[self fitWidth]]; + [self invalidateIntrinsicContentSize]; } #pragma mark Drawing @@ -510,7 +511,6 @@ [itemViews removeObjectAtIndex:iMax]; } [self updateSubviewLayout]; - [self invalidateIntrinsicContentSize]; [[NSNotificationCenter defaultCenter] postNotificationName:SKColorSwatchColorsChangedNotification object:self]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-22 17:56:43
|
Revision: 15006 http://sourceforge.net/p/skim-app/code/15006 Author: hofman Date: 2025-03-22 17:56:42 +0000 (Sat, 22 Mar 2025) Log Message: ----------- change order of toolbar items in customization palette Modified Paths: -------------- trunk/SKMainToolbarController.m Modified: trunk/SKMainToolbarController.m =================================================================== --- trunk/SKMainToolbarController.m 2025-03-22 17:30:16 UTC (rev 15005) +++ trunk/SKMainToolbarController.m 2025-03-22 17:56:42 UTC (rev 15006) @@ -937,16 +937,16 @@ SKDocumentToolbarRotateLeftItemIdentifier, SKDocumentToolbarRotateLeftRightItemIdentifier, SKDocumentToolbarCropItemIdentifier, + SKDocumentToolbarToolModeItemIdentifier, + SKDocumentToolbarNotesItemIdentifier, SKDocumentToolbarNewNoteItemIdentifier, SKDocumentToolbarNewTextNoteItemIdentifier, SKDocumentToolbarNewCircleNoteItemIdentifier, SKDocumentToolbarNewMarkupItemIdentifier, SKDocumentToolbarNewLineItemIdentifier, - SKDocumentToolbarNotesItemIdentifier, - SKDocumentToolbarToolModeItemIdentifier, - SKDocumentToolbarColorSwatchItemIdentifier, SKDocumentToolbarShareItemIdentifier, SKDocumentToolbarPacerItemIdentifier, + SKDocumentToolbarColorSwatchItemIdentifier, SKDocumentToolbarInfoItemIdentifier, SKDocumentToolbarColorsItemIdentifier, SKDocumentToolbarFontsItemIdentifier, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-22 17:30:18
|
Revision: 15005 http://sourceforge.net/p/skim-app/code/15005 Author: hofman Date: 2025-03-22 17:30:16 +0000 (Sat, 22 Mar 2025) Log Message: ----------- Don't toggle note toolbar in presentation mode Modified Paths: -------------- trunk/SKMainWindowController_UI.m Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2025-03-22 17:28:37 UTC (rev 15004) +++ trunk/SKMainWindowController_UI.m 2025-03-22 17:30:16 UTC (rev 15005) @@ -1867,7 +1867,7 @@ [menuItem setTitle:NSLocalizedString(@"Hide Note Toolbar", @"Menu item title")]; else [menuItem setTitle:NSLocalizedString(@"Show Note Toolbar", @"Menu item title")]; - return YES; + return [self interactionMode] != SKPresentationMode; } else if (action == @selector(toggleOverview:)) { if ([self hasOverview]) [menuItem setTitle:NSLocalizedString(@"Hide Overview", @"Menu item title")]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-22 17:28:43
|
Revision: 15004 http://sourceforge.net/p/skim-app/code/15004 Author: hofman Date: 2025-03-22 17:28:37 +0000 (Sat, 22 Mar 2025) Log Message: ----------- Use small size in note toolbar when main toolbar uses small size Modified Paths: -------------- trunk/SKNoteToolbarController.m Modified: trunk/SKNoteToolbarController.m =================================================================== --- trunk/SKNoteToolbarController.m 2025-03-22 16:33:39 UTC (rev 15003) +++ trunk/SKNoteToolbarController.m 2025-03-22 17:28:37 UTC (rev 15004) @@ -51,18 +51,17 @@ static char SKDefaultsObservationContext; +static char SKToolbarObservationContext; + +@interface SKNoteToolbarController (SKPrivate) +- (void)updateSizeMode; +@end + @implementation SKNoteToolbarController @synthesize mainController; @dynamic visible; -- (void)dealloc { - if (colorsButton) { - @try { [[NSUserDefaults standardUserDefaults] removeObserver:self forKeyPath:SKSwatchColorsKey context:&SKDefaultsObservationContext]; } - @catch (id e) {} - } -} - - (BOOL)isVisible { return [self isViewLoaded] && [[self view] window] != nil; } @@ -150,8 +149,25 @@ [NSLayoutConstraint activateConstraints:constraints]; [self setView:view]; + + [self updateSizeMode]; + [[[mainController window] toolbar] addObserver:self forKeyPath:@"sizeMode" options:0 context:&SKToolbarObservationContext]; } +- (void)setMainController:(SKMainWindowController *)newMainController { + if (mainController) { + if (noteButton) { + @try { [[[mainController window] toolbar] removeObserver:self forKeyPath:@"sizeMode" context:&SKToolbarObservationContext]; } + @catch (id e) {} + } + if (colorsButton) { + @try { [[NSUserDefaults standardUserDefaults] removeObserver:self forKeyPath:SKSwatchColorsKey context:&SKDefaultsObservationContext]; } + @catch (id e) {} + } + } + mainController = newMainController; +} + - (void)createNewNote:(id)sender { if ([mainController.pdfView canSelectNote]) { NSInteger type = [sender selectedSegment]; @@ -213,6 +229,15 @@ } } +- (void)updateSizeMode { + NSToolbarSizeMode sizeMode = [[[mainController window] toolbar] sizeMode]; + NSControlSize controlSize = sizeMode == NSToolbarSizeModeSmall ? NSControlSizeSmall : NSControlSizeRegular; + [noteButton setControlSize:controlSize]; + [colorsButton setControlSize:controlSize]; + [fontsButton setControlSize:controlSize]; + [linesButton setControlSize:controlSize]; +} + - (void)validateButtons { [noteButton setEnabled:[mainController hasOverview] == NO && [mainController.pdfView canSelectNote]]; } @@ -220,6 +245,8 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context { if (context == &SKDefaultsObservationContext) { [self updateColorsMenu]; + } else if (context == &SKToolbarObservationContext) { + [self updateSizeMode]; } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-22 16:33:51
|
Revision: 15003 http://sourceforge.net/p/skim-app/code/15003 Author: hofman Date: 2025-03-22 16:33:39 +0000 (Sat, 22 Mar 2025) Log Message: ----------- no need for helper method Modified Paths: -------------- trunk/PDFSelection_SKExtensions.m Modified: trunk/PDFSelection_SKExtensions.m =================================================================== --- trunk/PDFSelection_SKExtensions.m 2025-03-22 15:19:16 UTC (rev 15002) +++ trunk/PDFSelection_SKExtensions.m 2025-03-22 16:33:39 UTC (rev 15003) @@ -203,18 +203,9 @@ return NSNotFound; } -- (BOOL)hasCharactersOnPage:(PDFPage *)page { - NSInteger i, count = [self numberOfTextRangesOnPage:page]; - for (i = 0; i < count; i++) { - if ([self rangeAtIndex:i onPage:page].length > 0) - return YES; - } - return NO; -} - - (PDFPage *)safeFirstPage { for (PDFPage *page in [self pages]) { - if ([self hasCharactersOnPage:page]) + if ([self safeIndexOfFirstCharacterOnPage:page] != NSNotFound) return page; } return nil; @@ -222,7 +213,7 @@ - (PDFPage *)safeLastPage { for (PDFPage *page in [[self pages] reverseObjectEnumerator]) { - if ([self hasCharactersOnPage:page]) + if ([self safeIndexOfFirstCharacterOnPage:page] != NSNotFound) return page; } return nil; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-22 15:19:17
|
Revision: 15002 http://sourceforge.net/p/skim-app/code/15002 Author: hofman Date: 2025-03-22 15:19:16 +0000 (Sat, 22 Mar 2025) Log Message: ----------- rename method, generics Modified Paths: -------------- trunk/PDFAnnotationMarkup_SKExtensions.m trunk/PDFSelection_SKExtensions.h trunk/PDFSelection_SKExtensions.m Modified: trunk/PDFAnnotationMarkup_SKExtensions.m =================================================================== --- trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-21 19:02:24 UTC (rev 15001) +++ trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-22 15:19:16 UTC (rev 15002) @@ -120,7 +120,7 @@ NSRect bounds = NSZeroRect; NSPointerArray *lines = nil; if ([selection hasCharacters]) { - for (PDFSelection *sel in [selection selectionComponentsOnPage:page]) { + for (PDFSelection *sel in [selection connectedSelectionsOnPage:page]) { NSRect lineRect = [sel boundsForPage:page]; if (NSIsEmptyRect(lineRect) == NO && [[sel string] rangeOfCharacterFromSet:[NSCharacterSet nonWhitespaceAndNewlineCharacterSet]].length) { if (lines == nil) Modified: trunk/PDFSelection_SKExtensions.h =================================================================== --- trunk/PDFSelection_SKExtensions.h 2025-03-21 19:02:24 UTC (rev 15001) +++ trunk/PDFSelection_SKExtensions.h 2025-03-22 15:19:16 UTC (rev 15002) @@ -60,7 +60,7 @@ - (CGFloat)boundsOrderForPage:(PDFPage *)page; -- (NSArray *)selectionComponentsOnPage:(nullable PDFPage *)page; +- (NSArray<PDFSelection *> *)connectedSelectionsOnPage:(nullable PDFPage *)page; + (nullable instancetype)selectionWithSpecifier:(nullable id)specifier; + (nullable instancetype)selectionWithSpecifier:(nullable id)specifier onPage:(nullable PDFPage *)aPage; Modified: trunk/PDFSelection_SKExtensions.m =================================================================== --- trunk/PDFSelection_SKExtensions.m 2025-03-21 19:02:24 UTC (rev 15001) +++ trunk/PDFSelection_SKExtensions.m 2025-03-22 15:19:16 UTC (rev 15002) @@ -89,7 +89,7 @@ } - (NSString *)compactedCleanedString { - NSArray *lines = [self selectionComponentsOnPage:nil]; + NSArray *lines = [self connectedSelectionsOnPage:nil]; if ([lines count] < 2) return [[[self string] stringByRemovingAliens] stringByCollapsingWhitespaceAndNewlinesAndRemovingSurroundingWhitespaceAndNewlines]; NSMutableString *string = [NSMutableString string]; @@ -236,7 +236,7 @@ return [page sortOrderForBounds:[self boundsForPage:page]]; } -- (NSArray *)selectionComponentsOnPage:(PDFPage *)page { +- (NSArray *)connectedSelectionsOnPage:(PDFPage *)page { NSMutableArray *components = [NSMutableArray array]; for (PDFSelection *sel in [self selectionsByLine]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-21 19:02:37
|
Revision: 15001 http://sourceforge.net/p/skim-app/code/15001 Author: hofman Date: 2025-03-21 19:02:24 +0000 (Fri, 21 Mar 2025) Log Message: ----------- don't check when we already know it's zero Modified Paths: -------------- trunk/SKMainWindow.m Modified: trunk/SKMainWindow.m =================================================================== --- trunk/SKMainWindow.m 2025-03-21 18:39:59 UTC (rev 15000) +++ trunk/SKMainWindow.m 2025-03-21 19:02:24 UTC (rev 15001) @@ -151,10 +151,11 @@ - (void)setAutoTitleVisibility:(SKAutoWindowTitleVisibility)visibility { if (autoTitleVisibility != visibility) { autoTitleVisibility = visibility; - if (autoTitleVisibility) + if (autoTitleVisibility) { [self updateForToolbarVisibility:[[self toolbar] isVisible]]; - if (autoTitleVisibility == SKWindowTitleHiddenForTabBar && [self safeTabBarViewController] && [[self titlebarAccessoryViewControllers] containsObject:[self safeTabBarViewController]]) - [self setTitleVisibility:NSWindowTitleHidden]; + if (autoTitleVisibility == SKWindowTitleHiddenForTabBar && [self safeTabBarViewController] && [[self titlebarAccessoryViewControllers] containsObject:[self safeTabBarViewController]]) + [self setTitleVisibility:NSWindowTitleHidden]; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-21 18:40:14
|
Revision: 15000 http://sourceforge.net/p/skim-app/code/15000 Author: hofman Date: 2025-03-21 18:39:59 +0000 (Fri, 21 Mar 2025) Log Message: ----------- set mainController for noteToolbar to nil when closing Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-03-21 18:26:04 UTC (rev 14999) +++ trunk/SKMainWindowController.m 2025-03-21 18:39:59 UTC (rev 15000) @@ -282,6 +282,7 @@ [leftSideController setMainController:nil]; [rightSideController setMainController:nil]; [toolbarController setMainController:nil]; + [noteToolbarController setMainController:nil]; [touchBarController setMainController:nil]; [findController setDelegate:nil]; [pdfView setDelegate:nil]; // this cleans up the pdfview This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-21 18:26:12
|
Revision: 14999 http://sourceforge.net/p/skim-app/code/14999 Author: hofman Date: 2025-03-21 18:26:04 +0000 (Fri, 21 Mar 2025) Log Message: ----------- make page for new markup Skim note nonnull, pass safeFirstPage already in initializer Modified Paths: -------------- trunk/PDFAnnotationMarkup_SKExtensions.h trunk/PDFAnnotationMarkup_SKExtensions.m trunk/PDFAnnotation_SKExtensions.m Modified: trunk/PDFAnnotationMarkup_SKExtensions.h =================================================================== --- trunk/PDFAnnotationMarkup_SKExtensions.h 2025-03-21 17:54:14 UTC (rev 14998) +++ trunk/PDFAnnotationMarkup_SKExtensions.h 2025-03-21 18:26:04 UTC (rev 14999) @@ -45,7 +45,7 @@ @interface PDFAnnotationMarkup (SKExtensions) -- (nullable instancetype)initSkimNoteWithSelection:(PDFSelection *)selection forPage:(nullable PDFPage *)page forType:(NSString *)type; +- (nullable instancetype)initSkimNoteWithSelection:(PDFSelection *)selection forPage:(PDFPage *)page forType:(NSString *)type; @property (nonatomic, nullable, readonly) PDFSelection *selection; Modified: trunk/PDFAnnotationMarkup_SKExtensions.m =================================================================== --- trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-21 17:54:14 UTC (rev 14998) +++ trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-21 18:26:04 UTC (rev 14999) @@ -117,8 +117,6 @@ } - (instancetype)initSkimNoteWithSelection:(PDFSelection *)selection forPage:(PDFPage *)page forType:(NSString *)type { - if (page == nil) - page = [selection safeFirstPage]; NSRect bounds = NSZeroRect; NSPointerArray *lines = nil; if ([selection hasCharacters]) { Modified: trunk/PDFAnnotation_SKExtensions.m =================================================================== --- trunk/PDFAnnotation_SKExtensions.m 2025-03-21 17:54:14 UTC (rev 14998) +++ trunk/PDFAnnotation_SKExtensions.m 2025-03-21 18:26:04 UTC (rev 14999) @@ -143,9 +143,12 @@ } + (PDFAnnotation *)newSkimNoteWithSelection:(PDFSelection *)selection forType:(NSString *)type { + PDFPage *page = [selection safeFirstPage]; + if (page == nil) + return nil; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - return [[PDFAnnotationMarkup alloc] initSkimNoteWithSelection:selection forPage:nil forType:type]; + return [[PDFAnnotationMarkup alloc] initSkimNoteWithSelection:selection forPage:page forType:type]; #pragma clang diagnostic pop } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |