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
(63) |
Nov
(48) |
Dec
|
|
From: <ho...@us...> - 2025-07-15 14:40:24
|
Revision: 15661
http://sourceforge.net/p/skim-app/code/15661
Author: hofman
Date: 2025-07-15 14:40:21 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
discard editing when reverting
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-15 14:21:49 UTC (rev 15660)
+++ trunk/SKMainWindowController.m 2025-07-15 14:40:21 UTC (rev 15661)
@@ -1133,6 +1133,8 @@
[oldPdfDoc cancelFindString];
+ [self discardEditing];
+
// make sure these will not be activated, or they can lead to a crash
[pdfView removePDFToolTipRects];
[pdfView setCurrentAnnotation:nil];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:21:51
|
Revision: 15660
http://sourceforge.net/p/skim-app/code/15660
Author: hofman
Date: 2025-07-15 14:21:49 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
enumerate copy of array
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-15 14:18:49 UTC (rev 15659)
+++ trunk/SKMainWindowController.m 2025-07-15 14:21:49 UTC (rev 15660)
@@ -1078,7 +1078,7 @@
// remove the current annotations
[pdfView setCurrentAnnotation:nil];
[self commitEditing];
- for (NSWindowController *wc in [[self document] windowControllers]) {
+ for (NSWindowController *wc in [[[self document] windowControllers] copy]) {
if ([wc isNoteWindowController])
[wc close];
}
@@ -1436,8 +1436,7 @@
- (void)removeAllObjectsFromNotes {
if ([notes count]) {
- NSArray *wcs = [[[self document] windowControllers] copy];
- for (NSWindowController *wc in wcs) {
+ for (NSWindowController *wc in [[[self document] windowControllers] copy]) {
if ([wc isNoteWindowController]) {
[wc discardEditing];
[wc close];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:19:00
|
Revision: 15659
http://sourceforge.net/p/skim-app/code/15659
Author: hofman
Date: 2025-07-15 14:18:49 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
close all window controllers with commit gefore replacing all notes from file
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-15 14:15:05 UTC (rev 15658)
+++ trunk/SKMainWindowController.m 2025-07-15 14:18:49 UTC (rev 15659)
@@ -1078,6 +1078,10 @@
// remove the current annotations
[pdfView setCurrentAnnotation:nil];
[self commitEditing];
+ for (NSWindowController *wc in [[self document] windowControllers]) {
+ if ([wc isNoteWindowController])
+ [wc close];
+ }
if ([undoManager groupingLevel] > level) {
[undoManager endUndoGrouping];
[undoManager beginUndoGrouping];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:15:08
|
Revision: 15658
http://sourceforge.net/p/skim-app/code/15658
Author: hofman
Date: 2025-07-15 14:15:05 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
discard editing in note windows when closing for revert
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-15 14:03:38 UTC (rev 15657)
+++ trunk/SKMainWindowController.m 2025-07-15 14:15:05 UTC (rev 15658)
@@ -1434,8 +1434,10 @@
if ([notes count]) {
NSArray *wcs = [[[self document] windowControllers] copy];
for (NSWindowController *wc in wcs) {
- if ([wc isNoteWindowController])
+ if ([wc isNoteWindowController]) {
+ [wc discardEditing];
[wc close];
+ }
}
[rightSideController.noteOutlineView resetRowHeights];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:03:40
|
Revision: 15657
http://sourceforge.net/p/skim-app/code/15657
Author: hofman
Date: 2025-07-15 14:03:38 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
begin new undo group when comitting edit in progress before replacing notes from file
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-14 22:41:26 UTC (rev 15656)
+++ trunk/SKMainWindowController.m 2025-07-15 14:03:38 UTC (rev 15657)
@@ -1072,9 +1072,16 @@
NSArray *notesAndPagesToAdd = [self annotationsAndPagesWithProperties:noteDicts forDocument:[pdfView document] autoUpdate:NO widgetProperties:widgetDicts];
if (replacing && [notes count]) {
+ NSUndoManager *undoManager = [[self document] undoManager];
+ NSInteger level = [undoManager groupingLevel];
[pdfView removePDFToolTipRects];
// remove the current annotations
[pdfView setCurrentAnnotation:nil];
+ [self commitEditing];
+ if ([undoManager groupingLevel] > level) {
+ [undoManager endUndoGrouping];
+ [undoManager beginUndoGrouping];
+ }
}
[self updateWidgetsWithProperties:widgetDicts reset:replacing];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-14 22:41:28
|
Revision: 15656
http://sourceforge.net/p/skim-app/code/15656
Author: hofman
Date: 2025-07-14 22:41:26 +0000 (Mon, 14 Jul 2025)
Log Message:
-----------
stopping UI only relevant when removing from a window
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-14 21:36:16 UTC (rev 15655)
+++ trunk/SKPDFView.m 2025-07-14 22:41:26 UTC (rev 15656)
@@ -3236,17 +3236,17 @@
#pragma mark Key and window changes
- (void)viewWillMoveToWindow:(NSWindow *)newWindow {
- [self commitEditing];
-
- [self removeLoupeWindow];
-
- [self stopPacer];
-
- [self setTemporaryToolMode:SKToolModeNone];
-
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSWindow *oldWindow = [self window];
if (oldWindow) {
+ [self commitEditing];
+
+ [self removeLoupeWindow];
+
+ [self stopPacer];
+
+ [self setTemporaryToolMode:SKToolModeNone];
+
[nc removeObserver:self name:NSWindowDidBecomeKeyNotification object:oldWindow];
[nc removeObserver:self name:NSWindowDidResignKeyNotification object:oldWindow];
[nc removeObserver:self name:NSWindowDidResignMainNotification object:oldWindow];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-14 21:36:18
|
Revision: 15655
http://sourceforge.net/p/skim-app/code/15655
Author: hofman
Date: 2025-07-14 21:36:16 +0000 (Mon, 14 Jul 2025)
Log Message:
-----------
make sure textview undo manager is cleared after discarding the edits
Modified Paths:
--------------
trunk/SKNoteWindowController.m
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2025-07-13 08:48:38 UTC (rev 15654)
+++ trunk/SKNoteWindowController.m 2025-07-14 21:36:16 UTC (rev 15655)
@@ -381,6 +381,7 @@
- (void)discardEditing {
[noteController discardEditing];
+ [textViewUndoManager removeAllActions];
}
- (BOOL)commitEditing {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-13 08:48:40
|
Revision: 15654
http://sourceforge.net/p/skim-app/code/15654
Author: hofman
Date: 2025-07-13 08:48:38 +0000 (Sun, 13 Jul 2025)
Log Message:
-----------
commitEditing never returns NO
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-13 08:22:32 UTC (rev 15653)
+++ trunk/SKPDFView.m 2025-07-13 08:48:38 UTC (rev 15654)
@@ -683,8 +683,7 @@
// Will need to redraw old active anotation.
if (currentAnnotation != nil) {
[self updatedAnnotation:currentAnnotation];
- if (editor && [self commitEditing] == NO)
- [self discardEditing];
+ [self commitEditing];
}
// Assign.
@@ -3237,8 +3236,7 @@
#pragma mark Key and window changes
- (void)viewWillMoveToWindow:(NSWindow *)newWindow {
- if (editor && [self commitEditing] == NO)
- [self discardEditing];
+ [self commitEditing];
[self removeLoupeWindow];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-13 08:22:34
|
Revision: 15653
http://sourceforge.net/p/skim-app/code/15653
Author: hofman
Date: 2025-07-13 08:22:32 +0000 (Sun, 13 Jul 2025)
Log Message:
-----------
only update editor frame when there is an editor
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-13 08:18:23 UTC (rev 15652)
+++ trunk/SKPDFView.m 2025-07-13 08:22:32 UTC (rev 15653)
@@ -3200,7 +3200,8 @@
- (void)handleScaleChangedNotification:(NSNotification *)notification {
[self resetPDFToolTipRects];
[self updatePacer];
- [self textNoteEditorSetFrame:editor];
+ if (editor)
+ [self textNoteEditorSetFrame:editor];
}
- (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-13 08:18:24
|
Revision: 15652
http://sourceforge.net/p/skim-app/code/15652
Author: hofman
Date: 2025-07-13 08:18:23 +0000 (Sun, 13 Jul 2025)
Log Message:
-----------
textView and its string are never nil
Modified Paths:
--------------
trunk/SKTextNoteEditor.m
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-13 08:06:11 UTC (rev 15651)
+++ trunk/SKTextNoteEditor.m 2025-07-13 08:18:23 UTC (rev 15652)
@@ -90,7 +90,7 @@
}
- (NSString *)currentString {
- return [textView string] ?: [annotation string] ?: @"";
+ return [textView string];
}
- (void)updateParagraphStyle {
@@ -147,8 +147,8 @@
[annotation removeObserver:self forKeyPath:key context:&SKPDFAnnotationPropertiesObservationContext];
if (commit) {
- NSString *newValue = [textView string] ?: @"";
- if (textView && [newValue isEqualToString:[annotation string] ?: @""] == NO)
+ NSString *newValue = [textView string];
+ if ([newValue isEqualToString:[annotation string] ?: @""] == NO)
[annotation setString:newValue];
}
@@ -233,7 +233,7 @@
[self updateParagraphStyle];
} else if ([keyPath isEqualToString:SKNPDFAnnotationStringKey]) {
NSString *string = [annotation string] ?: @"";
- if ([string isEqualToString:[textView string] ?: @""] == NO) {
+ if ([string isEqualToString:[textView string]] == NO) {
[textView setString:string];
// the local undo stack is invalid now, and doing it undo safe leads to a weird stack
[undoManager removeAllActions];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-13 08:06:12
|
Revision: 15651
http://sourceforge.net/p/skim-app/code/15651
Author: hofman
Date: 2025-07-13 08:06:11 +0000 (Sun, 13 Jul 2025)
Log Message:
-----------
no reason to declare readonly property as weak
Modified Paths:
--------------
trunk/SKTextNoteEditor.h
Modified: trunk/SKTextNoteEditor.h
===================================================================
--- trunk/SKTextNoteEditor.h 2025-07-13 08:05:29 UTC (rev 15650)
+++ trunk/SKTextNoteEditor.h 2025-07-13 08:06:11 UTC (rev 15651)
@@ -52,7 +52,7 @@
- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(id<SKTextNoteEditorDelegate>)aDelegate;
-@property (nonatomic, weak, readonly) NSString *currentString;
+@property (nonatomic, readonly) NSString *currentString;
- (void)startEditingWithEvent:(nullable NSEvent *)event;
- (void)endEditingWithCommit:(BOOL)commit;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-13 08:05:31
|
Revision: 15650
http://sourceforge.net/p/skim-app/code/15650
Author: hofman
Date: 2025-07-13 08:05:29 +0000 (Sun, 13 Jul 2025)
Log Message:
-----------
currentString is not nullable
Modified Paths:
--------------
trunk/SKTextNoteEditor.h
trunk/SKTextNoteEditor.m
Modified: trunk/SKTextNoteEditor.h
===================================================================
--- trunk/SKTextNoteEditor.h 2025-07-12 14:36:03 UTC (rev 15649)
+++ trunk/SKTextNoteEditor.h 2025-07-13 08:05:29 UTC (rev 15650)
@@ -52,7 +52,7 @@
- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(id<SKTextNoteEditorDelegate>)aDelegate;
-@property (nonatomic, nullable, weak, readonly) NSString *currentString;
+@property (nonatomic, weak, readonly) NSString *currentString;
- (void)startEditingWithEvent:(nullable NSEvent *)event;
- (void)endEditingWithCommit:(BOOL)commit;
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-12 14:36:03 UTC (rev 15649)
+++ trunk/SKTextNoteEditor.m 2025-07-13 08:05:29 UTC (rev 15650)
@@ -90,7 +90,7 @@
}
- (NSString *)currentString {
- return [textView string] ?: [annotation string];
+ return [textView string] ?: [annotation string] ?: @"";
}
- (void)updateParagraphStyle {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-12 14:36:04
|
Revision: 15649
http://sourceforge.net/p/skim-app/code/15649
Author: hofman
Date: 2025-07-12 14:36:03 +0000 (Sat, 12 Jul 2025)
Log Message:
-----------
add text viewe in editor in init
Modified Paths:
--------------
trunk/SKTextNoteEditor.m
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-12 08:55:14 UTC (rev 15648)
+++ trunk/SKTextNoteEditor.m 2025-07-12 14:36:03 UTC (rev 15649)
@@ -50,6 +50,10 @@
#pragma mark -
+@interface SKTextNoteEditor ()
+- (void)setUpTextView;
+@end
+
@implementation SKTextNoteEditor
@dynamic currentString;
@@ -69,6 +73,8 @@
if (@available(macOS 10.14, *))
[self setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];
+
+ [self setUpTextView];
}
return self;
}
@@ -107,9 +113,6 @@
}
- (void)setUpTextView {
- if (textView)
- return;
-
textView = [[SKTextNoteTextView alloc] initWithFrame:[self bounds]];
[textView setRichText:NO];
[textView setDrawsBackground:NO];
@@ -178,7 +181,6 @@
}
- (void)startEditingWithEvent:(NSEvent *)event {
- [self setUpTextView];
[[self window] recalculateKeyViewLoop];
[textView scrollPoint:NSZeroPoint];
[annotation setShouldDisplay:NO];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-12 08:55:16
|
Revision: 15648
http://sourceforge.net/p/skim-app/code/15648
Author: hofman
Date: 2025-07-12 08:55:14 +0000 (Sat, 12 Jul 2025)
Log Message:
-----------
check for superview rather than window
Modified Paths:
--------------
trunk/SKTextNoteEditor.m
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-11 22:42:51 UTC (rev 15647)
+++ trunk/SKTextNoteEditor.m 2025-07-12 08:55:14 UTC (rev 15648)
@@ -156,8 +156,8 @@
// avoid getting textDidEndEditing: messages
[textView setDelegate:nil];
- NSWindow *window = [self window];
- if (window) {
+ if ([self superview]) {
+ NSWindow *window = [self window];
NSResponder *responder = nil;
if (textView && [window firstResponder] == textView)
responder = [self superview];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 22:42:52
|
Revision: 15647
http://sourceforge.net/p/skim-app/code/15647
Author: hofman
Date: 2025-07-11 22:42:51 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
follow responder chain after removing editor to make sure we don't end up with the editor textview
Modified Paths:
--------------
trunk/SKTextNoteEditor.m
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-11 22:30:54 UTC (rev 15646)
+++ trunk/SKTextNoteEditor.m 2025-07-11 22:42:51 UTC (rev 15647)
@@ -159,15 +159,16 @@
NSWindow *window = [self window];
if (window) {
NSResponder *responder = nil;
- if (textView && [window firstResponder] == textView) {
+ if (textView && [window firstResponder] == textView)
responder = [self superview];
+ [self removeFromSuperview];
+ [window recalculateKeyViewLoop];
+ if (responder) {
while (responder && [responder acceptsFirstResponder] == NO)
responder = [responder nextResponder];
+ if (responder)
+ [window makeFirstResponder:responder];
}
- [self removeFromSuperview];
- [window recalculateKeyViewLoop];
- if (responder)
- [window makeFirstResponder:responder];
}
id<SKTextNoteEditorDelegate> theDelegate = delegate;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 22:30:55
|
Revision: 15646
http://sourceforge.net/p/skim-app/code/15646
Author: hofman
Date: 2025-07-11 22:30:54 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
get next first responder from responder chain
Modified Paths:
--------------
trunk/SKPDFView.m
trunk/SKTextNoteEditor.h
trunk/SKTextNoteEditor.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 22:03:17 UTC (rev 15645)
+++ trunk/SKPDFView.m 2025-07-11 22:30:54 UTC (rev 15646)
@@ -2793,12 +2793,9 @@
[[self delegate] PDFViewDidBeginEditing:self];
}
-- (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor wasFirstResponder:(BOOL)wasFirstResponder {
+- (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor {
editor = nil;
- if (wasFirstResponder)
- [[self window] makeFirstResponder:self];
-
[self updatedAnnotation:currentAnnotation];
if ([[self delegate] respondsToSelector:@selector(PDFViewDidEndEditing:)])
Modified: trunk/SKTextNoteEditor.h
===================================================================
--- trunk/SKTextNoteEditor.h 2025-07-11 22:03:17 UTC (rev 15645)
+++ trunk/SKTextNoteEditor.h 2025-07-11 22:30:54 UTC (rev 15646)
@@ -62,7 +62,7 @@
@protocol SKTextNoteEditorDelegate <NSObject>;
- (void)textNoteEditorSetFrame:(SKTextNoteEditor *)textNoteEditor;
- (void)textNoteEditorDidBeginEditing:(SKTextNoteEditor *)textNoteEditor;
-- (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor wasFirstResponder:(BOOL)wasFirstResponder;
+- (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor;
@end
NS_ASSUME_NONNULL_END
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-11 22:03:17 UTC (rev 15645)
+++ trunk/SKTextNoteEditor.m 2025-07-11 22:30:54 UTC (rev 15646)
@@ -156,19 +156,24 @@
// avoid getting textDidEndEditing: messages
[textView setDelegate:nil];
- BOOL wasFirstResponder = NO;
-
- if ([self superview]) {
- NSWindow *window = [self window];
- wasFirstResponder = (textView && [window firstResponder] == textView);
+ NSWindow *window = [self window];
+ if (window) {
+ NSResponder *responder = nil;
+ if (textView && [window firstResponder] == textView) {
+ responder = [self superview];
+ while (responder && [responder acceptsFirstResponder] == NO)
+ responder = [responder nextResponder];
+ }
[self removeFromSuperview];
[window recalculateKeyViewLoop];
+ if (responder)
+ [window makeFirstResponder:responder];
}
id<SKTextNoteEditorDelegate> theDelegate = delegate;
delegate = nil;
- [theDelegate textNoteEditorDidEndEditing:self wasFirstResponder:wasFirstResponder];
+ [theDelegate textNoteEditorDidEndEditing:self];
}
- (void)startEditingWithEvent:(NSEvent *)event {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 22:03:20
|
Revision: 15645
http://sourceforge.net/p/skim-app/code/15645
Author: hofman
Date: 2025-07-11 22:03:17 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
let pdfview make itself first responder after editing based on delegate method parameter. No need for delegate to be a responder.
Modified Paths:
--------------
trunk/SKPDFView.m
trunk/SKTextNoteEditor.h
trunk/SKTextNoteEditor.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 16:33:57 UTC (rev 15644)
+++ trunk/SKPDFView.m 2025-07-11 22:03:17 UTC (rev 15645)
@@ -2793,9 +2793,12 @@
[[self delegate] PDFViewDidBeginEditing:self];
}
-- (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor {
+- (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor wasFirstResponder:(BOOL)wasFirstResponder {
editor = nil;
+ if (wasFirstResponder)
+ [[self window] makeFirstResponder:self];
+
[self updatedAnnotation:currentAnnotation];
if ([[self delegate] respondsToSelector:@selector(PDFViewDidEndEditing:)])
Modified: trunk/SKTextNoteEditor.h
===================================================================
--- trunk/SKTextNoteEditor.h 2025-07-11 16:33:57 UTC (rev 15644)
+++ trunk/SKTextNoteEditor.h 2025-07-11 22:03:17 UTC (rev 15645)
@@ -45,12 +45,12 @@
@interface SKTextNoteEditor : NSView <NSTextViewDelegate> {
NSTextView *textView;
- __weak NSResponder<SKTextNoteEditorDelegate> *delegate;
+ __weak id<SKTextNoteEditorDelegate> delegate;
PDFAnnotation *annotation;
NSUndoManager *undoManager;
}
-- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(NSResponder<SKTextNoteEditorDelegate> *)aDelegate;
+- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(id<SKTextNoteEditorDelegate>)aDelegate;
@property (nonatomic, nullable, weak, readonly) NSString *currentString;
@@ -62,7 +62,7 @@
@protocol SKTextNoteEditorDelegate <NSObject>;
- (void)textNoteEditorSetFrame:(SKTextNoteEditor *)textNoteEditor;
- (void)textNoteEditorDidBeginEditing:(SKTextNoteEditor *)textNoteEditor;
-- (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor;
+- (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor wasFirstResponder:(BOOL)wasFirstResponder;
@end
NS_ASSUME_NONNULL_END
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-11 16:33:57 UTC (rev 15644)
+++ trunk/SKTextNoteEditor.m 2025-07-11 22:03:17 UTC (rev 15645)
@@ -58,7 +58,7 @@
return @[SKNPDFAnnotationBoundsKey, SKNPDFAnnotationFontKey, SKNPDFAnnotationFontColorKey, SKNPDFAnnotationAlignmentKey, SKNPDFAnnotationColorKey, SKNPDFAnnotationBorderKey, SKNPDFAnnotationStringKey];
}
-- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(NSResponder<SKTextNoteEditorDelegate> *)aDelegate {
+- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(id<SKTextNoteEditorDelegate>)aDelegate {
self = [super initWithFrame:[annotation bounds]];
if (self) {
delegate = aDelegate;
@@ -156,19 +156,19 @@
// avoid getting textDidEndEditing: messages
[textView setDelegate:nil];
+ BOOL wasFirstResponder = NO;
+
if ([self superview]) {
NSWindow *window = [self window];
- BOOL wasFirstResponder = (textView && [window firstResponder] == textView);
+ wasFirstResponder = (textView && [window firstResponder] == textView);
[self removeFromSuperview];
[window recalculateKeyViewLoop];
- if (wasFirstResponder)
- [window makeFirstResponder:delegate];
}
- NSResponder<SKTextNoteEditorDelegate> *theDelegate = delegate;
+ id<SKTextNoteEditorDelegate> theDelegate = delegate;
delegate = nil;
- [theDelegate textNoteEditorDidEndEditing:self];
+ [theDelegate textNoteEditorDidEndEditing:self wasFirstResponder:wasFirstResponder];
}
- (void)startEditingWithEvent:(NSEvent *)event {
@@ -207,7 +207,7 @@
- (NSUndoManager *)undoManagerForTextView:(NSTextView *)view {
if (undoManager == nil)
- undoManager = [[SKChainedUndoManager alloc] initWithNextUndoManager:[delegate undoManager]];
+ undoManager = [[SKChainedUndoManager alloc] initWithNextUndoManager:[self undoManager]];
return undoManager;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 16:33:59
|
Revision: 15644
http://sourceforge.net/p/skim-app/code/15644
Author: hofman
Date: 2025-07-11 16:33:57 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
just check for editor
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 16:03:28 UTC (rev 15643)
+++ trunk/SKPDFView.m 2025-07-11 16:33:57 UTC (rev 15644)
@@ -2731,7 +2731,7 @@
}
- (void)editCurrentAnnotation:(id)sender {
- if (nil == currentAnnotation || [self isEditingAnnotation:currentAnnotation])
+ if (nil == currentAnnotation || editor)
return;
[self commitEditing];
@@ -2771,15 +2771,14 @@
}
- (void)editTextNoteWithEvent:(NSEvent *)theEvent {
- if ([self isEditingAnnotation:currentAnnotation])
- return;
-
- editor = [[SKTextNoteEditor alloc] initWithAnnotation:currentAnnotation delegate:self];
- [self textNoteEditorSetFrame:editor];
- [[self documentView] addSubview:editor];
- [editor startEditingWithEvent:theEvent];
-
- [self updatedAnnotation:currentAnnotation];
+ if (editor == nil) {
+ editor = [[SKTextNoteEditor alloc] initWithAnnotation:currentAnnotation delegate:self];
+ [self textNoteEditorSetFrame:editor];
+ [[self documentView] addSubview:editor];
+ [editor startEditingWithEvent:theEvent];
+
+ [self updatedAnnotation:currentAnnotation];
+ }
}
- (void)textNoteEditorSetFrame:(SKTextNoteEditor *)textNoteEditor {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 16:03:30
|
Revision: 15643
http://sourceforge.net/p/skim-app/code/15643
Author: hofman
Date: 2025-07-11 16:03:28 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
set text note editor frame before adding
Modified Paths:
--------------
trunk/SKPDFView.m
trunk/SKTextNoteEditor.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 15:49:35 UTC (rev 15642)
+++ trunk/SKPDFView.m 2025-07-11 16:03:28 UTC (rev 15643)
@@ -2775,6 +2775,7 @@
return;
editor = [[SKTextNoteEditor alloc] initWithAnnotation:currentAnnotation delegate:self];
+ [self textNoteEditorSetFrame:editor];
[[self documentView] addSubview:editor];
[editor startEditingWithEvent:theEvent];
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-11 15:49:35 UTC (rev 15642)
+++ trunk/SKTextNoteEditor.m 2025-07-11 16:03:28 UTC (rev 15643)
@@ -172,7 +172,6 @@
}
- (void)startEditingWithEvent:(NSEvent *)event {
- [delegate textNoteEditorSetFrame:self];
[self setUpTextView];
[[self window] recalculateKeyViewLoop];
[textView scrollPoint:NSZeroPoint];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 15:49:38
|
Revision: 15642
http://sourceforge.net/p/skim-app/code/15642
Author: hofman
Date: 2025-07-11 15:49:35 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
Let pdfview set the frame for the text note editor. Declare pdfview as NSResponder conforming to delegate protocol.
Modified Paths:
--------------
trunk/SKPDFView.m
trunk/SKTextNoteEditor.h
trunk/SKTextNoteEditor.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 14:51:46 UTC (rev 15641)
+++ trunk/SKPDFView.m 2025-07-11 15:49:35 UTC (rev 15642)
@@ -188,7 +188,7 @@
- (void)enableSwipeGestures:(BOOL)flag;
@end
-@interface SKPDFView () <SKReadingBarDelegate, SKLayerDelegate>
+@interface SKPDFView () <SKReadingBarDelegate, SKLayerDelegate, SKTextNoteEditorDelegate>
@property (strong) SKReadingBar *readingBar;
@property (strong) SKSyncDot *syncDot;
@end
@@ -415,7 +415,7 @@
[self resetPDFToolTipRects];
if (editor) {
if ([self isPageAtIndexDisplayed:[currentAnnotation pageIndex]])
- [editor updateFrame];
+ [self textNoteEditorSetFrame:editor];
else
[self commitEditing];
}
@@ -2774,7 +2774,7 @@
if ([self isEditingAnnotation:currentAnnotation])
return;
- editor = [[SKTextNoteEditor alloc] initWithPDFView:self annotation:currentAnnotation];
+ editor = [[SKTextNoteEditor alloc] initWithAnnotation:currentAnnotation delegate:self];
[[self documentView] addSubview:editor];
[editor startEditingWithEvent:theEvent];
@@ -2781,6 +2781,13 @@
[self updatedAnnotation:currentAnnotation];
}
+- (void)textNoteEditorSetFrame:(SKTextNoteEditor *)textNoteEditor {
+ NSRect frame = [self convertRect:[currentAnnotation bounds] fromPage:[currentAnnotation page]];
+ frame = [self backingAlignedRect:frame options:NSAlignAllEdgesNearest];
+ frame = [self convertRect:frame toView:[self documentView]];
+ [editor setFrame:frame];
+}
+
- (void)textNoteEditorDidBeginEditing:(SKTextNoteEditor *)textNoteEditor {
if ([[self delegate] respondsToSelector:@selector(PDFViewDidBeginEditing:)])
[[self delegate] PDFViewDidBeginEditing:self];
@@ -3152,7 +3159,7 @@
[self resetPDFToolTipRects];
} else if ([self isEditingAnnotation:annotation]) {
if ([self isPageAtIndexDisplayed:[annotation pageIndex]])
- [editor updateFrame];
+ [self textNoteEditorSetFrame:editor];
else
[self commitEditing];
}
@@ -3193,7 +3200,7 @@
- (void)handleScaleChangedNotification:(NSNotification *)notification {
[self resetPDFToolTipRects];
[self updatePacer];
- [editor updateFrame];
+ [self textNoteEditorSetFrame:editor];
}
- (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification {
Modified: trunk/SKTextNoteEditor.h
===================================================================
--- trunk/SKTextNoteEditor.h 2025-07-11 14:51:46 UTC (rev 15641)
+++ trunk/SKTextNoteEditor.h 2025-07-11 15:49:35 UTC (rev 15642)
@@ -41,24 +41,26 @@
NS_ASSUME_NONNULL_BEGIN
+@protocol SKTextNoteEditorDelegate;
+
@interface SKTextNoteEditor : NSView <NSTextViewDelegate> {
NSTextView *textView;
- __weak PDFView *pdfView;
+ __weak NSResponder<SKTextNoteEditorDelegate> *delegate;
PDFAnnotation *annotation;
NSUndoManager *undoManager;
}
-- (instancetype)initWithPDFView:(PDFView *)aPDFView annotation:(PDFAnnotation *)anAnnotation;
+- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(NSResponder<SKTextNoteEditorDelegate> *)aDelegate;
@property (nonatomic, nullable, weak, readonly) NSString *currentString;
- (void)startEditingWithEvent:(nullable NSEvent *)event;
- (void)endEditingWithCommit:(BOOL)commit;
-- (void)updateFrame;
@end
-@interface PDFView (SKTextNoteEditor)
+@protocol SKTextNoteEditorDelegate <NSObject>;
+- (void)textNoteEditorSetFrame:(SKTextNoteEditor *)textNoteEditor;
- (void)textNoteEditorDidBeginEditing:(SKTextNoteEditor *)textNoteEditor;
- (void)textNoteEditorDidEndEditing:(SKTextNoteEditor *)textNoteEditor;
@end
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-11 14:51:46 UTC (rev 15641)
+++ trunk/SKTextNoteEditor.m 2025-07-11 15:49:35 UTC (rev 15642)
@@ -37,9 +37,7 @@
*/
#import "SKTextNoteEditor.h"
-#import "PDFView_SKExtensions.h"
#import "PDFAnnotation_SKExtensions.h"
-#import "NSView_SKExtensions.h"
#import "NSEvent_SKExtensions.h"
#import "SKChainedUndoManager.h"
#import "SKStringConstants.h"
@@ -60,10 +58,10 @@
return @[SKNPDFAnnotationBoundsKey, SKNPDFAnnotationFontKey, SKNPDFAnnotationFontColorKey, SKNPDFAnnotationAlignmentKey, SKNPDFAnnotationColorKey, SKNPDFAnnotationBorderKey, SKNPDFAnnotationStringKey];
}
-- (instancetype)initWithPDFView:(PDFView *)aPDFView annotation:(PDFAnnotation *)anAnnotation {
+- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(NSResponder<SKTextNoteEditorDelegate> *)aDelegate {
self = [super initWithFrame:[annotation bounds]];
if (self) {
- pdfView = aPDFView;
+ delegate = aDelegate;
annotation = anAnnotation;
for (NSString *key in [[self class] keysToObserve])
@@ -89,12 +87,6 @@
return [textView string] ?: [annotation string];
}
-- (void)updateFrame {
- NSRect frame = [pdfView backingAlignedRect:[pdfView convertRect:[annotation bounds] fromPage:[annotation page]] options:NSAlignAllEdgesNearest];
- frame = [pdfView convertRect:frame toView:[self superview]];
- [self setFrame:frame];
-}
-
- (void)updateParagraphStyle {
NSFont *font = [annotation font];
NSMutableParagraphStyle *parStyle = [[NSMutableParagraphStyle alloc] init];
@@ -165,24 +157,24 @@
[textView setDelegate:nil];
if ([self superview]) {
- BOOL wasFirstResponder = (textView && [[pdfView window] firstResponder] == textView);
+ NSWindow *window = [self window];
+ BOOL wasFirstResponder = (textView && [window firstResponder] == textView);
[self removeFromSuperview];
- [[pdfView window] recalculateKeyViewLoop];
+ [window recalculateKeyViewLoop];
if (wasFirstResponder)
- [[pdfView window] makeFirstResponder:pdfView];
+ [window makeFirstResponder:delegate];
}
- PDFView *thePdfView = pdfView;
- pdfView = nil;
+ NSResponder<SKTextNoteEditorDelegate> *theDelegate = delegate;
+ delegate = nil;
- if ([thePdfView respondsToSelector:@selector(textNoteEditorDidEndEditing:)])
- [thePdfView textNoteEditorDidEndEditing:self];
+ [theDelegate textNoteEditorDidEndEditing:self];
}
- (void)startEditingWithEvent:(NSEvent *)event {
- [self updateFrame];
+ [delegate textNoteEditorSetFrame:self];
[self setUpTextView];
- [[pdfView window] recalculateKeyViewLoop];
+ [[self window] recalculateKeyViewLoop];
[textView scrollPoint:NSZeroPoint];
[annotation setShouldDisplay:NO];
if (event) {
@@ -207,8 +199,7 @@
}
- (void)textDidBeginEditing:(NSNotification *)notification {
- if ([pdfView respondsToSelector:@selector(textNoteEditorDidBeginEditing:)])
- [pdfView textNoteEditorDidBeginEditing:self];
+ [delegate textNoteEditorDidBeginEditing:self];
}
- (void)textDidEndEditing:(NSNotification *)notification {
@@ -217,7 +208,7 @@
- (NSUndoManager *)undoManagerForTextView:(NSTextView *)view {
if (undoManager == nil)
- undoManager = [[SKChainedUndoManager alloc] initWithNextUndoManager:[pdfView undoManager]];
+ undoManager = [[SKChainedUndoManager alloc] initWithNextUndoManager:[delegate undoManager]];
return undoManager;
}
@@ -224,7 +215,7 @@
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if (context == &SKPDFAnnotationPropertiesObservationContext) {
if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey]) {
- [self updateFrame];
+ [delegate textNoteEditorSetFrame:self];
} else if ([keyPath isEqualToString:SKNPDFAnnotationFontKey]) {
[textView setFont:[annotation font]];
[self updateParagraphStyle];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 14:51:49
|
Revision: 15641
http://sourceforge.net/p/skim-app/code/15641
Author: hofman
Date: 2025-07-11 14:51:46 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
let pdfview add text note editor to documentView
Modified Paths:
--------------
trunk/SKPDFView.m
trunk/SKTextNoteEditor.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 14:43:33 UTC (rev 15640)
+++ trunk/SKPDFView.m 2025-07-11 14:51:46 UTC (rev 15641)
@@ -2775,6 +2775,7 @@
return;
editor = [[SKTextNoteEditor alloc] initWithPDFView:self annotation:currentAnnotation];
+ [[self documentView] addSubview:editor];
[editor startEditingWithEvent:theEvent];
[self updatedAnnotation:currentAnnotation];
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-11 14:43:33 UTC (rev 15640)
+++ trunk/SKTextNoteEditor.m 2025-07-11 14:51:46 UTC (rev 15641)
@@ -91,7 +91,7 @@
- (void)updateFrame {
NSRect frame = [pdfView backingAlignedRect:[pdfView convertRect:[annotation bounds] fromPage:[annotation page]] options:NSAlignAllEdgesNearest];
- frame = [pdfView convertRect:frame toView:[pdfView documentView]];
+ frame = [pdfView convertRect:frame toView:[self superview]];
[self setFrame:frame];
}
@@ -180,9 +180,8 @@
}
- (void)startEditingWithEvent:(NSEvent *)event {
+ [self updateFrame];
[self setUpTextView];
- [self updateFrame];
- [[pdfView documentView] addSubview:self];
[[pdfView window] recalculateKeyViewLoop];
[textView scrollPoint:NSZeroPoint];
[annotation setShouldDisplay:NO];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 14:43:36
|
Revision: 15640
http://sourceforge.net/p/skim-app/code/15640
Author: hofman
Date: 2025-07-11 14:43:33 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
resize text note editor or end editing from pdfvieww
Modified Paths:
--------------
trunk/SKPDFView.m
trunk/SKTextNoteEditor.h
trunk/SKTextNoteEditor.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 14:28:15 UTC (rev 15639)
+++ trunk/SKPDFView.m 2025-07-11 14:43:33 UTC (rev 15640)
@@ -413,7 +413,12 @@
- (void)layoutDocumentView {
[super layoutDocumentView];
[self resetPDFToolTipRects];
- [editor updateLayout];
+ if (editor) {
+ if ([self isPageAtIndexDisplayed:[currentAnnotation pageIndex]])
+ [editor updateFrame];
+ else
+ [self commitEditing];
+ }
}
#pragma mark Drawing
@@ -2790,19 +2795,18 @@
}
- (void)discardEditing {
- [editor discardEditing];
+ [editor endEditingWithCommit:NO];
}
- (BOOL)commitEditing {
- BOOL success = YES;
if (editor) {
NSUndoManager *undoManager = [self undoManager];
NSInteger level = [undoManager groupingLevel];
- success = [editor commitEditing];
+ [editor endEditingWithCommit:YES];
if ([undoManager groupingLevel] > level)
wantsNewUndoGroup = YES;
}
- return success;
+ return YES;
}
- (void)beginNewUndoGroupIfNeeded {
@@ -3143,10 +3147,14 @@
PDFAnnotation *annotation = [userInfo objectForKey:SKPDFDocumentAnnotationKey];
[self updatedAnnotation:annotation];
- if ([annotation isNote])
+ if ([annotation isNote]) {
[self resetPDFToolTipRects];
- if ([self isEditingAnnotation:annotation])
- [editor updateLayout];
+ } else if ([self isEditingAnnotation:annotation]) {
+ if ([self isPageAtIndexDisplayed:[annotation pageIndex]])
+ [editor updateFrame];
+ else
+ [self commitEditing];
+ }
}
- (void)registerForDocumentNotifications {
@@ -3184,7 +3192,7 @@
- (void)handleScaleChangedNotification:(NSNotification *)notification {
[self resetPDFToolTipRects];
[self updatePacer];
- [editor updateLayout];
+ [editor updateFrame];
}
- (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification {
Modified: trunk/SKTextNoteEditor.h
===================================================================
--- trunk/SKTextNoteEditor.h 2025-07-11 14:28:15 UTC (rev 15639)
+++ trunk/SKTextNoteEditor.h 2025-07-11 14:43:33 UTC (rev 15640)
@@ -53,11 +53,9 @@
@property (nonatomic, nullable, weak, readonly) NSString *currentString;
- (void)startEditingWithEvent:(nullable NSEvent *)event;
-- (void)updateLayout;
+- (void)endEditingWithCommit:(BOOL)commit;
+- (void)updateFrame;
-- (void)discardEditing;
-- (BOOL)commitEditing;
-
@end
@interface PDFView (SKTextNoteEditor)
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-11 14:28:15 UTC (rev 15639)
+++ trunk/SKTextNoteEditor.m 2025-07-11 14:43:33 UTC (rev 15640)
@@ -196,22 +196,6 @@
}
}
-- (void)updateLayout {
- if ([pdfView isPageAtIndexDisplayed:[annotation pageIndex]])
- [self updateFrame];
- else
- [self endEditingWithCommit:YES];
-}
-
-- (void)discardEditing {
- [self endEditingWithCommit:NO];
-}
-
-- (BOOL)commitEditing {
- [self endEditingWithCommit:YES];
- return YES;
-}
-
- (BOOL)textView:(NSTextView *)aTextView doCommandBySelector:(SEL)command {
if (command == @selector(insertTab:)) {
[self endEditingWithCommit:YES];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 14:28:16
|
Revision: 15639
http://sourceforge.net/p/skim-app/code/15639
Author: hofman
Date: 2025-07-11 14:28:15 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
no need to make pdfview first responder before starting edit
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 14:26:07 UTC (rev 15638)
+++ trunk/SKPDFView.m 2025-07-11 14:28:15 UTC (rev 15639)
@@ -2770,7 +2770,6 @@
return;
editor = [[SKTextNoteEditor alloc] initWithPDFView:self annotation:currentAnnotation];
- [[self window] makeFirstResponder:self];
[editor startEditingWithEvent:theEvent];
[self updatedAnnotation:currentAnnotation];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 14:26:09
|
Revision: 15638
http://sourceforge.net/p/skim-app/code/15638
Author: hofman
Date: 2025-07-11 14:26:07 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
use correct method
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 09:32:17 UTC (rev 15637)
+++ trunk/SKPDFView.m 2025-07-11 14:26:07 UTC (rev 15638)
@@ -413,7 +413,7 @@
- (void)layoutDocumentView {
[super layoutDocumentView];
[self resetPDFToolTipRects];
- [editor layout];
+ [editor updateLayout];
}
#pragma mark Drawing
@@ -3147,7 +3147,7 @@
if ([annotation isNote])
[self resetPDFToolTipRects];
if ([self isEditingAnnotation:annotation])
- [editor layout];
+ [editor updateLayout];
}
- (void)registerForDocumentNotifications {
@@ -3185,7 +3185,7 @@
- (void)handleScaleChangedNotification:(NSNotification *)notification {
[self resetPDFToolTipRects];
[self updatePacer];
- [editor layout];
+ [editor updateLayout];
}
- (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-11 09:32:20
|
Revision: 15637
http://sourceforge.net/p/skim-app/code/15637
Author: hofman
Date: 2025-07-11 09:32:17 +0000 (Fri, 11 Jul 2025)
Log Message:
-----------
use separate mehods to start editing text note and updating its layout
Modified Paths:
--------------
trunk/SKPDFView.m
trunk/SKTextNoteEditor.h
trunk/SKTextNoteEditor.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-11 09:16:30 UTC (rev 15636)
+++ trunk/SKPDFView.m 2025-07-11 09:32:17 UTC (rev 15637)
@@ -413,7 +413,7 @@
- (void)layoutDocumentView {
[super layoutDocumentView];
[self resetPDFToolTipRects];
- [editor layoutWithEvent:nil];
+ [editor layout];
}
#pragma mark Drawing
@@ -2771,7 +2771,7 @@
editor = [[SKTextNoteEditor alloc] initWithPDFView:self annotation:currentAnnotation];
[[self window] makeFirstResponder:self];
- [editor layoutWithEvent:theEvent];
+ [editor startEditingWithEvent:theEvent];
[self updatedAnnotation:currentAnnotation];
}
@@ -3147,7 +3147,7 @@
if ([annotation isNote])
[self resetPDFToolTipRects];
if ([self isEditingAnnotation:annotation])
- [editor layoutWithEvent:nil];
+ [editor layout];
}
- (void)registerForDocumentNotifications {
@@ -3185,7 +3185,7 @@
- (void)handleScaleChangedNotification:(NSNotification *)notification {
[self resetPDFToolTipRects];
[self updatePacer];
- [editor layoutWithEvent:nil];
+ [editor layout];
}
- (void)handleUpdateTrackingAreasNotification:(NSNotification *)notification {
Modified: trunk/SKTextNoteEditor.h
===================================================================
--- trunk/SKTextNoteEditor.h 2025-07-11 09:16:30 UTC (rev 15636)
+++ trunk/SKTextNoteEditor.h 2025-07-11 09:32:17 UTC (rev 15637)
@@ -52,7 +52,8 @@
@property (nonatomic, nullable, weak, readonly) NSString *currentString;
-- (void)layoutWithEvent:(nullable NSEvent *)event;
+- (void)startEditingWithEvent:(nullable NSEvent *)event;
+- (void)updateLayout;
- (void)discardEditing;
- (BOOL)commitEditing;
Modified: trunk/SKTextNoteEditor.m
===================================================================
--- trunk/SKTextNoteEditor.m 2025-07-11 09:16:30 UTC (rev 15636)
+++ trunk/SKTextNoteEditor.m 2025-07-11 09:32:17 UTC (rev 15637)
@@ -39,7 +39,6 @@
#import "SKTextNoteEditor.h"
#import "PDFView_SKExtensions.h"
#import "PDFAnnotation_SKExtensions.h"
-#import "PDFPage_SKExtensions.h"
#import "NSView_SKExtensions.h"
#import "NSEvent_SKExtensions.h"
#import "SKChainedUndoManager.h"
@@ -90,7 +89,7 @@
return [textView string] ?: [annotation string];
}
-- (void)updateFrame:(NSNotification *)note {
+- (void)updateFrame {
NSRect frame = [pdfView backingAlignedRect:[pdfView convertRect:[annotation bounds] fromPage:[annotation page]] options:NSAlignAllEdgesNearest];
frame = [pdfView convertRect:frame toView:[pdfView documentView]];
[self setFrame:frame];
@@ -146,8 +145,6 @@
[self addSubview:clipView];
[self updateParagraphStyle];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateFrame:) name:SKPDFPageBoundsDidChangeNotification object:[pdfView document]];
}
- (void)endEditingWithCommit:(BOOL)commit {
@@ -182,29 +179,30 @@
[thePdfView textNoteEditorDidEndEditing:self];
}
-- (void)layoutWithEvent:(NSEvent *)event {
- if ([pdfView isPageAtIndexDisplayed:[annotation pageIndex]]) {
- [self setUpTextView];
- [self updateFrame:nil];
- if ([self superview] == nil) {
- [[pdfView documentView] addSubview:self];
- [[pdfView window] recalculateKeyViewLoop];
- [textView scrollPoint:NSZeroPoint];
- if (event) {
- [[textView window] makeFirstResponder:textView];
- [textView mouseDown:event];
- } else if ([[[pdfView window] firstResponder] isEqual:pdfView]) {
- NSRange range = NSMakeRange(0, [[textView string] length]);
- [textView setSelectedRange:range];
- [[textView window] makeFirstResponder:textView];
- }
- [annotation setShouldDisplay:NO];
- }
+- (void)startEditingWithEvent:(NSEvent *)event {
+ [self setUpTextView];
+ [self updateFrame];
+ [[pdfView documentView] addSubview:self];
+ [[pdfView window] recalculateKeyViewLoop];
+ [textView scrollPoint:NSZeroPoint];
+ [annotation setShouldDisplay:NO];
+ if (event) {
+ [[textView window] makeFirstResponder:textView];
+ [textView mouseDown:event];
} else {
- [self endEditingWithCommit:YES];
+ NSRange range = NSMakeRange(0, [[textView string] length]);
+ [textView setSelectedRange:range];
+ [[textView window] makeFirstResponder:textView];
}
}
+- (void)updateLayout {
+ if ([pdfView isPageAtIndexDisplayed:[annotation pageIndex]])
+ [self updateFrame];
+ else
+ [self endEditingWithCommit:YES];
+}
+
- (void)discardEditing {
[self endEditingWithCommit:NO];
}
@@ -243,7 +241,7 @@
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if (context == &SKPDFAnnotationPropertiesObservationContext) {
if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey]) {
- [self updateFrame:nil];
+ [self updateFrame];
} else if ([keyPath isEqualToString:SKNPDFAnnotationFontKey]) {
[textView setFont:[annotation font]];
[self updateParagraphStyle];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|