Revision: 13509
          http://sourceforge.net/p/skim-app/code/13509
Author:   hofman
Date:     2023-06-26 09:31:48 +0000 (Mon, 26 Jun 2023)
Log Message:
-----------
set visual effect view as background view of overviewView when available, 
rather than as container view

Modified Paths:
--------------
    trunk/SKMainWindowController.h
    trunk/SKMainWindowController.m

Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h      2023-06-25 14:54:02 UTC (rev 13508)
+++ trunk/SKMainWindowController.h      2023-06-26 09:31:48 UTC (rev 13509)
@@ -87,7 +87,7 @@
     SKMainTouchBarController            *touchBarController;
     
     SKOverviewView                      *overviewView;
-    NSVisualEffectView                  *overviewContentView;
+    NSView                              *overviewContentView;
     
     NSView                              *leftSideContentView;
     NSView                              *rightSideContentView;

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2023-06-25 14:54:02 UTC (rev 13508)
+++ trunk/SKMainWindowController.m      2023-06-26 09:31:48 UTC (rev 13509)
@@ -1697,16 +1697,16 @@
         [scrollView setHasVerticalScroller:YES];
         [scrollView setAutohidesScrollers:YES];
         [scrollView setDocumentView:overviewView];
-        [scrollView setAutoresizingMask:NSViewWidthSizable | 
NSViewHeightSizable];
-        [overviewView setBackgroundColors:@[[NSColor clearColor]]];
         [scrollView setDrawsBackground:NO];
-        overviewContentView = [[NSVisualEffectView alloc] init];
-        [overviewContentView setTranslatesAutoresizingMaskIntoConstraints:NO];
-        [overviewContentView addSubview:scrollView];
-        [scrollView release];
+        NSVisualEffectView *bgView = [[NSVisualEffectView alloc] init];
         [overviewView setSelectable:YES];
         [overviewView setAllowsMultipleSelection:YES];
         if (RUNNING_BEFORE(10_11)) {
+            overviewContentView = bgView;
+            [scrollView setAutoresizingMask:NSViewWidthSizable | 
NSViewHeightSizable];
+            [overviewContentView addSubview:scrollView];
+            [scrollView release];
+            [overviewView setBackgroundColors:@[[NSColor clearColor]]];
             [self updateOverviewItemSize];
             [overviewView setItemPrototype:[[[SKThumbnailItem alloc] init] 
autorelease]];
             [overviewView setContent:[self thumbnails]];
@@ -1716,6 +1716,9 @@
             if (markedPageIndex != NSNotFound)
                 [(SKThumbnailItem *)[overviewView itemAtIndex:markedPageIndex] 
setMarked:YES];
         } else {
+            overviewContentView = scrollView;
+            [overviewView setBackgroundView:bgView];
+            [bgView release];
             NSCollectionViewFlowLayout *layout = [[[NSCollectionViewFlowLayout 
alloc] init] autorelease];
             [layout setMinimumLineSpacing:8.0];
             [layout setMinimumInteritemSpacing:0.0];
@@ -1728,6 +1731,7 @@
         [overviewView 
setTypeSelectHelper:[leftSideController.thumbnailTableView typeSelectHelper]];
         [overviewView setDoubleClickAction:@selector(hideOverview:)];
         [overviewView addObserver:self forKeyPath:RUNNING_BEFORE(10_11) ? 
@"selectionIndexes" : @"selectionIndexPaths" options:0 
context:&SKMainWindowThumbnailSelectionObservationContext];
+        [overviewContentView setTranslatesAutoresizingMaskIntoConstraints:NO];
     }
     
     BOOL isPresentation = [self interactionMode] == SKPresentationMode;
@@ -1744,8 +1748,9 @@
     [overviewView scrollRectToVisible:[overviewView 
frameForItemAtIndex:[[pdfView currentPage] pageIndex]]];
     [overviewView setSelectionIndexes:[NSIndexSet indexSetWithIndex:[[pdfView 
currentPage] pageIndex]]];
     
+    NSVisualEffectView *backgroundView = RUNNING_BEFORE(10_11) ? 
(NSVisualEffectView *)overviewContentView : (NSVisualEffectView *)[overviewView 
backgroundView];
     if (RUNNING_BEFORE(10_14)) {
-        [overviewContentView setMaterial:isPresentation ? 
NSVisualEffectMaterialDark : RUNNING_BEFORE(10_11) ? 
NSVisualEffectMaterialAppearanceBased : NSVisualEffectMaterialSidebar];
+        [backgroundView setMaterial:isPresentation ? 
NSVisualEffectMaterialDark : RUNNING_BEFORE(10_11) ? 
NSVisualEffectMaterialAppearanceBased : NSVisualEffectMaterialSidebar];
         NSBackgroundStyle style = isPresentation ? NSBackgroundStyleDark : 
NSBackgroundStyleLight;
         if (RUNNING_BEFORE(10_11)) {
             NSUInteger i, iMax = [[overviewView content] count];
@@ -1758,11 +1763,11 @@
         SKSetHasDarkAppearance(overviewContentView);
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wpartial-availability"
-        [overviewContentView 
setMaterial:NSVisualEffectMaterialUnderPageBackground];
+        [backgroundView setMaterial:NSVisualEffectMaterialUnderPageBackground];
 #pragma clang diagnostic pop
     } else {
         SKSetHasDefaultAppearance(overviewContentView);
-        [overviewContentView setMaterial:NSVisualEffectMaterialSidebar];
+        [backgroundView setMaterial:NSVisualEffectMaterialSidebar];
     }
     [overviewView setSingleClickAction:isPresentation ? 
@selector(hideOverview:) : NULL];
     

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