Revision: 15853
          http://sourceforge.net/p/skim-app/code/15853
Author:   hofman
Date:     2025-12-10 16:57:57 +0000 (Wed, 10 Dec 2025)
Log Message:
-----------
support commandSelectRow only for source list tables

Modified Paths:
--------------
    trunk/SKTableView.m

Modified: trunk/SKTableView.m
===================================================================
--- trunk/SKTableView.m 2025-12-10 15:47:46 UTC (rev 15852)
+++ trunk/SKTableView.m 2025-12-10 16:57:57 UTC (rev 15853)
@@ -112,13 +112,15 @@
 - (void)mouseDown:(NSEvent *)theEvent {
     if ([self imageToolTipLayout] != SKTableImageToolTipNone)
         [[SKImageToolTipWindow sharedToolTipWindow] remove];
-    if ([self allowsMultipleSelection] == NO && ([theEvent modifierFlags] & 
NSEventModifierFlagCommand) && [[self delegate] 
respondsToSelector:@selector(tableView:commandSelectRow:)]) {
-        NSInteger row = [self rowAtPoint:[theEvent locationInView:self]];
-        if (row != -1 && [NSApp willDragMouse] == NO && [[self delegate] 
tableView:self commandSelectRow:row])
+    if ([self selectionHighlightStyle] == 
NSTableViewSelectionHighlightStyleSourceList) {
+        if ([self allowsMultipleSelection] == NO && [theEvent 
deviceIndependentModifierFlags] == NSEventModifierFlagCommand && [[self 
delegate] respondsToSelector:@selector(tableView:commandSelectRow:)]) {
+            NSInteger row = [self rowAtPoint:[theEvent locationInView:self]];
+            if (row != -1 && [NSApp willDragMouse] == NO && [[self delegate] 
tableView:self commandSelectRow:row])
+                return;
+        } else if ([self allowsEmptySelection] && [theEvent 
deviceIndependentModifierFlags] == 0 && [self rowAtPoint:[theEvent 
locationInView:self]] == -1 && [self rowAtPoint:[theEvent locationInView:self]] 
== -1 && [NSApp willDragMouse] == NO) {
+            [self deselectAll:nil];
             return;
-    } else if ([self allowsEmptySelection] && [self selectionHighlightStyle] 
== NSTableViewSelectionHighlightStyleSourceList && [theEvent modifierFlags] == 
0 && [self rowAtPoint:[theEvent locationInView:self]] == -1 && [self 
rowAtPoint:[theEvent locationInView:self]] == -1 && [NSApp willDragMouse] == 
NO) {
-        [self deselectAll:nil];
-        return;
+        }
     }
     [super mouseDown:theEvent];
 }

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to