Revision: 15847
http://sourceforge.net/p/skim-app/code/15847
Author: hofman
Date: 2025-12-09 00:00:15 +0000 (Tue, 09 Dec 2025)
Log Message:
-----------
layout side view scroll views with border inset only when the scrollview has a
border
Modified Paths:
--------------
trunk/SKSideViewController.m
Modified: trunk/SKSideViewController.m
===================================================================
--- trunk/SKSideViewController.m 2025-12-08 22:42:57 UTC (rev 15846)
+++ trunk/SKSideViewController.m 2025-12-09 00:00:15 UTC (rev 15847)
@@ -68,9 +68,11 @@
- (void)setTopInset:(CGFloat)topInset {
[topConstraint setConstant:topInset];
- NSEdgeInsets insets = NSEdgeInsetsMake(topInset + NSHeight([topBar frame])
+ BORDER_INSET, BORDER_INSET, BORDER_INSET, BORDER_INSET);
+ topInset += NSHeight([topBar frame]);
for (NSTableView *view in [self tableViews]) {
NSScrollView *scrollView = [view enclosingScrollView];
+ CGFloat inset = [scrollView borderType] == NSNoBorder ? 0.0 :
BORDER_INSET;
+ NSEdgeInsets insets = NSEdgeInsetsMake(topInset + inset, inset, inset,
inset);
[scrollView setAutomaticallyAdjustsContentInsets:NO];
[scrollView setContentInsets:insets];
}
@@ -109,11 +111,12 @@
[[SKImageToolTipWindow sharedToolTipWindow] orderOut:self];
[newView setFrame:[oldView frame]];
+ CGFloat inset = [newView respondsToSelector:@selector(borderType)] &&
[(NSScrollView *)newView borderType] != NSNoBorder ? -BORDER_INSET : 0.0;
NSArray *constraints = @[
- [[newView leadingAnchor] constraintEqualToAnchor:[contentView
leadingAnchor] constant:-BORDER_INSET],
- [[contentView trailingAnchor] constraintEqualToAnchor:[newView
trailingAnchor] constant:-BORDER_INSET],
- [[newView topAnchor] constraintEqualToAnchor:[contentView topAnchor]
constant:-BORDER_INSET],
- [[contentView bottomAnchor] constraintEqualToAnchor:[newView
bottomAnchor] constant:-BORDER_INSET]];
+ [[newView leadingAnchor] constraintEqualToAnchor:[contentView
leadingAnchor] constant:inset],
+ [[contentView trailingAnchor] constraintEqualToAnchor:[newView
trailingAnchor] constant:inset],
+ [[newView topAnchor] constraintEqualToAnchor:[contentView topAnchor]
constant:inset],
+ [[contentView bottomAnchor] constraintEqualToAnchor:[newView
bottomAnchor] constant:inset]];
if (animate == NO) {
[contentView replaceSubview:oldView with:newView];
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