Revision: 14479
http://sourceforge.net/p/skim-app/code/14479
Author: hofman
Date: 2024-09-24 22:42:25 +0000 (Tue, 24 Sep 2024)
Log Message:
-----------
Make preview window a floating panel
Modified Paths:
--------------
trunk/SKPresentationOptionsSheetController.h
trunk/SKPresentationOptionsSheetController.m
Modified: trunk/SKPresentationOptionsSheetController.h
===================================================================
--- trunk/SKPresentationOptionsSheetController.h 2024-09-24 21:47:57 UTC
(rev 14478)
+++ trunk/SKPresentationOptionsSheetController.h 2024-09-24 22:42:25 UTC
(rev 14479)
@@ -60,7 +60,7 @@
__weak SKMainWindowController *controller;
NSUndoManager *undoManager;
NSMutableSet<SKTransitionInfo *> *changedTransitions;
- NSWindow *previewWindow;
+ NSPanel *previewWindow;
SKPDFPageView *previewView;
}
Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m 2024-09-24 21:47:57 UTC
(rev 14478)
+++ trunk/SKPresentationOptionsSheetController.m 2024-09-24 22:42:25 UTC
(rev 14479)
@@ -287,20 +287,18 @@
rect.size.height = round(0.5 * NSHeight(rect)) + 30.0;
if (previewWindow == nil) {
- previewWindow = [[NSWindow alloc] initWithContentRect:rect
styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskFullSizeContentView
backing:NSBackingStoreBuffered defer:NO];
+ previewWindow = [[NSPanel alloc] initWithContentRect:rect
styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskFullSizeContentView
backing:NSBackingStoreBuffered defer:NO];
[previewWindow setReleasedWhenClosed:NO];
[previewWindow setTitlebarAppearsTransparent:YES];
- [previewWindow setExcludedFromWindowsMenu:YES];
+ [previewWindow setHidesOnDeactivate:NO];
+ [previewWindow setFloatingPanel:YES];
- NSView *contentView = [previewWindow contentView];
+ NSVisualEffectView *contentView = [[NSVisualEffectView alloc] init];
+ [contentView setMaterial:NSVisualEffectMaterialPopover];
+ [contentView setState:NSVisualEffectStateActive];
+ [contentView setBlendingMode:NSVisualEffectBlendingModeBehindWindow];
+ [previewWindow setContentView:contentView];
- NSVisualEffectView *veView = [[NSVisualEffectView alloc] init];
- [veView setMaterial:NSVisualEffectMaterialPopover];
- [veView setState:NSVisualEffectStateActive];
- [veView setBlendingMode:NSVisualEffectBlendingModeBehindWindow];
- [veView setTranslatesAutoresizingMaskIntoConstraints:NO];
- [contentView addSubviewWithConstraints:veView];
-
NSView *bgView = [[NSView alloc] init];
CALayer *layer = [CALayer layer];
[layer setBackgroundColor:CGColorGetConstantColor(kCGColorBlack)];
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