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-21 17:38:18
|
Revision: 14997 http://sourceforge.net/p/skim-app/code/14997 Author: hofman Date: 2025-03-21 17:38:09 +0000 (Fri, 21 Mar 2025) Log Message: ----------- break up selection in separated ranges to get cleaned string Modified Paths: -------------- trunk/PDFSelection_SKExtensions.m Modified: trunk/PDFSelection_SKExtensions.m =================================================================== --- trunk/PDFSelection_SKExtensions.m 2025-03-21 14:19:00 UTC (rev 14996) +++ trunk/PDFSelection_SKExtensions.m 2025-03-21 17:38:09 UTC (rev 14997) @@ -89,7 +89,7 @@ } - (NSString *)compactedCleanedString { - NSArray *lines = [self selectionsByLine]; + NSArray *lines = [self selectionComponentsOnPage:nil]; if ([lines count] < 2) return [[[self string] stringByRemovingAliens] stringByCollapsingWhitespaceAndNewlinesAndRemovingSurroundingWhitespaceAndNewlines]; NSMutableString *string = [NSMutableString string]; @@ -237,22 +237,17 @@ } - (NSArray *)selectionComponentsOnPage:(PDFPage *)page { - if (page == nil) { - page = [self safeFirstPage]; - if (page == nil) - return @[]; - } - NSMutableArray *components = [NSMutableArray array]; for (PDFSelection *sel in [self selectionsByLine]) { - NSUInteger count = [sel numberOfTextRangesOnPage:page]; + PDFPage *aPage = page ?: [[sel pages] firstObject]; + NSUInteger count = [sel numberOfTextRangesOnPage:aPage]; if (count == 1) { [components addObject:sel]; } else if (count > 1) { NSRange range = NSMakeRange(0, 0); for (NSUInteger i = 0; i < count; i++) { - NSRange nextRange = [sel rangeAtIndex:i onPage:page]; + NSRange nextRange = [sel rangeAtIndex:i onPage:aPage]; if (nextRange.length == 0) { } else if (range.length == 0) { range = nextRange; @@ -259,12 +254,12 @@ } else if (NSMaxRange(range) == nextRange.location) { range.length += nextRange.length; } else { - [components addObject:[page selectionForRange:range]]; + [components addObject:[aPage selectionForRange:range]]; range = nextRange; } } if (range.length) - [components addObject:[page selectionForRange:range]]; + [components addObject:[aPage selectionForRange:range]]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-21 14:19:02
|
Revision: 14996 http://sourceforge.net/p/skim-app/code/14996 Author: hofman Date: 2025-03-21 14:19:00 +0000 (Fri, 21 Mar 2025) Log Message: ----------- Set control size to regular for all toolbar iteems for customization palette. Should only be necessary for our custom SKColorSwatch control. Modified Paths: -------------- trunk/SKColorSwatch.m trunk/SKMainToolbarController.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-21 14:03:34 UTC (rev 14995) +++ trunk/SKColorSwatch.m 2025-03-21 14:19:00 UTC (rev 14996) @@ -175,9 +175,6 @@ else if ([view isKindOfClass:[SKColorSwatchItemView class]]) [itemViews addObject:(SKColorSwatchItemView *)view]; } - - // this is only used for the toolbar customization palette - [self setControlSize:NSControlSizeRegular]; } return self; } Modified: trunk/SKMainToolbarController.m =================================================================== --- trunk/SKMainToolbarController.m 2025-03-21 14:03:34 UTC (rev 14995) +++ trunk/SKMainToolbarController.m 2025-03-21 14:19:00 UTC (rev 14996) @@ -891,6 +891,8 @@ [(NSControl *)[item view] setEnabled:YES]; if ([[item view] respondsToSelector:@selector(setEnabledForAllSegments:)]) [(NSSegmentedControl *)[item view] setEnabledForAllSegments:YES]; + if ([[item view] respondsToSelector:@selector(setControlSize:)]) + [(NSControl *)[item view] setControlSize:NSControlSizeRegular]; } return item; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-21 14:03:35
|
Revision: 14995 http://sourceforge.net/p/skim-app/code/14995 Author: hofman Date: 2025-03-21 14:03:34 +0000 (Fri, 21 Mar 2025) Log Message: ----------- Allow small size toolbar Modified Paths: -------------- trunk/SKMainToolbarController.m Modified: trunk/SKMainToolbarController.m =================================================================== --- trunk/SKMainToolbarController.m 2025-03-21 13:39:21 UTC (rev 14994) +++ trunk/SKMainToolbarController.m 2025-03-21 14:03:34 UTC (rev 14995) @@ -123,13 +123,6 @@ static char SKDefaultsObservationContext; -@interface SKToolbar : NSToolbar -@end - -@implementation SKToolbar -- (BOOL)_allowsSizeMode:(NSToolbarSizeMode)sizeMode { return NO; } -@end - #pragma mark - @interface SKMainToolbarController (SKPrivate) @@ -166,13 +159,7 @@ [self view]; // Create a new toolbar instance, and attach it to our document window - NSToolbar *toolbar = nil; - if (@available(macOS 11.0, *)) { - if ([[mainController window] toolbarStyle] == NSWindowToolbarStyleUnifiedCompact) - toolbar = [[NSToolbar alloc] initWithIdentifier:SKDocumentToolbarIdentifier]; - } - if (toolbar == nil) - toolbar = [[SKToolbar alloc] initWithIdentifier:SKDocumentToolbarIdentifier]; + NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:SKDocumentToolbarIdentifier]; // Set up toolbar properties: Allow customization, give a default display mode, and remember state in user defaults [toolbar setAllowsUserCustomization:YES]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-21 13:39:30
|
Revision: 14994 http://sourceforge.net/p/skim-app/code/14994 Author: hofman Date: 2025-03-21 13:39:21 +0000 (Fri, 21 Mar 2025) Log Message: ----------- Make sure selection fo markup note is broken up in separate ranges. It looks like selectionByLine keeps ranges within a line together on 15.x. 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-20 18:09:57 UTC (rev 14993) +++ trunk/PDFAnnotationMarkup_SKExtensions.m 2025-03-21 13:39:21 UTC (rev 14994) @@ -122,7 +122,7 @@ NSRect bounds = NSZeroRect; NSPointerArray *lines = nil; if ([selection hasCharacters]) { - for (PDFSelection *sel in [selection selectionsByLine]) { + for (PDFSelection *sel in [selection selectionComponentsOnPage: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-20 18:09:57 UTC (rev 14993) +++ trunk/PDFSelection_SKExtensions.h 2025-03-21 13:39:21 UTC (rev 14994) @@ -60,6 +60,8 @@ - (CGFloat)boundsOrderForPage:(PDFPage *)page; +- (NSArray *)selectionComponentsOnPage:(nullable PDFPage *)page; + + (nullable instancetype)selectionWithSpecifier:(nullable id)specifier; + (nullable instancetype)selectionWithSpecifier:(nullable id)specifier onPage:(nullable PDFPage *)aPage; @property (nonatomic, nullable, readonly) id objectSpecifiers; Modified: trunk/PDFSelection_SKExtensions.m =================================================================== --- trunk/PDFSelection_SKExtensions.m 2025-03-20 18:09:57 UTC (rev 14993) +++ trunk/PDFSelection_SKExtensions.m 2025-03-21 13:39:21 UTC (rev 14994) @@ -236,6 +236,41 @@ return [page sortOrderForBounds:[self boundsForPage:page]]; } +- (NSArray *)selectionComponentsOnPage:(PDFPage *)page { + if (page == nil) { + page = [self safeFirstPage]; + if (page == nil) + return @[]; + } + + NSMutableArray *components = [NSMutableArray array]; + + for (PDFSelection *sel in [self selectionsByLine]) { + NSUInteger count = [sel numberOfTextRangesOnPage:page]; + if (count == 1) { + [components addObject:sel]; + } else if (count > 1) { + NSRange range = NSMakeRange(0, 0); + for (NSUInteger i = 0; i < count; i++) { + NSRange nextRange = [sel rangeAtIndex:i onPage:page]; + if (nextRange.length == 0) { + } else if (range.length == 0) { + range = nextRange; + } else if (NSMaxRange(range) == nextRange.location) { + range.length += nextRange.length; + } else { + [components addObject:[page selectionForRange:range]]; + range = nextRange; + } + } + if (range.length) + [components addObject:[page selectionForRange:range]]; + } + } + + return components; +} + static NSRange rangeOfSubstringOfStringAtIndex(NSString *string, NSArray *substrings, NSUInteger anIndex) { if (anIndex >= [substrings count]) return NSMakeRange(NSNotFound, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-20 18:09:58
|
Revision: 14993 http://sourceforge.net/p/skim-app/code/14993 Author: hofman Date: 2025-03-20 18:09:57 +0000 (Thu, 20 Mar 2025) Log Message: ----------- set controlsize of whole view to regular forr customization palette Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-20 17:37:33 UTC (rev 14992) +++ trunk/SKColorSwatch.m 2025-03-20 18:09:57 UTC (rev 14993) @@ -177,7 +177,7 @@ } // this is only used for the toolbar customization palette - [backgroundView setControlSize:NSControlSizeRegular]; + [self setControlSize:NSControlSizeRegular]; } return self; } @@ -362,7 +362,7 @@ [super viewDidMoveToWindow]; if ([self window]) { CGFloat height = [[backgroundView cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; - if ([self controlSize] == 3) + if ([backgroundView controlSize] == 3) height -= LARGE_SIZE_HEIGHT_OFFSET; if (fabs(height - bezelHeight) > 0.0) { bezelHeight = height; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-20 17:37:36
|
Revision: 14992 http://sourceforge.net/p/skim-app/code/14992 Author: hofman Date: 2025-03-20 17:37:33 +0000 (Thu, 20 Mar 2025) Log Message: ----------- Always relayout color swatch when control size changes. Support large control size, but we need to offset the reported size and pllacement of the segmented cell. Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-20 10:16:57 UTC (rev 14991) +++ trunk/SKColorSwatch.m 2025-03-20 17:37:33 UTC (rev 14992) @@ -63,6 +63,9 @@ #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 BACKGROUND_WIDTH_OFFSET 6.0 #define SMALL_BACKGROUND_WIDTH_OFFSET 2.0 @@ -302,10 +305,16 @@ } - (void)setControlSize:(NSControlSize)controlSize { - [super setControlSize:controlSize]; - [backgroundView setControlSize:controlSize > NSControlSizeMini ? NSControlSizeRegular : controlSize]; - if ([self window]) { + 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]]; + } if (fabs(height - bezelHeight) > 0.0) { bezelHeight = height; [self updateSubviewLayout]; @@ -353,6 +362,8 @@ [super viewDidMoveToWindow]; if ([self window]) { CGFloat height = [[backgroundView cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; + if ([self controlSize] == 3) + height -= LARGE_SIZE_HEIGHT_OFFSET; if (fabs(height - bezelHeight) > 0.0) { bezelHeight = height; [self updateSubviewLayout]; @@ -491,6 +502,7 @@ itemView = [itemViews objectAtIndex:i]; } else { itemView = [[SKColorSwatchItemView alloc] init]; + [itemView setAutoresizingMask:NSViewNotSizable]; [self addSubview:itemView]; [itemViews addObject:itemView]; } @@ -882,7 +894,7 @@ } - (CGFloat)widthOffset { - return [self controlSize] == NSControlSizeSmall || [self controlSize] == NSControlSizeMini ? SMALL_BACKGROUND_WIDTH_OFFSET : BACKGROUND_WIDTH_OFFSET; + return [self controlSize] == NSControlSizeRegular ? BACKGROUND_WIDTH_OFFSET : SMALL_BACKGROUND_WIDTH_OFFSET; } - (instancetype)initWithFrame:(NSRect)frameRect { @@ -891,7 +903,7 @@ NSSegmentedCell *cell = [[NSSegmentedCell alloc] init]; [cell setSegmentCount:1]; [cell setSegmentStyle:NSSegmentStyleTexturedSquare]; - [cell setWidth:fmax(0.0, NSWidth(frameRect) - BACKGROUND_WIDTH_OFFSET) forSegment:0]; + [cell setWidth:fmax(0.0, NSWidth(frameRect) - [self widthOffset]) forSegment:0]; [self setCell:cell]; } return self; @@ -900,11 +912,11 @@ - (BOOL)canBecomeKeyView { return NO; } - (CGFloat)width { - return [[self cell] widthForSegment:0] + BACKGROUND_WIDTH_OFFSET; + return [[self cell] widthForSegment:0] + [self widthOffset]; } - (void)setWidth:(CGFloat)width { - [[self cell] setWidth:width - BACKGROUND_WIDTH_OFFSET forSegment:0]; + [[self cell] setWidth:width - [self widthOffset] 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-20 10:17:04
|
Revision: 14991 http://sourceforge.net/p/skim-app/code/14991 Author: hofman Date: 2025-03-20 10:16:57 +0000 (Thu, 20 Mar 2025) Log Message: ----------- Support small control size for color swatch, can be used by customized compact toolbar styles. Don't support large control size, as NSSegmentedCell really messes this up. Modified Paths: -------------- trunk/SKColorSwatch.m Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2025-03-19 17:18:01 UTC (rev 14990) +++ trunk/SKColorSwatch.m 2025-03-20 10:16:57 UTC (rev 14991) @@ -54,6 +54,7 @@ #define TARGET_KEY @"target" #define AUTORESIZES_KEY @"autoResizes" #define SELECTS_KEY @"selects" +#define BEZELHEIGHT_KEY @"bezelHeight" #define COLOR_KEY @"color" @@ -62,7 +63,8 @@ #define BEZEL_INSET_BOTTOM 2.0 #define COLOR_INSET 2.0 -#define BACKGROUND_WIDTH_OFFSET 6.0 +#define BACKGROUND_WIDTH_OFFSET 6.0 +#define SMALL_BACKGROUND_WIDTH_OFFSET 2.0 @interface SKColorSwatchBackgroundView : NSControl @property (nonatomic) CGFloat width; @@ -121,8 +123,6 @@ selectedIndex = -1; draggedIndex = -1; - bezelHeight = 22.0; - [self registerForDraggedTypes:[NSColor readableTypesForPasteboard:[NSPasteboard pasteboardWithName:NSPasteboardNameDrag]]]; } @@ -134,7 +134,8 @@ target = nil; autoResizes = YES; selects = NO; - + bezelHeight = 22.0; + [self commonInit]; SKColorSwatchBackgroundView *view = [[SKColorSwatchBackgroundView alloc] initWithFrame:[self bounds]]; @@ -159,7 +160,8 @@ target = [decoder decodeObjectForKey:TARGET_KEY]; autoResizes = [decoder decodeBoolForKey:AUTORESIZES_KEY]; selects = [decoder decodeBoolForKey:SELECTS_KEY]; - + bezelHeight = [decoder decodeDoubleForKey:BEZELHEIGHT_KEY]; + [self commonInit]; itemViews = [[NSMutableArray alloc] init]; @@ -170,6 +172,9 @@ else if ([view isKindOfClass:[SKColorSwatchItemView class]]) [itemViews addObject:(SKColorSwatchItemView *)view]; } + + // this is only used for the toolbar customization palette + [backgroundView setControlSize:NSControlSizeRegular]; } return self; } @@ -181,6 +186,7 @@ [coder encodeConditionalObject:target forKey:TARGET_KEY]; [coder encodeBool:autoResizes forKey:AUTORESIZES_KEY]; [coder encodeBool:selects forKey:SELECTS_KEY]; + [coder encodeDouble:bezelHeight forKey:BEZELHEIGHT_KEY]; } - (void)dealloc { @@ -295,6 +301,20 @@ } } +- (void)setControlSize:(NSControlSize)controlSize { + [super setControlSize:controlSize]; + [backgroundView setControlSize:controlSize > NSControlSizeMini ? NSControlSizeRegular : controlSize]; + if ([self window]) { + CGFloat height = [[backgroundView cell] cellSize].height - BEZEL_INSET_TOP - BEZEL_INSET_BOTTOM; + if (fabs(height - bezelHeight) > 0.0) { + bezelHeight = height; + [self updateSubviewLayout]; + if (autoResizes) + [self sizeToFit]; + } + } +} + #pragma mark Notification handling - (void)deactivate:(NSNotification *)note { @@ -861,6 +881,10 @@ return [super defaultAnimationForKey:key]; } +- (CGFloat)widthOffset { + return [self controlSize] == NSControlSizeSmall || [self controlSize] == NSControlSizeMini ? SMALL_BACKGROUND_WIDTH_OFFSET : BACKGROUND_WIDTH_OFFSET; +} + - (instancetype)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-19 17:18:14
|
Revision: 14990 http://sourceforge.net/p/skim-app/code/14990 Author: hofman Date: 2025-03-19 17:18:01 +0000 (Wed, 19 Mar 2025) Log Message: ----------- Set toolbarStyle before setting up toolbar. Otherwise small mode may be forgotten for compact toolbars. Modified Paths: -------------- trunk/SKMainToolbarController.m trunk/SKMainWindowController.m Modified: trunk/SKMainToolbarController.m =================================================================== --- trunk/SKMainToolbarController.m 2025-03-19 15:07:41 UTC (rev 14989) +++ trunk/SKMainToolbarController.m 2025-03-19 17:18:01 UTC (rev 14990) @@ -117,8 +117,6 @@ #define SKDocumentToolbarPrintItemIdentifier @"SKDocumentToolbarPrintItemIdentifier" #define SKDocumentToolbarCustomizeItemIdentifier @"SKDocumentToolbarCustomizeItemIdentifier" -#define SKToolbarPlacementKey @"SKToolbarPlacement" - static NSString *noteToolImageNames[] = {@"ToolbarTextNoteMenu", @"ToolbarAnchoredNoteMenu", @"ToolbarCircleNoteMenu", @"ToolbarSquareNoteMenu", @"ToolbarHighlightNoteMenu", @"ToolbarUnderlineNoteMenu", @"ToolbarStrikeOutNoteMenu", @"ToolbarLineNoteMenu", @"ToolbarInkNoteMenu"}; static NSString *addNoteToolImageNames[] = {@"ToolbarAddTextNoteMenu", @"ToolbarAddAnchoredNoteMenu", @"ToolbarAddCircleNoteMenu", @"ToolbarAddSquareNoteMenu", @"ToolbarAddHighlightNoteMenu", @"ToolbarAddUnderlineNoteMenu", @"ToolbarAddStrikeOutNoteMenu", @"ToolbarAddLineNoteMenu", @"ToolbarAddInkNoteMenu"}; @@ -168,10 +166,12 @@ [self view]; // Create a new toolbar instance, and attach it to our document window - NSToolbar *toolbar; - if (([[NSUserDefaults standardUserDefaults] integerForKey:SKToolbarPlacementKey] & 1)) - toolbar = [[NSToolbar alloc] initWithIdentifier:SKDocumentToolbarIdentifier]; - else + NSToolbar *toolbar = nil; + if (@available(macOS 11.0, *)) { + if ([[mainController window] toolbarStyle] == NSWindowToolbarStyleUnifiedCompact) + toolbar = [[NSToolbar alloc] initWithIdentifier:SKDocumentToolbarIdentifier]; + } + if (toolbar == nil) toolbar = [[SKToolbar alloc] initWithIdentifier:SKDocumentToolbarIdentifier]; // Set up toolbar properties: Allow customization, give a default display mode, and remember state in user defaults Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-03-19 15:07:41 UTC (rev 14989) +++ trunk/SKMainWindowController.m 2025-03-19 17:18:01 UTC (rev 14990) @@ -324,11 +324,6 @@ pdfView = [[SKPDFView alloc] initWithFrame:[pdfContentView bounds]]; [pdfView setTranslatesAutoresizingMaskIntoConstraints:NO]; - // Set up the tool bar - toolbarController = [[SKMainToolbarController alloc] init]; - [toolbarController setMainController:self]; - [toolbarController setupToolbar]; - // Set up the window enum { SKTBCompact = 1<<0, SKTBBesideTitle = 1<<1, SKTBReplacingTitle = 1<<2}; @@ -335,8 +330,15 @@ // hidden pref for toolbar position relative to title, 0-7 // SKTBBesideTitle | SKTBReplacingTitle = tab bar replacing title NSInteger placement = [[NSUserDefaults standardUserDefaults] integerForKey:SKToolbarPlacementKey]; + if (@available(macOS 11.0, *)) + [window setToolbarStyle:placement <= SKTBCompact ? NSWindowToolbarStyleExpanded : (placement & SKTBCompact) ? NSWindowToolbarStyleUnifiedCompact : NSWindowToolbarStyleUnified]; + + // Set up the tool bar + toolbarController = [[SKMainToolbarController alloc] init]; + [toolbarController setMainController:self]; + [toolbarController setupToolbar]; + if (@available(macOS 11.0, *)) { - [window setToolbarStyle:placement <= SKTBCompact ? NSWindowToolbarStyleExpanded : (placement & SKTBCompact) ? NSWindowToolbarStyleUnifiedCompact : NSWindowToolbarStyleUnified]; if (placement == SKTBCompact) [[window toolbar] setDisplayMode:NSToolbarDisplayModeIconOnly]; } else if ((placement & SKTBCompact)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-19 15:07:44
|
Revision: 14989 http://sourceforge.net/p/skim-app/code/14989 Author: hofman Date: 2025-03-19 15:07:41 +0000 (Wed, 19 Mar 2025) Log Message: ----------- modify custom fullscreen animation when toolbar style is not expanded Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-03-18 16:58:38 UTC (rev 14988) +++ trunk/SKMainWindowController_FullScreen.m 2025-03-19 15:07:41 UTC (rev 14989) @@ -551,16 +551,22 @@ } static inline CGFloat fullScreenOffset(NSWindow *window) { - CGFloat offset = 17.0; - if (autoHideToolbarInFullScreen()) - offset = NSHeight([window frame]) - NSHeight([window contentLayoutRect]); - else if ([[window toolbar] isVisible] == NO) - offset = NSHeight([NSWindow frameRectForContentRect:NSZeroRect styleMask:NSWindowStyleMaskTitled]); - else if (fullScreenToolbarOffset > 0.0) - offset = fullScreenToolbarOffset; - else if (@available(macOS 11.0, *)) - offset = 16.0; - return offset; + if (autoHideToolbarInFullScreen()) { + return NSHeight([window frame]) - NSHeight([window contentLayoutRect]); + } else if ([[window toolbar] isVisible] == NO) { + return NSHeight([NSWindow frameRectForContentRect:NSZeroRect styleMask:NSWindowStyleMaskTitled]); + } else if (@available(macOS 11.0, *)) { + if ([window toolbarStyle] != NSWindowToolbarStyleExpanded) + return 0.0; + else if (fullScreenToolbarOffset > 0.0) + return fullScreenToolbarOffset; + else + return 16.0; + } else if (fullScreenToolbarOffset > 0.0) { + return fullScreenToolbarOffset; + } else { + return 17.0; + } } static inline CGFloat toolbarViewOffset(NSWindow *window) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-18 16:58:40
|
Revision: 14988 http://sourceforge.net/p/skim-app/code/14988 Author: hofman Date: 2025-03-18 16:58:38 +0000 (Tue, 18 Mar 2025) Log Message: ----------- Enable toolbar small size for compact toolbar, otherwise the customization palette is messed up Modified Paths: -------------- trunk/SKMainToolbarController.m Modified: trunk/SKMainToolbarController.m =================================================================== --- trunk/SKMainToolbarController.m 2025-03-18 16:21:23 UTC (rev 14987) +++ trunk/SKMainToolbarController.m 2025-03-18 16:58:38 UTC (rev 14988) @@ -117,6 +117,8 @@ #define SKDocumentToolbarPrintItemIdentifier @"SKDocumentToolbarPrintItemIdentifier" #define SKDocumentToolbarCustomizeItemIdentifier @"SKDocumentToolbarCustomizeItemIdentifier" +#define SKToolbarPlacementKey @"SKToolbarPlacement" + static NSString *noteToolImageNames[] = {@"ToolbarTextNoteMenu", @"ToolbarAnchoredNoteMenu", @"ToolbarCircleNoteMenu", @"ToolbarSquareNoteMenu", @"ToolbarHighlightNoteMenu", @"ToolbarUnderlineNoteMenu", @"ToolbarStrikeOutNoteMenu", @"ToolbarLineNoteMenu", @"ToolbarInkNoteMenu"}; static NSString *addNoteToolImageNames[] = {@"ToolbarAddTextNoteMenu", @"ToolbarAddAnchoredNoteMenu", @"ToolbarAddCircleNoteMenu", @"ToolbarAddSquareNoteMenu", @"ToolbarAddHighlightNoteMenu", @"ToolbarAddUnderlineNoteMenu", @"ToolbarAddStrikeOutNoteMenu", @"ToolbarAddLineNoteMenu", @"ToolbarAddInkNoteMenu"}; @@ -166,7 +168,11 @@ [self view]; // Create a new toolbar instance, and attach it to our document window - NSToolbar *toolbar = [[SKToolbar alloc] initWithIdentifier:SKDocumentToolbarIdentifier]; + NSToolbar *toolbar; + if (([[NSUserDefaults standardUserDefaults] integerForKey:SKToolbarPlacementKey] & 1)) + toolbar = [[NSToolbar alloc] initWithIdentifier:SKDocumentToolbarIdentifier]; + else + toolbar = [[SKToolbar alloc] initWithIdentifier:SKDocumentToolbarIdentifier]; // Set up toolbar properties: Allow customization, give a default display mode, and remember state in user defaults [toolbar setAllowsUserCustomization:YES]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-18 16:21:27
|
Revision: 14987 http://sourceforge.net/p/skim-app/code/14987 Author: hofman Date: 2025-03-18 16:21:23 +0000 (Tue, 18 Mar 2025) Log Message: ----------- Don't use Toggle tool tips fo toolbar items, dynamically change tool tip to Show or Hide Modified Paths: -------------- trunk/SKMainToolbarController.m trunk/de.lproj/Localizable.strings trunk/en.lproj/Localizable.strings trunk/es.lproj/Localizable.strings trunk/fr.lproj/Localizable.strings trunk/it.lproj/Localizable.strings trunk/ja.lproj/Localizable.strings trunk/nl.lproj/Localizable.strings trunk/pl.lproj/Localizable.strings trunk/ru.lproj/Localizable.strings trunk/zh_CN.lproj/Localizable.strings trunk/zh_TW.lproj/Localizable.strings Modified: trunk/SKMainToolbarController.m =================================================================== --- trunk/SKMainToolbarController.m 2025-03-18 09:57:31 UTC (rev 14986) +++ trunk/SKMainToolbarController.m 2025-03-18 16:21:23 UTC (rev 14987) @@ -63,6 +63,7 @@ #import "SKShareMenuController.h" #import "NSFont_SKExtensions.h" #import "SKNoteToolbarController.h" +#import "NSObject_SKExtensions.h" #define SKDocumentToolbarIdentifier @"SKDocumentToolbar" @@ -134,6 +135,8 @@ @interface SKMainToolbarController (SKPrivate) - (void)handleColorSwatchFrameChangedNotification:(NSNotification *)notification; - (void)updateColorsMenu:(NSMenu *)menu; +- (void)updatePaneItemToolTips; +- (void)updateSplitPDFItemToolTips; @end @@ -526,7 +529,7 @@ menu = [menuItem submenu]; [item setLabels:NSLocalizedString(@"Notes", @"Toolbar item label")]; - [item setToolTip:NSLocalizedString(@"Show Note Toolbar", @"Tool tip message")]; + [item setToolTip:[mainController hasNoteToolbar] ? NSLocalizedString(@"Hide Note Toolbar", @"Tool tip message") : NSLocalizedString(@"Show Note Toolbar", @"Tool tip message")]; [item setView:notesButton]; [item setMenuFormRepresentation:menuItem]; @@ -836,7 +839,7 @@ menuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Contents Pane", @"Menu item title") action:@selector(toggleLeftSidePane:) target:mainController]; [item setLabels:NSLocalizedString(@"Contents Pane", @"Toolbar item label")]; - [item setToolTip:NSLocalizedString(@"Toggle Contents Pane", @"Tool tip message")]; + [item setToolTip:[mainController leftSidePaneIsOpen] ? NSLocalizedString(@"Hide Contents Pane", @"Tool tip message") : NSLocalizedString(@"Show Contents Pane", @"Tool tip message")]; [item setView:leftPaneButton]; [item setMenuFormRepresentation:menuItem]; @@ -845,7 +848,7 @@ menuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Notes Pane", @"Menu item title") action:@selector(toggleRightSidePane:) target:mainController]; [item setLabels:NSLocalizedString(@"Notes Pane", @"Toolbar item label")]; - [item setToolTip:NSLocalizedString(@"Toggle Notes Pane", @"Tool tip message")]; + [item setToolTip:[mainController rightSidePaneIsOpen] ? NSLocalizedString(@"Hide Notes Pane", @"Tool tip message") : NSLocalizedString(@"Show Notes Pane", @"Tool tip message")]; [item setView:rightPaneButton]; [item setMenuFormRepresentation:menuItem]; @@ -854,7 +857,7 @@ menuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Notes Pane", @"Menu item title") action:@selector(toggleSplitPDF:) target:mainController]; [item setLabels:NSLocalizedString(@"Split PDF", @"Toolbar item label")]; - [item setToolTip:NSLocalizedString(@"Toggle Split PDF", @"Tool tip message")]; + [item setToolTip:[(NSView *)mainController.secondaryPdfView window] ? NSLocalizedString(@"Hide Split PDF", @"Tool tip message") : NSLocalizedString(@"Show Split PDF", @"Tool tip message")]; [item setView:splitPDFButton]; [item setMenuFormRepresentation:menuItem]; @@ -1079,9 +1082,20 @@ - (void)noteToolbarDidShowOrHide { [notesButton setSelected:[mainController hasNoteToolbar] forSegment:0]; - [[toolbarItems objectForKey:SKDocumentToolbarNotesItemIdentifier] setToolTip:[mainController hasNoteToolbar] ? NSLocalizedString(@"Hide Note Toolbar", @"Tool tip message") : NSLocalizedString(@"Show Note Toolbar", @"Tool tip message")]; } +- (void)updatePaneItemToolTips { + NSToolbarItem *item = [toolbarItems objectForKey:SKDocumentToolbarContentsPaneItemIdentifier]; + [item setToolTip:[mainController leftSidePaneIsOpen] ? NSLocalizedString(@"Hide Contents Pane", @"Tool tip message") : NSLocalizedString(@"Show Contents Pane", @"Tool tip message")]; + item = [toolbarItems objectForKey:SKDocumentToolbarNotesPaneItemIdentifier]; + [item setToolTip:[mainController rightSidePaneIsOpen] ? NSLocalizedString(@"Hide Notes Pane", @"Tool tip message") : NSLocalizedString(@"Show Notes Pane", @"Tool tip message")]; +} + +- (void)updateSplitPDFItemToolTips { + NSToolbarItem *item = [toolbarItems objectForKey:SKDocumentToolbarSplitPDFItemIdentifier]; + [item setToolTip:[(NSView *)mainController.secondaryPdfView window] ? NSLocalizedString(@"Hide Split PDF", @"Tool tip message") : NSLocalizedString(@"Show Split PDF", @"Tool tip message")]; +} + - (IBAction)goToPreviousNextFirstLastPage:(id)sender { NSInteger tag = [sender selectedTag]; if (tag == -1) @@ -1425,6 +1439,14 @@ [pacerButton setImage:[NSImage imageNamed:name] forSegment:0]; } +- (void)handleSplitViewDidResizeSubviewsNotification:(NSNotification *)notification { + [self performSelectorOnce:@selector(updatePaneItemToolTips) afterDelay:0.1]; +} + +- (void)handlePDFSplitViewDidResizeSubviewsNotification:(NSNotification *)notification { + [self performSelectorOnce:@selector(updateSplitPDFItemToolTips) afterDelay:0.1]; +} + - (void)registerForNotifications { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; @@ -1456,7 +1478,11 @@ name:PDFViewDisplayBoxChangedNotification object:mainController.pdfView]; [nc addObserver:self selector:@selector(handleChangedHistoryNotification:) name:PDFViewChangedHistoryNotification object:mainController.pdfView]; - + [nc addObserver:self selector:@selector(handleSplitViewDidResizeSubviewsNotification:) + name:NSSplitViewDidResizeSubviewsNotification object:mainController.splitView]; + [nc addObserver:self selector:@selector(handlePDFSplitViewDidResizeSubviewsNotification:) + name:NSSplitViewDidResizeSubviewsNotification object:mainController.pdfSplitView]; + [self handleChangedHistoryNotification:nil]; [self handlePageChangedNotification:nil]; [self handleScaleChangedNotification:nil]; Modified: trunk/de.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/en.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/es.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/fr.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/it.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/ja.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/nl.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/zh_CN.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/Localizable.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-18 09:57:39
|
Revision: 14986 http://sourceforge.net/p/skim-app/code/14986 Author: hofman Date: 2025-03-18 09:57:31 +0000 (Tue, 18 Mar 2025) Log Message: ----------- change method name Modified Paths: -------------- trunk/SKMainWindow.m Modified: trunk/SKMainWindow.m =================================================================== --- trunk/SKMainWindow.m 2025-03-18 09:54:07 UTC (rev 14985) +++ trunk/SKMainWindow.m 2025-03-18 09:57:31 UTC (rev 14986) @@ -125,7 +125,7 @@ [super setDelegate:newDelegate]; } -- (NSTitlebarAccessoryViewController *)safeTabBarAccessoryViewController { +- (NSTitlebarAccessoryViewController *)safeTabBarViewController { if ([self respondsToSelector:@selector(_tabBarAccessoryViewController)]) return [self _tabBarAccessoryViewController]; return nil; @@ -134,7 +134,7 @@ - (void)updateForToolbarVisibility:(BOOL)toolbarIsVisible { if (autoTitleVisibility == SKWindowTitleHiddenForTabBar) { NSLayoutAttribute layoutAttribute = toolbarIsVisible ? NSLayoutAttributeBottom : NSLayoutAttributeTop; - NSTitlebarAccessoryViewController *tabBarController = [self safeTabBarAccessoryViewController]; + NSTitlebarAccessoryViewController *tabBarController = [self safeTabBarViewController]; if (tabBarController && [tabBarController layoutAttribute] != layoutAttribute) { NSUInteger i = [[self titlebarAccessoryViewControllers] indexOfObject:tabBarController]; if (i != NSNotFound) { @@ -153,7 +153,7 @@ autoTitleVisibility = visibility; if (autoTitleVisibility) [self updateForToolbarVisibility:[[self toolbar] isVisible]]; - if (autoTitleVisibility == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryViewController] && [[self titlebarAccessoryViewControllers] containsObject:[self safeTabBarAccessoryViewController]]) + if (autoTitleVisibility == SKWindowTitleHiddenForTabBar && [self safeTabBarViewController] && [[self titlebarAccessoryViewControllers] containsObject:[self safeTabBarViewController]]) [self setTitleVisibility:NSWindowTitleHidden]; } } @@ -171,7 +171,7 @@ } - (void)addTitlebarAccessoryViewController:(NSTitlebarAccessoryViewController *)childViewController { - if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryViewController] == childViewController) { + if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarViewController] == childViewController) { [self setTitleVisibility:NSWindowTitleHidden]; if ([[self toolbar] isVisible] == NO) { [childViewController setLayoutAttribute:NSLayoutAttributeTop]; @@ -186,7 +186,7 @@ } - (void)removeTitlebarAccessoryViewControllerAtIndex:(NSInteger)index { - if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryViewController] == [[self titlebarAccessoryViewControllers] objectAtIndex:index]) { + if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarViewController] == [[self titlebarAccessoryViewControllers] objectAtIndex:index]) { [super removeTitlebarAccessoryViewControllerAtIndex:index]; [self setTitleVisibility:NSWindowTitleVisible]; if ([[self toolbar] isVisible] == NO) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-18 09:54:14
|
Revision: 14985 http://sourceforge.net/p/skim-app/code/14985 Author: hofman Date: 2025-03-18 09:54:07 +0000 (Tue, 18 Mar 2025) Log Message: ----------- change method name Modified Paths: -------------- trunk/SKMainWindow.m Modified: trunk/SKMainWindow.m =================================================================== --- trunk/SKMainWindow.m 2025-03-17 22:48:55 UTC (rev 14984) +++ trunk/SKMainWindow.m 2025-03-18 09:54:07 UTC (rev 14985) @@ -125,7 +125,7 @@ [super setDelegate:newDelegate]; } -- (NSTitlebarAccessoryViewController *)safeTabBarAccessoryController { +- (NSTitlebarAccessoryViewController *)safeTabBarAccessoryViewController { if ([self respondsToSelector:@selector(_tabBarAccessoryViewController)]) return [self _tabBarAccessoryViewController]; return nil; @@ -134,7 +134,7 @@ - (void)updateForToolbarVisibility:(BOOL)toolbarIsVisible { if (autoTitleVisibility == SKWindowTitleHiddenForTabBar) { NSLayoutAttribute layoutAttribute = toolbarIsVisible ? NSLayoutAttributeBottom : NSLayoutAttributeTop; - NSTitlebarAccessoryViewController *tabBarController = [self safeTabBarAccessoryController]; + NSTitlebarAccessoryViewController *tabBarController = [self safeTabBarAccessoryViewController]; if (tabBarController && [tabBarController layoutAttribute] != layoutAttribute) { NSUInteger i = [[self titlebarAccessoryViewControllers] indexOfObject:tabBarController]; if (i != NSNotFound) { @@ -153,7 +153,7 @@ autoTitleVisibility = visibility; if (autoTitleVisibility) [self updateForToolbarVisibility:[[self toolbar] isVisible]]; - if (autoTitleVisibility == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryController] && [[self titlebarAccessoryViewControllers] containsObject:[self safeTabBarAccessoryController]]) + if (autoTitleVisibility == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryViewController] && [[self titlebarAccessoryViewControllers] containsObject:[self safeTabBarAccessoryViewController]]) [self setTitleVisibility:NSWindowTitleHidden]; } } @@ -171,7 +171,7 @@ } - (void)addTitlebarAccessoryViewController:(NSTitlebarAccessoryViewController *)childViewController { - if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryController] == childViewController) { + if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryViewController] == childViewController) { [self setTitleVisibility:NSWindowTitleHidden]; if ([[self toolbar] isVisible] == NO) { [childViewController setLayoutAttribute:NSLayoutAttributeTop]; @@ -186,7 +186,7 @@ } - (void)removeTitlebarAccessoryViewControllerAtIndex:(NSInteger)index { - if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryController] == [[self titlebarAccessoryViewControllers] objectAtIndex:index]) { + if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryViewController] == [[self titlebarAccessoryViewControllers] objectAtIndex:index]) { [super removeTitlebarAccessoryViewControllerAtIndex:index]; [self setTitleVisibility:NSWindowTitleVisible]; if ([[self toolbar] isVisible] == NO) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-17 22:49:01
|
Revision: 14984 http://sourceforge.net/p/skim-app/code/14984 Author: hofman Date: 2025-03-17 22:48:55 +0000 (Mon, 17 Mar 2025) Log Message: ----------- Check for tab bar controller before removing it Modified Paths: -------------- trunk/SKMainWindow.m Modified: trunk/SKMainWindow.m =================================================================== --- trunk/SKMainWindow.m 2025-03-17 22:33:21 UTC (rev 14983) +++ trunk/SKMainWindow.m 2025-03-17 22:48:55 UTC (rev 14984) @@ -186,8 +186,8 @@ } - (void)removeTitlebarAccessoryViewControllerAtIndex:(NSInteger)index { - [super removeTitlebarAccessoryViewControllerAtIndex:index]; if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryController] == [[self titlebarAccessoryViewControllers] objectAtIndex:index]) { + [super removeTitlebarAccessoryViewControllerAtIndex:index]; [self setTitleVisibility:NSWindowTitleVisible]; if ([[self toolbar] isVisible] == NO) { NSURL *url = [self representedURL]; @@ -194,6 +194,8 @@ [self setRepresentedURL:nil]; [self setRepresentedURL:url]; } + } else { + [super removeTitlebarAccessoryViewControllerAtIndex:index]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-17 22:33:22
|
Revision: 14983 http://sourceforge.net/p/skim-app/code/14983 Author: hofman Date: 2025-03-17 22:33:21 +0000 (Mon, 17 Mar 2025) Log Message: ----------- Move title bar accessory view controller to titlebar only for tab bar controller Modified Paths: -------------- trunk/SKMainWindow.m Modified: trunk/SKMainWindow.m =================================================================== --- trunk/SKMainWindow.m 2025-03-17 17:55:47 UTC (rev 14982) +++ trunk/SKMainWindow.m 2025-03-17 22:33:21 UTC (rev 14983) @@ -42,6 +42,10 @@ #import "NSEvent_SKExtensions.h" +@interface NSWindow (SKPrivateDeclarations) +- (NSTitlebarAccessoryViewController *)_tabBarAccessoryViewController; +@end + @implementation SKMainWindow @synthesize disableConstrainedFrame, autoTitleVisibility; @@ -121,14 +125,23 @@ [super setDelegate:newDelegate]; } +- (NSTitlebarAccessoryViewController *)safeTabBarAccessoryController { + if ([self respondsToSelector:@selector(_tabBarAccessoryViewController)]) + return [self _tabBarAccessoryViewController]; + return nil; +} + - (void)updateForToolbarVisibility:(BOOL)toolbarIsVisible { if (autoTitleVisibility == SKWindowTitleHiddenForTabBar) { NSLayoutAttribute layoutAttribute = toolbarIsVisible ? NSLayoutAttributeBottom : NSLayoutAttributeTop; - NSTitlebarAccessoryViewController *tabBarController = [[self titlebarAccessoryViewControllers] firstObject]; + NSTitlebarAccessoryViewController *tabBarController = [self safeTabBarAccessoryController]; if (tabBarController && [tabBarController layoutAttribute] != layoutAttribute) { - [super removeTitlebarAccessoryViewControllerAtIndex:0]; - [tabBarController setLayoutAttribute:layoutAttribute]; - [super addTitlebarAccessoryViewController:tabBarController]; + NSUInteger i = [[self titlebarAccessoryViewControllers] indexOfObject:tabBarController]; + if (i != NSNotFound) { + [super removeTitlebarAccessoryViewControllerAtIndex:i]; + [tabBarController setLayoutAttribute:layoutAttribute]; + [super addTitlebarAccessoryViewController:tabBarController]; + } } } else if (autoTitleVisibility == SKWindowTitleHiddenForToolbar) { [self setTitleVisibility:toolbarIsVisible ? NSWindowTitleHidden : NSWindowTitleVisible]; @@ -140,7 +153,7 @@ autoTitleVisibility = visibility; if (autoTitleVisibility) [self updateForToolbarVisibility:[[self toolbar] isVisible]]; - if (autoTitleVisibility == SKWindowTitleHiddenForTabBar && [[self titlebarAccessoryViewControllers] count]) + if (autoTitleVisibility == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryController] && [[self titlebarAccessoryViewControllers] containsObject:[self safeTabBarAccessoryController]]) [self setTitleVisibility:NSWindowTitleHidden]; } } @@ -158,7 +171,7 @@ } - (void)addTitlebarAccessoryViewController:(NSTitlebarAccessoryViewController *)childViewController { - if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar) { + if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryController] == childViewController) { [self setTitleVisibility:NSWindowTitleHidden]; if ([[self toolbar] isVisible] == NO) { [childViewController setLayoutAttribute:NSLayoutAttributeTop]; @@ -174,7 +187,7 @@ - (void)removeTitlebarAccessoryViewControllerAtIndex:(NSInteger)index { [super removeTitlebarAccessoryViewControllerAtIndex:index]; - if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar) { + if ([self autoTitleVisibility] == SKWindowTitleHiddenForTabBar && [self safeTabBarAccessoryController] == [[self titlebarAccessoryViewControllers] objectAtIndex:index]) { [self setTitleVisibility:NSWindowTitleVisible]; if ([[self toolbar] isVisible] == NO) { NSURL *url = [self representedURL]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-17 17:55:54
|
Revision: 14982 http://sourceforge.net/p/skim-app/code/14982 Author: hofman Date: 2025-03-17 17:55:47 +0000 (Mon, 17 Mar 2025) Log Message: ----------- Add shortcut to toggle note toolbar menu item Modified Paths: -------------- trunk/Base.lproj/MainMenu.xib Modified: trunk/Base.lproj/MainMenu.xib =================================================================== --- trunk/Base.lproj/MainMenu.xib 2025-03-17 17:53:51 UTC (rev 14981) +++ trunk/Base.lproj/MainMenu.xib 2025-03-17 17:55:47 UTC (rev 14982) @@ -729,8 +729,8 @@ <action selector="toggleStatusBar:" target="-1" id="869"/> </connections> </menuItem> - <menuItem title="Show Note Toolbar" id="7Qv-kA-iZg"> - <modifierMask key="keyEquivalentModifierMask"/> + <menuItem title="Show Note Toolbar" keyEquivalent="a" id="7Qv-kA-iZg"> + <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="toggleNoteToolbar:" target="-1" id="mBw-ag-ukh"/> </connections> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-17 17:53:58
|
Revision: 14981 http://sourceforge.net/p/skim-app/code/14981 Author: hofman Date: 2025-03-17 17:53:51 +0000 (Mon, 17 Mar 2025) Log Message: ----------- Set tooltip on some note toolbar items Modified Paths: -------------- trunk/SKNoteToolbarController.m Modified: trunk/SKNoteToolbarController.m =================================================================== --- trunk/SKNoteToolbarController.m 2025-03-17 17:50:11 UTC (rev 14980) +++ trunk/SKNoteToolbarController.m 2025-03-17 17:53:51 UTC (rev 14981) @@ -91,6 +91,7 @@ [noteButton setTranslatesAutoresizingMaskIntoConstraints:NO]; colorsButton = [NSSegmentedControl segmentedControlWithImages:@[[NSImage imageNamed:SKImageNameToolbarColors]] trackingMode:NSSegmentSwitchTrackingMomentary target:nil action:@selector(orderFrontColorPanel:)]; + [colorsButton setHelp:NSLocalizedString(@"Colors", @"Tool tip message") forSegment:0]; [colorsButton setTranslatesAutoresizingMaskIntoConstraints:NO]; NSMenu *menu = [NSMenu menu]; [colorsButton setMenu:menu forSegment:0]; @@ -98,6 +99,7 @@ [[NSUserDefaults standardUserDefaults] addObserver:self forKeyPath:SKSwatchColorsKey options:0 context:&SKDefaultsObservationContext]; fontsButton = [NSSegmentedControl segmentedControlWithImages:@[[NSImage imageNamed:SKImageNameToolbarFonts]] trackingMode:NSSegmentSwitchTrackingMomentary target:nil action:@selector(orderFrontFontPanel:)]; + [fontsButton setHelp:NSLocalizedString(@"Fonts", @"Tool tip message") forSegment:0]; [fontsButton setTranslatesAutoresizingMaskIntoConstraints:NO]; menu = [NSMenu menu]; for (NSInteger i = 9; i < 19; i++) { @@ -106,6 +108,7 @@ [fontsButton setMenu:menu forSegment:0]; linesButton = [NSSegmentedControl segmentedControlWithImages:@[[NSImage imageNamed:SKImageNameToolbarLines]] trackingMode:NSSegmentSwitchTrackingMomentary target:nil action:@selector(orderFrontLineInspector:)]; + [linesButton setHelp:NSLocalizedString(@"Lines", @"Tool tip message") forSegment:0]; [linesButton setTranslatesAutoresizingMaskIntoConstraints:NO]; menu = [NSMenu menu]; NSSize size = NSMakeSize(32.0, 16.0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-17 17:50:19
|
Revision: 14980 http://sourceforge.net/p/skim-app/code/14980 Author: hofman Date: 2025-03-17 17:50:11 +0000 (Mon, 17 Mar 2025) Log Message: ----------- Add a toolbar item to toggle the note toolbar Modified Paths: -------------- trunk/MainToolbar.xib trunk/NSImage_SKExtensions.h trunk/NSImage_SKExtensions.m trunk/SKMainToolbarController.h trunk/SKMainToolbarController.m trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKMainWindowController_Actions.m trunk/de.lproj/Localizable.strings trunk/en.lproj/Localizable.strings trunk/en.lproj/MainMenu.strings trunk/es.lproj/Localizable.strings trunk/fr.lproj/Localizable.strings trunk/it.lproj/Localizable.strings trunk/ja.lproj/Localizable.strings trunk/nl.lproj/Localizable.strings trunk/pl.lproj/Localizable.strings trunk/ru.lproj/Localizable.strings trunk/zh_CN.lproj/Localizable.strings trunk/zh_TW.lproj/Localizable.strings Modified: trunk/MainToolbar.xib =================================================================== --- trunk/MainToolbar.xib 2025-03-17 16:37:25 UTC (rev 14979) +++ trunk/MainToolbar.xib 2025-03-17 17:50:11 UTC (rev 14980) @@ -30,6 +30,7 @@ <outlet property="markupNoteButton" destination="8" id="120"/> <outlet property="nextPageButton" destination="20" id="85"/> <outlet property="noteButton" destination="34" id="98"/> + <outlet property="notesButton" destination="QAZ-7p-tLt" id="Feq-8t-UFi"/> <outlet property="pacerButton" destination="Veq-Br-EFG" id="J9Q-bD-AEQ"/> <outlet property="pacerSpeedField" destination="jHc-Bm-dWJ" id="bX9-eZ-X4K"/> <outlet property="pacerSpeedStepper" destination="jYx-ER-Exi" id="sy8-pN-C86"/> @@ -707,6 +708,19 @@ <action selector="toggleSplitPDF:" target="-2" id="Xd4-fe-2EM"/> </connections> </segmentedControl> + <segmentedControl verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="QAZ-7p-tLt"> + <rect key="frame" x="166" y="99" width="33" height="23"/> + <autoresizingMask key="autoresizingMask"/> + <segmentedCell key="cell" borderStyle="border" alignment="left" segmentDistribution="fill" style="texturedSquare" trackingMode="selectAny" id="63Q-cd-We8"> + <font key="font" metaFont="system"/> + <segments> + <segment image="ToolbarNotes" imageScaling="none" width="27"/> + </segments> + </segmentedCell> + <connections> + <action selector="toggleNoteToolbar:" target="-1" id="Q1r-DD-NdN"/> + </connections> + </segmentedControl> </subviews> <constraints> <constraint firstAttribute="bottom" secondItem="38" secondAttribute="bottom" constant="275" id="6OB-P3-1wa"/> @@ -760,6 +774,7 @@ <image name="ToolbarMagnifyTool" width="128" height="128"/> <image name="ToolbarMediaBox" width="128" height="128"/> <image name="ToolbarMoveTool" width="27" height="19"/> + <image name="ToolbarNotes" width="128" height="128"/> <image name="ToolbarPageBreaks" width="128" height="128"/> <image name="ToolbarPageDown" width="128" height="128"/> <image name="ToolbarPageUp" width="128" height="128"/> Modified: trunk/NSImage_SKExtensions.h =================================================================== --- trunk/NSImage_SKExtensions.h 2025-03-17 16:37:25 UTC (rev 14979) +++ trunk/NSImage_SKExtensions.h 2025-03-17 17:50:11 UTC (rev 14980) @@ -108,6 +108,7 @@ extern NSString *SKImageNameToolbarAddStrikeOutNoteMenu; extern NSString *SKImageNameToolbarAddLineNoteMenu; extern NSString *SKImageNameToolbarAddInkNoteMenu; +extern NSString *SKImageNameToolbarNotes; extern NSString *SKImageNameToolbarTextTool; extern NSString *SKImageNameToolbarMoveTool; extern NSString *SKImageNameToolbarMagnifyTool; Modified: trunk/NSImage_SKExtensions.m =================================================================== --- trunk/NSImage_SKExtensions.m 2025-03-17 16:37:25 UTC (rev 14979) +++ trunk/NSImage_SKExtensions.m 2025-03-17 17:50:11 UTC (rev 14980) @@ -112,6 +112,7 @@ NSString *SKImageNameToolbarAddStrikeOutNoteMenu = @"ToolbarAddStrikeOutNoteMenu"; NSString *SKImageNameToolbarAddLineNoteMenu = @"ToolbarAddLineNoteMenu"; NSString *SKImageNameToolbarAddInkNoteMenu = @"ToolbarAddInkNoteMenu"; +NSString *SKImageNameToolbarNotes = @"ToolbarNotes"; NSString *SKImageNameToolbarTextTool = @"ToolbarTextTool"; NSString *SKImageNameToolbarMoveTool = @"ToolbarMoveTool"; NSString *SKImageNameToolbarMagnifyTool = @"ToolbarMagnifyTool"; @@ -780,6 +781,17 @@ [path fill]; ); + MAKE_IMAGE(SKImageNameToolbarNotes, YES, 27.0, 19.0, + translate(3.0, 0.0); + drawTextNote(nil); + [[NSColor blackColor] setStroke]; + NSBezierPath *path = [NSBezierPath bezierPath]; + [path moveToPoint:NSMakePoint(2.0, 3.0)]; + [path lineToPoint:NSMakePoint(19.0, 3.0)]; + [path setLineWidth:2.0]; + [path stroke]; + ); + MAKE_IMAGE(SKImageNameToolbarMoveTool, YES, 27.0, 19.0, [[NSColor blackColor] setStroke]; translate(-3, -6); Modified: trunk/SKMainToolbarController.h =================================================================== --- trunk/SKMainToolbarController.h 2025-03-17 16:37:25 UTC (rev 14979) +++ trunk/SKMainToolbarController.h 2025-03-17 17:50:11 UTC (rev 14980) @@ -86,6 +86,7 @@ NSSegmentedControl *customizeButton; NSTextField *scaleField; NSSegmentedControl *noteButton; + NSSegmentedControl *notesButton; SKColorSwatch *colorSwatch; NSSegmentedControl *pacerButton; NSTextField *pacerSpeedField; @@ -96,7 +97,7 @@ } @property (nonatomic, nullable, weak) IBOutlet SKMainWindowController *mainController; -@property (nonatomic, nullable, strong) IBOutlet NSSegmentedControl *backForwardButton, *previousNextPageButton, *previousPageButton, *nextPageButton, *previousNextFirstLastPageButton, *zoomInOutButton, *zoomInActualOutButton, *zoomActualButton, *zoomFitButton, *zoomSelectionButton, *autoScalesButton, *rotateLeftButton, *rotateRightButton, *rotateLeftRightButton, *cropButton, *fullScreenButton, *presentationButton, *leftPaneButton, *rightPaneButton, *splitPDFButton, *toolModeButton, *textNoteButton, *circleNoteButton, *markupNoteButton, *lineNoteButton, *singleTwoUpButton, *continuousButton, *displayModeButton, *displayDirectionButton, *displaysRTLButton, *bookModeButton, *pageBreaksButton, *displayBoxButton, *infoButton, *colorsButton, *fontsButton, *linesButton, *printButton, *customizeButton, *noteButton, *pacerButton, *shareButton; +@property (nonatomic, nullable, strong) IBOutlet NSSegmentedControl *backForwardButton, *previousNextPageButton, *previousPageButton, *nextPageButton, *previousNextFirstLastPageButton, *zoomInOutButton, *zoomInActualOutButton, *zoomActualButton, *zoomFitButton, *zoomSelectionButton, *autoScalesButton, *rotateLeftButton, *rotateRightButton, *rotateLeftRightButton, *cropButton, *fullScreenButton, *presentationButton, *leftPaneButton, *rightPaneButton, *splitPDFButton, *toolModeButton, *textNoteButton, *circleNoteButton, *markupNoteButton, *lineNoteButton, *singleTwoUpButton, *continuousButton, *displayModeButton, *displayDirectionButton, *displaysRTLButton, *bookModeButton, *pageBreaksButton, *displayBoxButton, *infoButton, *colorsButton, *fontsButton, *linesButton, *printButton, *customizeButton, *noteButton, *notesButton, *pacerButton, *shareButton; @property (nonatomic, nullable, strong) IBOutlet NSTextField *pageNumberField, *scaleField, *pacerSpeedField; @property (nonatomic, nullable, strong) IBOutlet SKColorSwatch *colorSwatch; @property (nonatomic, nullable, strong) IBOutlet NSStepper *pacerSpeedStepper; @@ -107,6 +108,8 @@ - (void)handleChangedHistoryNotification:(nullable NSNotification *)notification; - (void)handlePageChangedNotification:(nullable NSNotification *)notification; +- (void)noteToolbarDidShowOrHide; + - (void)updateMinMaxScale; #pragma mark Actions @@ -139,6 +142,7 @@ - (void)createNewCircleNote:(nullable id)sender; - (void)createNewMarkupNote:(nullable id)sender; - (void)createNewLineNote:(nullable id)sender; +- (void)toggleNoteToolbar:(nullable id)sender; - (IBAction)createNewNote:(nullable id)sender; - (IBAction)changeToolMode:(nullable id)sender; - (IBAction)selectColor:(nullable id)sender; Modified: trunk/SKMainToolbarController.m =================================================================== --- trunk/SKMainToolbarController.m 2025-03-17 16:37:25 UTC (rev 14979) +++ trunk/SKMainToolbarController.m 2025-03-17 17:50:11 UTC (rev 14980) @@ -62,6 +62,7 @@ #import "PDFDocument_SKExtensions.h" #import "SKShareMenuController.h" #import "NSFont_SKExtensions.h" +#import "SKNoteToolbarController.h" #define SKDocumentToolbarIdentifier @"SKDocumentToolbar" @@ -89,6 +90,7 @@ #define SKDocumentToolbarNewMarkupItemIdentifier @"SKDocumentToolbarNewMarkupItemIdentifier" #define SKDocumentToolbarNewLineItemIdentifier @"SKDocumentToolbarNewLineItemIdentifier" #define SKDocumentToolbarNewNoteItemIdentifier @"SKDocumentToolbarNewNoteItemIdentifier" +#define SKDocumentToolbarNotesItemIdentifier @"SKDocumentToolbarNotesItemIdentifier" #define SKDocumentToolbarInfoItemIdentifier @"SKDocumentToolbarInfoItemIdentifier" #define SKDocumentToolbarToolModeItemIdentifier @"SKDocumentToolbarToolModeItemIdentifier" #define SKDocumentToolbarSingleTwoUpItemIdentifier @"SKDocumentToolbarSingleTwoUpItemIdentifier" @@ -137,7 +139,7 @@ @implementation SKMainToolbarController -@synthesize mainController, backForwardButton, pageNumberField, previousNextPageButton, previousPageButton, nextPageButton, previousNextFirstLastPageButton, zoomInOutButton, zoomInActualOutButton, zoomActualButton, zoomFitButton, zoomSelectionButton, autoScalesButton, rotateLeftButton, rotateRightButton, rotateLeftRightButton, cropButton, fullScreenButton, presentationButton, leftPaneButton, rightPaneButton, splitPDFButton, toolModeButton, textNoteButton, circleNoteButton, markupNoteButton, lineNoteButton, singleTwoUpButton, continuousButton, displayModeButton, displayDirectionButton, displaysRTLButton, bookModeButton, pageBreaksButton, displayBoxButton, infoButton, colorsButton, fontsButton, linesButton, printButton, customizeButton, scaleField, noteButton, colorSwatch, pacerButton, pacerSpeedField, pacerSpeedStepper, shareButton; +@synthesize mainController, backForwardButton, pageNumberField, previousNextPageButton, previousPageButton, nextPageButton, previousNextFirstLastPageButton, zoomInOutButton, zoomInActualOutButton, zoomActualButton, zoomFitButton, zoomSelectionButton, autoScalesButton, rotateLeftButton, rotateRightButton, rotateLeftRightButton, cropButton, fullScreenButton, presentationButton, leftPaneButton, rightPaneButton, splitPDFButton, toolModeButton, textNoteButton, circleNoteButton, markupNoteButton, lineNoteButton, singleTwoUpButton, continuousButton, displayModeButton, displayDirectionButton, displaysRTLButton, bookModeButton, pageBreaksButton, displayBoxButton, infoButton, colorsButton, fontsButton, linesButton, printButton, customizeButton, scaleField, noteButton, notesButton, colorSwatch, pacerButton, pacerSpeedField, pacerSpeedStepper, shareButton; - (void)dealloc { @try { [[NSUserDefaults standardUserDefaults] removeObserver:self forKeyPath:SKSwatchColorsKey context:&SKDefaultsObservationContext]; } @@ -518,6 +520,18 @@ [item setView:noteButton]; [item setMenuFormRepresentation:menuItem]; + } else if ([identifier isEqualToString:SKDocumentToolbarNotesItemIdentifier]) { + + menuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Notes", @"Toolbar item label") action:@selector(toggleNoteToolbar:) target:self]; + + menu = [menuItem submenu]; + [item setLabels:NSLocalizedString(@"Notes", @"Toolbar item label")]; + [item setToolTip:NSLocalizedString(@"Show Note Toolbar", @"Tool tip message")]; + [item setView:notesButton]; + [item setMenuFormRepresentation:menuItem]; + + [self noteToolbarDidShowOrHide]; + } else if ([identifier isEqualToString:SKDocumentToolbarToolModeItemIdentifier]) { menu = [NSMenu menu]; @@ -930,6 +944,7 @@ SKDocumentToolbarNewCircleNoteItemIdentifier, SKDocumentToolbarNewMarkupItemIdentifier, SKDocumentToolbarNewLineItemIdentifier, + SKDocumentToolbarNotesItemIdentifier, SKDocumentToolbarToolModeItemIdentifier, SKDocumentToolbarColorSwatchItemIdentifier, SKDocumentToolbarShareItemIdentifier, @@ -1062,6 +1077,11 @@ [(NSNumberFormatter *)[scaleField formatter] setMaximum:[NSNumber numberWithDouble:[mainController.pdfView maxScaleFactor]]]; } +- (void)noteToolbarDidShowOrHide { + [notesButton setSelected:[mainController hasNoteToolbar] forSegment:0]; + [[toolbarItems objectForKey:SKDocumentToolbarNotesItemIdentifier] setToolTip:[mainController hasNoteToolbar] ? NSLocalizedString(@"Hide Note Toolbar", @"Tool tip message") : NSLocalizedString(@"Show Note Toolbar", @"Tool tip message")]; +} + - (IBAction)goToPreviousNextFirstLastPage:(id)sender { NSInteger tag = [sender selectedTag]; if (tag == -1) @@ -1231,6 +1251,10 @@ } else NSBeep(); } +- (void)toggleNoteToolbar:(id)sender { + [mainController toggleNoteToolbar:sender]; +} + - (IBAction)changeToolMode:(id)sender { NSInteger newToolMode = [sender selectedTag]; [mainController.pdfView setToolMode:newToolMode]; Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2025-03-17 16:37:25 UTC (rev 14979) +++ trunk/SKMainWindowController.h 2025-03-17 17:50:11 UTC (rev 14980) @@ -287,8 +287,10 @@ @property (nonatomic, nullable, readonly) NSMenu *notesMenu; -@property (nonatomic) BOOL hasOverview; +@property (nonatomic, readonly) BOOL hasNoteToolbar; +@property (nonatomic, readonly) BOOL hasOverview; + - (void)showOverviewAnimating:(BOOL)animate; - (void)hideOverviewAnimating:(BOOL)animate; - (void)hideOverviewAnimating:(BOOL)animate completionHandler:(nullable void (^)(void))handler; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-03-17 16:37:25 UTC (rev 14979) +++ trunk/SKMainWindowController.m 2025-03-17 17:50:11 UTC (rev 14980) @@ -218,7 +218,7 @@ @implementation SKMainWindowController @synthesize mainWindow, splitView, topConstraint, centerContentView, pdfSplitView, pdfContentView, findBarTopConstraint, statusBar, pdfView, secondaryPdfView, leftSideController, rightSideController, leftSideContentView, rightSideContentView, presentationNotesDocument, presentationNotesOffset, notes, thumbnails, snapshots, searchResults, groupedSearchResults, tags, rating, pageLabel, interactionMode, placeholderPdfDocument; -@dynamic pdfDocument, presentationUndoManager, selectedNotes, hasNotes, widgetProperties, currentPage, leftSidePaneState, rightSidePaneState, findPaneState, displaysFindPane, leftSidePaneIsOpen, rightSidePaneIsOpen, searchString, hasOverview, notesMenu; +@dynamic pdfDocument, presentationUndoManager, selectedNotes, hasNotes, widgetProperties, currentPage, leftSidePaneState, rightSidePaneState, findPaneState, displaysFindPane, leftSidePaneIsOpen, rightSidePaneIsOpen, searchString, hasNoteToolbar, hasOverview, notesMenu; + (BOOL)automaticallyNotifiesObserversOfPageLabel { return NO; } @@ -1511,6 +1511,10 @@ } } +- (BOOL)hasNoteToolbar { + return [noteToolbarController isVisible]; +} + #pragma mark Overview - (BOOL)hasOverview { Modified: trunk/SKMainWindowController_Actions.m =================================================================== --- trunk/SKMainWindowController_Actions.m 2025-03-17 16:37:25 UTC (rev 14979) +++ trunk/SKMainWindowController_Actions.m 2025-03-17 17:50:11 UTC (rev 14980) @@ -1153,6 +1153,7 @@ } [[self window] addTitlebarAccessoryViewController:noteToolbarController]; } + [toolbarController noteToolbarDidShowOrHide]; } - (IBAction)toggleFullscreen:(id)sender { Modified: trunk/de.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/en.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/en.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/es.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/fr.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/it.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/ja.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/nl.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/zh_CN.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/Localizable.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-17 16:37:37
|
Revision: 14979 http://sourceforge.net/p/skim-app/code/14979 Author: hofman Date: 2025-03-17 16:37:25 +0000 (Mon, 17 Mar 2025) Log Message: ----------- Add menu item to show/hide the note toolbar Modified Paths: -------------- trunk/Base.lproj/MainMenu.xib trunk/de.lproj/MainMenu.strings trunk/en.lproj/MainMenu.strings trunk/es.lproj/MainMenu.strings trunk/fr.lproj/MainMenu.strings trunk/it.lproj/MainMenu.strings trunk/ja.lproj/MainMenu.strings trunk/nl.lproj/MainMenu.strings trunk/pl.lproj/MainMenu.strings trunk/ru.lproj/MainMenu.strings trunk/zh_CN.lproj/MainMenu.strings trunk/zh_TW.lproj/MainMenu.strings Modified: trunk/Base.lproj/MainMenu.xib =================================================================== --- trunk/Base.lproj/MainMenu.xib 2025-03-17 16:21:28 UTC (rev 14978) +++ trunk/Base.lproj/MainMenu.xib 2025-03-17 16:37:25 UTC (rev 14979) @@ -729,6 +729,12 @@ <action selector="toggleStatusBar:" target="-1" id="869"/> </connections> </menuItem> + <menuItem title="Show Note Toolbar" id="7Qv-kA-iZg"> + <modifierMask key="keyEquivalentModifierMask"/> + <connections> + <action selector="toggleNoteToolbar:" target="-1" id="mBw-ag-ukh"/> + </connections> + </menuItem> <menuItem title="Show Toolbar" keyEquivalent="t" id="227"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> Modified: trunk/de.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/en.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/es.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/fr.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/it.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/ja.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/nl.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/zh_CN.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/MainMenu.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-17 16:21:43
|
Revision: 14978 http://sourceforge.net/p/skim-app/code/14978 Author: hofman Date: 2025-03-17 16:21:28 +0000 (Mon, 17 Mar 2025) Log Message: ----------- validate toggleNoteToolbar: and change title Modified Paths: -------------- trunk/SKMainWindowController_UI.m trunk/de.lproj/Localizable.strings trunk/en.lproj/Localizable.strings trunk/es.lproj/Localizable.strings trunk/fr.lproj/Localizable.strings trunk/it.lproj/Localizable.strings trunk/ja.lproj/Localizable.strings trunk/nl.lproj/Localizable.strings trunk/pl.lproj/Localizable.strings trunk/ru.lproj/Localizable.strings trunk/zh_CN.lproj/Localizable.strings trunk/zh_TW.lproj/Localizable.strings Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2025-03-17 15:10:33 UTC (rev 14977) +++ trunk/SKMainWindowController_UI.m 2025-03-17 16:21:28 UTC (rev 14978) @@ -91,6 +91,7 @@ #import "SKApplicationController.h" #import "SKPresentationView.h" #import "SKBookmarkController.h" +#import "SKNoteToolbarController.h" #define NOTES_KEY @"notes" #define SNAPSHOTS_KEY @"snapshots" @@ -1861,6 +1862,12 @@ [menuItem setState:(SKFindPaneState)mwcFlags.findPaneState != (SKFindPaneState)[menuItem tag] ? NSControlStateValueOff : [self displaysFindPane] ? NSControlStateValueOn : NSControlStateValueMixed]; [menuItem setHidden:[[self searchString] length] == 0]; return [[self searchString] length] > 0; + } else if (action == @selector(toggleNoteToolbar:)) { + if ([noteToolbarController isVisible]) + [menuItem setTitle:NSLocalizedString(@"Hide Note Toolbar", @"Menu item title")]; + else + [menuItem setTitle:NSLocalizedString(@"Show Note Toolbar", @"Menu item title")]; + return YES; } else if (action == @selector(toggleOverview:)) { if ([self hasOverview]) [menuItem setTitle:NSLocalizedString(@"Hide Overview", @"Menu item title")]; Modified: trunk/de.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/en.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/es.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/fr.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/it.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/ja.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/nl.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/zh_CN.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/Localizable.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-17 15:10:46
|
Revision: 14977 http://sourceforge.net/p/skim-app/code/14977 Author: hofman Date: 2025-03-17 15:10:33 +0000 (Mon, 17 Mar 2025) Log Message: ----------- Don't use Toggle in menu titles, default to Show Modified Paths: -------------- trunk/Base.lproj/MainMenu.xib trunk/de.lproj/MainMenu.strings trunk/en.lproj/MainMenu.strings trunk/es.lproj/MainMenu.strings trunk/fr.lproj/MainMenu.strings trunk/it.lproj/MainMenu.strings trunk/ja.lproj/MainMenu.strings trunk/nl.lproj/MainMenu.strings trunk/pl.lproj/MainMenu.strings trunk/ru.lproj/MainMenu.strings trunk/zh_CN.lproj/MainMenu.strings trunk/zh_TW.lproj/MainMenu.strings Modified: trunk/Base.lproj/MainMenu.xib =================================================================== --- trunk/Base.lproj/MainMenu.xib 2025-03-17 10:20:05 UTC (rev 14976) +++ trunk/Base.lproj/MainMenu.xib 2025-03-17 15:10:33 UTC (rev 14977) @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> <dependencies> + <deployment identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/> </dependencies> <objects> @@ -636,7 +637,7 @@ <menuItem title="View" id="219"> <menu key="submenu" title="View" id="220"> <items> - <menuItem title="Toggle Contents Pane" keyEquivalent="T" id="521"> + <menuItem title="Show Contents Pane" keyEquivalent="T" id="521"> <connections> <action selector="toggleLeftSidePane:" target="-1" id="523"/> </connections> @@ -664,7 +665,7 @@ <menuItem isSeparatorItem="YES" id="634"> <modifierMask key="keyEquivalentModifierMask" command="YES"/> </menuItem> - <menuItem title="Toggle Notes Pane" keyEquivalent="N" id="522"> + <menuItem title="Show Notes Pane" keyEquivalent="N" id="522"> <connections> <action selector="toggleRightSidePane:" target="-1" id="524"/> </connections> @@ -701,7 +702,7 @@ <menuItem isSeparatorItem="YES" id="Hov-Cu-rh7"> <modifierMask key="keyEquivalentModifierMask" command="YES"/> </menuItem> - <menuItem title="Toggle Reading Bar" keyEquivalent="B" id="716"> + <menuItem title="Show Reading Bar" keyEquivalent="B" id="716"> <connections> <action selector="toggleReadingBar:" target="-1" id="718"/> </connections> @@ -709,12 +710,12 @@ <menuItem isSeparatorItem="YES" id="796"> <modifierMask key="keyEquivalentModifierMask" command="YES"/> </menuItem> - <menuItem title="Toggle Overview" keyEquivalent="O" id="XiM-be-8EU"> + <menuItem title="Show Overview" keyEquivalent="O" id="XiM-be-8EU"> <connections> <action selector="toggleOverview:" target="-1" id="jMu-az-GyH"/> </connections> </menuItem> - <menuItem title="Toggle Split PDF" keyEquivalent="p" id="794"> + <menuItem title="Show Split PDF" keyEquivalent="p" id="794"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="toggleSplitPDF:" target="-1" id="871"/> @@ -723,7 +724,7 @@ <menuItem isSeparatorItem="YES" id="870"> <modifierMask key="keyEquivalentModifierMask" command="YES"/> </menuItem> - <menuItem title="Toggle Status Bar" keyEquivalent="I" id="868"> + <menuItem title="Show Status Bar" keyEquivalent="I" id="868"> <connections> <action selector="toggleStatusBar:" target="-1" id="869"/> </connections> Modified: trunk/de.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/en.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/es.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/fr.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/it.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/ja.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/nl.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/zh_CN.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/MainMenu.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-17 10:20:08
|
Revision: 14976 http://sourceforge.net/p/skim-app/code/14976 Author: hofman Date: 2025-03-17 10:20:05 +0000 (Mon, 17 Mar 2025) Log Message: ----------- Fix show/hide toolbar menu item title, don't use toggle, or the system will not update the title Modified Paths: -------------- trunk/Base.lproj/MainMenu.xib trunk/de.lproj/MainMenu.strings trunk/en.lproj/MainMenu.strings trunk/es.lproj/MainMenu.strings trunk/fr.lproj/MainMenu.strings trunk/it.lproj/MainMenu.strings trunk/ja.lproj/MainMenu.strings trunk/nl.lproj/MainMenu.strings trunk/pl.lproj/MainMenu.strings trunk/ru.lproj/MainMenu.strings trunk/zh_CN.lproj/MainMenu.strings trunk/zh_TW.lproj/MainMenu.strings Modified: trunk/Base.lproj/MainMenu.xib =================================================================== --- trunk/Base.lproj/MainMenu.xib 2025-03-16 17:43:38 UTC (rev 14975) +++ trunk/Base.lproj/MainMenu.xib 2025-03-17 10:20:05 UTC (rev 14976) @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> <dependencies> - <deployment identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/> </dependencies> <objects> @@ -729,7 +728,7 @@ <action selector="toggleStatusBar:" target="-1" id="869"/> </connections> </menuItem> - <menuItem title="Toggle Toolbar" keyEquivalent="t" id="227"> + <menuItem title="Show Toolbar" keyEquivalent="t" id="227"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="toggleToolbarShown:" target="-1" id="238"/> Modified: trunk/de.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/en.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/es.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/fr.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/it.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/ja.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/nl.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/pl.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/ru.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/zh_CN.lproj/MainMenu.strings =================================================================== (Binary files differ) Modified: trunk/zh_TW.lproj/MainMenu.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-16 17:43:40
|
Revision: 14975 http://sourceforge.net/p/skim-app/code/14975 Author: hofman Date: 2025-03-16 17:43:38 +0000 (Sun, 16 Mar 2025) Log Message: ----------- Add a class for a note toolbar below the main toolbar. For now unused. Modified Paths: -------------- trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKMainWindowController_Actions.h trunk/SKMainWindowController_Actions.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/SKNoteToolbarController.h trunk/SKNoteToolbarController.m Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2025-03-15 17:04:23 UTC (rev 14974) +++ trunk/SKMainWindowController.h 2025-03-16 17:43:38 UTC (rev 14975) @@ -70,7 +70,7 @@ @class PDFAnnotation, PDFSelection, SKGroupedSearchResult; @class SKPDFView, SKSecondaryPDFView, SKPresentationView, SKStatusBar, SKFindController, SKSplitView, SKFieldEditor, SKOverviewView, SKSideWindow; -@class SKLeftSideViewController, SKRightSideViewController, SKMainToolbarController, SKMainTouchBarController, SKProgressController, SKNoteTypeSheetController, SKSnapshotWindowController, SKTransitionController; +@class SKLeftSideViewController, SKRightSideViewController, SKMainToolbarController, SKMainTouchBarController, SKNoteToolbarController, SKProgressController, SKNoteTypeSheetController, SKSnapshotWindowController, SKTransitionController; @interface SKMainWindowController : NSWindowController <SKSnapshotWindowControllerDelegate, SKThumbnailDelegate, SKFindControllerDelegate, SKPDFViewDelegate, SKPDFDocumentDelegate, NSTouchBarDelegate> { SKSplitView *splitView; @@ -92,6 +92,8 @@ SKMainTouchBarController *touchBarController; + SKNoteToolbarController *noteToolbarController; + SKOverviewView *overviewView; NSView *overviewContentView; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-03-15 17:04:23 UTC (rev 14974) +++ trunk/SKMainWindowController.m 2025-03-16 17:43:38 UTC (rev 14975) @@ -106,6 +106,7 @@ #import "SKChainedUndoManager.h" #import "SKThumbnailStamp.h" #import "SKPresentationView.h" +#import "SKNoteToolbarController.h" #define MULTIPLICATION_SIGN_CHARACTER (unichar)0x00d7 @@ -1636,6 +1637,7 @@ if (isPresentation) [NSCursor setHiddenUntilMouseMoves:NO]; [touchBarController overviewChanged]; + [noteToolbarController validateButtons]; } - (void)hideOverviewAnimating:(BOOL)animate completionHandler:(void (^)(void))handler { @@ -1666,6 +1668,7 @@ } completionHandler:^{ [touchBarController overviewChanged]; + [noteToolbarController validateButtons]; [[newKeyView window] makeFirstResponder:newKeyView]; if (handler) handler(); @@ -1674,6 +1677,7 @@ [contentView replaceSubview:overviewContentView with:newView]; [NSLayoutConstraint activateConstraints:constraints]; [touchBarController overviewChanged]; + [noteToolbarController validateButtons]; [[newKeyView window] makeFirstResponder:newKeyView]; if (handler) handler(); Modified: trunk/SKMainWindowController_Actions.h =================================================================== --- trunk/SKMainWindowController_Actions.h 2025-03-15 17:04:23 UTC (rev 14974) +++ trunk/SKMainWindowController_Actions.h 2025-03-16 17:43:38 UTC (rev 14975) @@ -107,6 +107,7 @@ - (IBAction)toggleStatusBar:(nullable id)sender; - (IBAction)toggleSplitPDF:(nullable id)sender; - (IBAction)toggleOverview:(nullable id)sender; +- (IBAction)toggleNoteToolbar:(nullable id)sender ; - (IBAction)toggleReadingBar:(nullable id)sender; - (IBAction)togglePacer:(nullable id)sender; - (IBAction)changePacerSpeed:(nullable id)sender; Modified: trunk/SKMainWindowController_Actions.m =================================================================== --- trunk/SKMainWindowController_Actions.m 2025-03-15 17:04:23 UTC (rev 14974) +++ trunk/SKMainWindowController_Actions.m 2025-03-16 17:43:38 UTC (rev 14975) @@ -82,6 +82,7 @@ #import "SKOverviewView.h" #import "SKPresentationView.h" #import "NSUserDefaults_SKExtensions.h" +#import "SKNoteToolbarController.h" #define STATUSBAR_HEIGHT 22.0 @@ -283,6 +284,7 @@ [notes setValue:wasHidden forKey:@"shouldPrint"]; [pdfView setHideNotes:[pdfView hideNotes] == NO]; [touchBarController handleToolModeChangedNotification:nil]; + [noteToolbarController validateButtons]; } - (IBAction)takeSnapshot:(id)sender{ @@ -1137,6 +1139,22 @@ [[self window] recalculateKeyViewLoop]; } +- (IBAction)toggleNoteToolbar:(id)sender { + if ([self interactionMode] == SKPresentationMode) + return; + if ([noteToolbarController isVisible]) { + NSUInteger i = [[[self window] titlebarAccessoryViewControllers] indexOfObject:noteToolbarController]; + if (i != NSNotFound) + [[self window] removeTitlebarAccessoryViewControllerAtIndex:i]; + } else { + if (noteToolbarController == nil) { + noteToolbarController = [[SKNoteToolbarController alloc] init]; + [noteToolbarController setMainController:self]; + } + [[self window] addTitlebarAccessoryViewController:noteToolbarController]; + } +} + - (IBAction)toggleFullscreen:(id)sender { if ([self canExitFullscreen]) [self exitFullscreen]; Added: trunk/SKNoteToolbarController.h =================================================================== --- trunk/SKNoteToolbarController.h (rev 0) +++ trunk/SKNoteToolbarController.h 2025-03-16 17:43:38 UTC (rev 14975) @@ -0,0 +1,65 @@ +// +// SKNoteToolbarController.h +// Skim +// +// Created by Christiaan Hofman on 16/03/2025. +/* + This software is Copyright (c) 2025 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <Cocoa/Cocoa.h> + +NS_ASSUME_NONNULL_BEGIN + +@class SKMainWindowController; + +@interface SKNoteToolbarController : NSTitlebarAccessoryViewController { + __weak SKMainWindowController *mainController; + NSSegmentedControl *noteButton; + NSSegmentedControl *colorsButton; + NSSegmentedControl *fontsButton; + NSSegmentedControl *linesButton; +} + +@property (nonatomic, nullable, weak) SKMainWindowController *mainController; +@property (nonatomic, readonly, getter=isVisible) BOOL visible; + +- (void)createNewNote:(nullable id)sender; +- (void)selectColor:(nullable id)sender; +- (void)selectFontSize:(nullable id)sender; +- (void)selectLineWidth:(nullable id)sender; + +- (void)validateButtons; + +@end + +NS_ASSUME_NONNULL_END Added: trunk/SKNoteToolbarController.m =================================================================== --- trunk/SKNoteToolbarController.m (rev 0) +++ trunk/SKNoteToolbarController.m 2025-03-16 17:43:38 UTC (rev 14975) @@ -0,0 +1,225 @@ +// +// SKNoteToolbarController.m +// Skim +// +// Created by Christiaan Hofman on 16/03/2025. +/* + This software is Copyright (c) 2025 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "SKNoteToolbarController.h" +#import "SKMainWindowController.h" +#import "SKPDFView.h" +#import <SkimNotes/SkimNotes.h> +#import "PDFAnnotation_SKExtensions.h" +#import "SKApplicationController.h" +#import "NSImage_SKExtensions.h" +#import "NSMenu_SKExtensions.h" +#import "NSUserDefaults_SKExtensions.h" +#import "NSColor_SKExtensions.h" +#import "NSSegmentedControl_SKExtensions.h" +#import "SKStringConstants.h" + +static char SKDefaultsObservationContext; + +@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; +} + +- (void)loadView { + NSArray *images = @[[NSImage imageNamed:SKImageNameToolbarAddTextNote], + [NSImage imageNamed:SKImageNameToolbarAddAnchoredNote], + [NSImage imageNamed:SKImageNameToolbarAddCircleNote], + [NSImage imageNamed:SKImageNameToolbarAddSquareNote], + [NSImage imageNamed:SKImageNameToolbarAddHighlightNote], + [NSImage imageNamed:SKImageNameToolbarAddUnderlineNote], + [NSImage imageNamed:SKImageNameToolbarAddStrikeOutNote], + [NSImage imageNamed:SKImageNameToolbarAddLineNote], + [NSImage imageNamed:SKImageNameToolbarAddInkNote]]; + noteButton = [NSSegmentedControl segmentedControlWithImages:images trackingMode:NSSegmentSwitchTrackingMomentary target:self action:@selector(createNewNote:)]; + [noteButton setSegmentStyle:NSSegmentStyleSeparated]; + [noteButton setHelp:NSLocalizedString(@"Add New Text Note", @"Tool tip message") forSegment:SKNoteTypeFreeText]; + [noteButton setHelp:NSLocalizedString(@"Add New Anchored Note", @"Tool tip message") forSegment:SKNoteTypeAnchored]; + [noteButton setHelp:NSLocalizedString(@"Add New Circle", @"Tool tip message") forSegment:SKNoteTypeCircle]; + [noteButton setHelp:NSLocalizedString(@"Add New Box", @"Tool tip message") forSegment:SKNoteTypeSquare]; + [noteButton setHelp:NSLocalizedString(@"Add New Highlight", @"Tool tip message") forSegment:SKNoteTypeHighlight]; + [noteButton setHelp:NSLocalizedString(@"Add New Underline", @"Tool tip message") forSegment:SKNoteTypeUnderline]; + [noteButton setHelp:NSLocalizedString(@"Add New Strike Out", @"Tool tip message") forSegment:SKNoteTypeStrikeOut]; + [noteButton setHelp:NSLocalizedString(@"Add New Line", @"Tool tip message") forSegment:SKNoteTypeLine]; + [noteButton setHelp:NSLocalizedString(@"Add New Freehand", @"Tool tip message") forSegment:SKNoteTypeInk]; + [noteButton setTranslatesAutoresizingMaskIntoConstraints:NO]; + + colorsButton = [NSSegmentedControl segmentedControlWithImages:@[[NSImage imageNamed:SKImageNameToolbarColors]] trackingMode:NSSegmentSwitchTrackingMomentary target:nil action:@selector(orderFrontColorPanel:)]; + [colorsButton setTranslatesAutoresizingMaskIntoConstraints:NO]; + NSMenu *menu = [NSMenu menu]; + [colorsButton setMenu:menu forSegment:0]; + [self updateColorsMenu]; + [[NSUserDefaults standardUserDefaults] addObserver:self forKeyPath:SKSwatchColorsKey options:0 context:&SKDefaultsObservationContext]; + + fontsButton = [NSSegmentedControl segmentedControlWithImages:@[[NSImage imageNamed:SKImageNameToolbarFonts]] trackingMode:NSSegmentSwitchTrackingMomentary target:nil action:@selector(orderFrontFontPanel:)]; + [fontsButton setTranslatesAutoresizingMaskIntoConstraints:NO]; + menu = [NSMenu menu]; + for (NSInteger i = 9; i < 19; i++) { + [menu addItemWithTitle:[NSString stringWithFormat:@"%ld", (long)i] action:@selector(selectFontSize:) target:self tag:i]; + } + [fontsButton setMenu:menu forSegment:0]; + + linesButton = [NSSegmentedControl segmentedControlWithImages:@[[NSImage imageNamed:SKImageNameToolbarLines]] trackingMode:NSSegmentSwitchTrackingMomentary target:nil action:@selector(orderFrontLineInspector:)]; + [linesButton setTranslatesAutoresizingMaskIntoConstraints:NO]; + menu = [NSMenu menu]; + NSSize size = NSMakeSize(32.0, 16.0); + for (NSInteger i = 1; i < 11; i++) { + NSMenuItem *menuItem = [menu addItemWithTitle:@"" action:@selector(selectLineWidth:) target:self tag:i]; + NSImage *image = [NSImage imageWithSize:size drawingHandler:^(NSRect r){ + [[NSColor blackColor] setStroke]; + NSBezierPath *path = [NSBezierPath bezierPath]; + [path setLineWidth:i]; + [path moveToPoint:NSMakePoint(0.0, 8.0 + 0.5 * (i % 2))]; + [path relativeLineToPoint:NSMakePoint(32.0, 0.0)]; + [path stroke]; + return YES; + }]; + [image setAccessibilityDescription:[NSString stringWithFormat:@"%ld", (long)i]]; + [image setTemplate:YES]; + [menuItem setImage:image]; + } + [linesButton setMenu:menu forSegment:0]; + + [self validateButtons]; + + NSView *view = [[NSView alloc] init]; + [view addSubview:noteButton]; + [view addSubview:colorsButton]; + [view addSubview:fontsButton]; + [view addSubview:linesButton]; + + NSArray *constraints = @[ + [[noteButton leadingAnchor] constraintEqualToAnchor:[view leadingAnchor] constant:10.0], + [[noteButton centerYAnchor] constraintEqualToAnchor:[view centerYAnchor]], + [[colorsButton leadingAnchor] constraintEqualToAnchor:[noteButton trailingAnchor] constant:20.0], + [[colorsButton centerYAnchor] constraintEqualToAnchor:[noteButton centerYAnchor]], + [[fontsButton leadingAnchor] constraintEqualToAnchor:[colorsButton trailingAnchor] constant:8.0], + [[fontsButton centerYAnchor] constraintEqualToAnchor:[noteButton centerYAnchor]], + [[linesButton leadingAnchor] constraintEqualToAnchor:[fontsButton trailingAnchor] constant:8.0], + [[linesButton centerYAnchor] constraintEqualToAnchor:[noteButton centerYAnchor]] + ]; + [NSLayoutConstraint activateConstraints:constraints]; + + [self setView:view]; +} + +- (void)createNewNote:(id)sender { + if ([mainController.pdfView canSelectNote]) { + NSInteger type = [sender selectedSegment]; + [mainController.pdfView addAnnotationWithType:type]; + } else NSBeep(); +} + +- (void)selectColor:(id)sender { + PDFAnnotation *annotation = [mainController.pdfView currentAnnotation]; + NSColor *newColor = [sender respondsToSelector:@selector(color)] ? [sender color] : [sender respondsToSelector:@selector(representedObject)] ? [sender representedObject] : nil; + BOOL isShift = ([NSEvent modifierFlags] & NSEventModifierFlagShift) != 0; + BOOL isAlt = ([NSEvent modifierFlags] & NSEventModifierFlagOption) != 0; + if (isAlt == NO && [sender respondsToSelector:@selector(isAlternate)]) + isAlt = [sender isAlternate]; + if ([annotation isSkimNote]) { + [annotation setColor:newColor alternate:isAlt updateDefaults:isShift]; + } else { + NSString *defaultKey = [mainController.pdfView currentColorDefaultKeyForAlternate:isAlt]; + if (defaultKey) + [[NSUserDefaults standardUserDefaults] setColor:newColor forKey:defaultKey]; + } +} + +- (void)selectFontSize:(id)sender { + PDFAnnotation *annotation = [mainController.pdfView currentAnnotation]; + if ([mainController hasOverview] == NO && [annotation isSkimNote] && [annotation isText]) { + NSFont *font = [[NSFontManager sharedFontManager] convertFont:[annotation font] toSize:[sender tag]]; + [annotation setFont:font]; + if (([NSEvent modifierFlags] & NSEventModifierFlagShift)) { + [[NSUserDefaults standardUserDefaults] setDouble:[font pointSize] forKey:SKFreeTextNoteFontSizeKey]; + } + } +} + +- (void)selectLineWidth:(id)sender { + PDFAnnotation *annotation = [mainController.pdfView currentAnnotation]; + if ([mainController hasOverview] == NO && [annotation hasBorder]) { + BOOL isShift = ([NSEvent modifierFlags] & NSEventModifierFlagShift) != 0; + [annotation setLineWidth:[sender tag] updateDefaults:isShift]; + } +} + +- (void)updateColorsMenu { + NSMenu *menu = [colorsButton menuForSegment:0]; + + [menu removeAllItems]; + + NSSize size = NSMakeSize(16.0, 16.0); + for (NSColor *color in [NSColor favoriteColors]) { + NSMenuItem *item; + NSImage *image = [NSImage imageWithSize:size drawingHandler:^(NSRect dstRect){ + [color drawSwatchInRoundedRect:dstRect]; + return YES; + }]; + [image setAccessibilityDescription:[color accessibilityValue]]; + item = [menu addItemWithTitle:@"" action:@selector(selectColor:) target:self]; + [item setRepresentedObject:color]; + [item setImage:image]; + } +} + +- (void)validateButtons { + [noteButton setEnabled:[mainController hasOverview] == NO && [mainController.pdfView canSelectNote]]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context { + if (context == &SKDefaultsObservationContext) { + [self updateColorsMenu]; + } else { + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + } +} + +@end Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2025-03-15 17:04:23 UTC (rev 14974) +++ trunk/Skim.xcodeproj/project.pbxproj 2025-03-16 17:43:38 UTC (rev 14975) @@ -232,6 +232,7 @@ CEAE1CA0287C7C39003A77DB /* SKGroupView.m in Sources */ = {isa = PBXBuildFile; fileRef = CEAE1C9F287C7C39003A77DB /* SKGroupView.m */; }; CEAF079D0C4139EB00C3ECBB /* SKStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CEAF079B0C4139EB00C3ECBB /* SKStatusBar.m */; }; CEB402C313EDAD6100851D1B /* SKTemporaryData.m in Sources */ = {isa = PBXBuildFile; fileRef = CEB402C213EDAD6100851D1B /* SKTemporaryData.m */; }; + CEB4EC502D87409100CA01A1 /* SKNoteToolbarController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEB4EC4F2D87409100CA01A1 /* SKNoteToolbarController.m */; }; CEB735A20C4A8CD6000350F9 /* TransitionShading.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEB735A10C4A8CD6000350F9 /* TransitionShading.tiff */; }; CEBC0DDD2791C607008686E8 /* NSObject_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBC0DDC2791C607008686E8 /* NSObject_SKExtensions.m */; }; CEBCA4C02868A93A00E6376E /* SKLine.m in Sources */ = {isa = PBXBuildFile; fileRef = CEBCA4BF2868A93A00E6376E /* SKLine.m */; }; @@ -1140,6 +1141,8 @@ CEAF079B0C4139EB00C3ECBB /* SKStatusBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKStatusBar.m; sourceTree = "<group>"; }; CEB402C113EDAD6100851D1B /* SKTemporaryData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKTemporaryData.h; sourceTree = "<group>"; }; CEB402C213EDAD6100851D1B /* SKTemporaryData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKTemporaryData.m; sourceTree = "<group>"; }; + CEB4EC4E2D87409100CA01A1 /* SKNoteToolbarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKNoteToolbarController.h; sourceTree = "<group>"; }; + CEB4EC4F2D87409100CA01A1 /* SKNoteToolbarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SKNoteToolbarController.m; sourceTree = "<group>"; }; CEB53FF20F261D1400723C1F /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = zh_TW; path = zh_TW.lproj/Credits.rtf; sourceTree = "<group>"; }; CEB53FF50F261D1400723C1F /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/InfoPlist.strings; sourceTree = "<group>"; }; CEB53FF80F261D1500723C1F /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Localizable.strings; sourceTree = "<group>"; }; @@ -2265,6 +2268,8 @@ CEE54F6B0DA3FB060037169F /* SKMainToolbarController.m */, CE85D73D2280814B0022C560 /* SKMainTouchBarController.h */, CE85D73E2280814B0022C560 /* SKMainTouchBarController.m */, + CEB4EC4E2D87409100CA01A1 /* SKNoteToolbarController.h */, + CEB4EC4F2D87409100CA01A1 /* SKNoteToolbarController.m */, CE8BEFE1115F75590029020F /* SKSideViewController.h */, CE8BEFE2115F75590029020F /* SKSideViewController.m */, CE8BF025115F7C390029020F /* SKLeftSideViewController.h */, @@ -2899,6 +2904,7 @@ CE6DC7BB0D689138003A072F /* PDFDocument_SKExtensions.m in Sources */, CE2E9A592C14D2F300044B01 /* SKSnapshotConfiguration.m in Sources */, CEA8FCD60D89C34A00E8A6F4 /* SKAnimatedBorderlessWindow.m in Sources */, + CEB4EC502D87409100CA01A1 /* SKNoteToolbarController.m in Sources */, CE199DFD0D957A16009B2055 /* SKAnnotationTypeImageCell.m in Sources */, CEE54D880DA2E37B0037169F /* PDFAnnotation_SKExtensions.m in Sources */, CEE54D930DA2E5E10037169F /* PDFAnnotationCircle_SKExtensions.m in Sources */, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-15 17:04:29
|
Revision: 14974 http://sourceforge.net/p/skim-app/code/14974 Author: hofman Date: 2025-03-15 17:04:23 +0000 (Sat, 15 Mar 2025) Log Message: ----------- hidden preference to disable changing the zoom from goToDestination Modified Paths: -------------- trunk/SKBasePDFView.m Modified: trunk/SKBasePDFView.m =================================================================== --- trunk/SKBasePDFView.m 2025-03-14 15:48:23 UTC (rev 14973) +++ trunk/SKBasePDFView.m 2025-03-15 17:04:23 UTC (rev 14974) @@ -46,6 +46,8 @@ #import "PDFPage_SKExtensions.h" #import "PDFDestination_SKExtensions.h" +#define SKNeverChangeZoomFromLinksKey @"SKNeverChangeZoomFromLinks" + static char SKBasePDFViewDefaultsObservationContext; #if SDK_BEFORE_10_14 @@ -351,7 +353,7 @@ - (void)goToDestination:(PDFDestination *)destination { destination = [destination effectiveDestinationForView:self]; - if ([destination zoom] < kPDFDestinationUnspecifiedValue && [destination zoom] > 0.0) + if ([destination zoom] < kPDFDestinationUnspecifiedValue && [destination zoom] > 0.0 && [[NSUserDefaults standardUserDefaults] boolForKey:SKNeverChangeZoomFromLinksKey] == NO) [self setScaleFactor:[destination zoom]]; [super goToDestination:destination]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-03-14 15:48:34
|
Revision: 14973 http://sourceforge.net/p/skim-app/code/14973 Author: hofman Date: 2025-03-14 15:48:23 +0000 (Fri, 14 Mar 2025) Log Message: ----------- Remove back/forward button from default toolbar items Modified Paths: -------------- trunk/SKMainToolbarController.m Modified: trunk/SKMainToolbarController.m =================================================================== --- trunk/SKMainToolbarController.m 2025-03-14 15:18:34 UTC (rev 14972) +++ trunk/SKMainToolbarController.m 2025-03-14 15:48:23 UTC (rev 14973) @@ -889,7 +889,6 @@ - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { return @[SKDocumentToolbarPreviousNextItemIdentifier, SKDocumentToolbarPageNumberItemIdentifier, - SKDocumentToolbarBackForwardItemIdentifier, SKDocumentToolbarZoomInActualOutItemIdentifier, SKDocumentToolbarToolModeItemIdentifier, SKDocumentToolbarNewNoteItemIdentifier]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |