Revision: 15320
          http://sourceforge.net/p/skim-app/code/15320
Author:   hofman
Date:     2025-05-29 14:06:58 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Handle cancelOperation: in presentation view for some cases

Modified Paths:
--------------
    trunk/SKMainWindowController_Actions.m
    trunk/SKPresentationView.h
    trunk/SKPresentationView.m

Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m      2025-05-29 09:27:56 UTC (rev 
15319)
+++ trunk/SKMainWindowController_Actions.m      2025-05-29 14:06:58 UTC (rev 
15320)
@@ -1277,23 +1277,12 @@
 }
 
 - (void)cancelOperation:(id)sender {
-    // passed on from SKSideWindow or SKFullScreenWindow
-    if ([self interactionMode] == SKPresentationMode) {
-        if ([self leftSidePaneIsOpen])
-            [self toggleLeftSidePane:sender];
-        else if ([self hasOverview])
-            [self hideOverviewAnimating:YES];
-        else if ([presentationView hasBlackout])
-            [presentationView toggleBlackout:sender];
-        else if ([presentationView showingCursorStyleWindow])
-            [presentationView closeCursorStyleWindow:sender];
-        else
-            [self exitPresentation];
-    } else if ([self hasOverview]) {
+    if ([self hasOverview])
         [self hideOverviewAnimating:YES];
-    } else if ([self canExitFullscreen]) {
+    else if ([self canExitPresentation])
+        [self exitPresentation];
+    else if ([self canExitFullscreen])
         [self exitFullscreen];
-    }
 }
 
 - (void)scrollUp:(id)sender {

Modified: trunk/SKPresentationView.h
===================================================================
--- trunk/SKPresentationView.h  2025-05-29 09:27:56 UTC (rev 15319)
+++ trunk/SKPresentationView.h  2025-05-29 14:06:58 UTC (rev 15320)
@@ -99,12 +99,8 @@
 @property (nonatomic) BOOL removeCursorShadow;
 @property (nonatomic) BOOL drawInPresentation;
 
-@property (nonatomic) BOOL showingCursorStyleWindow;
-
 - (void)toggleAutoActualSize:(nullable id)sender;
 
-- (void)toggleBlackout:(nullable id)sender;
-
 - (void)exitPresentation:(nullable id)sender;
 
 - (void)showCursorStyleWindow:(nullable id)sender;

Modified: trunk/SKPresentationView.m
===================================================================
--- trunk/SKPresentationView.m  2025-05-29 09:27:56 UTC (rev 15319)
+++ trunk/SKPresentationView.m  2025-05-29 14:06:58 UTC (rev 15320)
@@ -418,7 +418,7 @@
 
 @implementation SKPresentationView
 
-@dynamic autoScales, cursorStyle, hasBlackout, removeCursorShadow, 
drawInPresentation, showingCursorStyleWindow;
+@dynamic autoScales, cursorStyle, hasBlackout, removeCursorShadow, 
drawInPresentation;
 
 + (void)initialize {
     SKINITIALIZE;
@@ -635,10 +635,6 @@
     return pvFlags.enableDrawing;
 }
 
-- (BOOL)showingCursorStyleWindow {
-    return [cursorWindow isVisible];
-}
-
 #pragma mark Actions
 
 - (void)toggleAutoActualSize:(id)sender {
@@ -701,6 +697,21 @@
     [[NSUserDefaults standardUserDefaults] setBool:NO == pvFlags.enableDrawing 
forKey:SKDisableDrawingInPresentationKey];
 }
 
+- (void)cancelOperation:(id)sender {
+    for (NSWindow *window in [[self window] childWindows]) {
+        if (window != navWindow && window != cursorWindow) {
+            [self tryToPerform:@selector(toggleLeftSidePane:) with:sender];
+            return;
+        }
+    }
+    if ([self hasBlackout])
+        [self toggleBlackout:sender];
+    else if ([cursorWindow isVisible])
+        [self closeCursorStyleWindow:sender];
+    else
+        [[self window] tryToPerform:_cmd with:sender];
+}
+
 - (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
     if ([menuItem action] == @selector(goToNextPage:))
         return [self canGoToNextPage];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to