Revision: 15043
          http://sourceforge.net/p/skim-app/code/15043
Author:   hofman
Date:     2025-03-29 16:05:56 +0000 (Sat, 29 Mar 2025)
Log Message:
-----------
Set frame for new itemView in initializer

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

Modified: trunk/SKColorSwatch.m
===================================================================
--- trunk/SKColorSwatch.m       2025-03-29 16:03:09 UTC (rev 15042)
+++ trunk/SKColorSwatch.m       2025-03-29 16:05:56 UTC (rev 15043)
@@ -168,6 +168,7 @@
         [NSLayoutConstraint activateConstraints:constraints];
         
         SKColorSwatchItemView *itemView = [[SKColorSwatchItemView alloc] 
initWithFrame:[self frameForItemViewAtIndex:0]];
+        [itemView setAutoresizingMask:NSViewNotSizable];
         [itemView setColor:[NSColor whiteColor]];
         [self addSubview:itemView];
         itemViews = [[NSMutableArray alloc] initWithObjects:itemView, nil];
@@ -485,7 +486,7 @@
         if (i < [itemViews count]) {
             itemView = [itemViews objectAtIndex:i];
         } else {
-            itemView = [[SKColorSwatchItemView alloc] init];
+            itemView = [[SKColorSwatchItemView alloc] initWithFrame:[self 
frameForItemViewAtIndex:i]];
             [itemView setAutoresizingMask:NSViewNotSizable];
             [self addSubview:itemView];
             [itemViews addObject:itemView];
@@ -501,7 +502,6 @@
             [self sizeToFit];
         [self setBezelWidth:[self contentWidth]];
     }
-    [self updateItemViewFramesAnimating:NO];
     [[NSNotificationCenter defaultCenter] 
postNotificationName:SKColorSwatchColorsChangedNotification object:self];
     if (focusedIndex >= (NSInteger)iMax)
         focusedIndex = iMax - 1;
@@ -618,6 +618,7 @@
         [self willChangeColors];
         bezelWidth = [self contentWidth];
         SKColorSwatchItemView *itemView = [[SKColorSwatchItemView alloc] 
initWithFrame:[self frameForCollapsedItemViewAtIndex:i]];
+        [itemView setAutoresizingMask:NSViewNotSizable];
         [itemView setColor:color];
         if (i < (NSInteger)[itemViews count])
             [self addSubview:itemView positioned:NSWindowBelow 
relativeTo:[itemViews objectAtIndex:i]];

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