- (void)resizeTerminalWithContentRect: (NSRect)contentRect saveToDefaults: (BOOL)saveToDefaults;
/*
- * Change the minimum size for the window associated with the context.
- * termIdx is the index for the terminal: pass it so this function can be
- * used when self->terminal has not yet been set.
+ * Change the minimum size and size increments for the window associated with
+ * the context. termIdx is the index for the terminal: pass it so this
+ * function can be used when self->terminal has not yet been set.
*/
-- (void)setMinimumWindowSize:(int)termIdx;
+- (void)constrainWindowSize:(int)termIdx;
/* Called from the view to indicate that it is starting or ending live resize */
- (void)viewWillStartLiveResize:(AngbandView *)view;
[self.primaryWindow
contentRectForFrameRect: [self.primaryWindow frame]];
- [self setMinimumWindowSize:[self terminalIndex]];
+ [self constrainWindowSize:[self terminalIndex]];
NSSize size = self.primaryWindow.contentMinSize;
BOOL windowNeedsResizing = NO;
if (contentRect.size.width < size.width) {
Term_activate( old );
}
-- (void)setMinimumWindowSize:(int)termIdx
+- (void)constrainWindowSize:(int)termIdx
{
NSSize minsize;
minsize.height =
minsize.height * self.tileSize.height + self.borderSize.height * 2.0;
[[self makePrimaryWindow] setContentMinSize:minsize];
+ self.primaryWindow.contentResizeIncrements = self.tileSize;
}
- (void)saveWindowVisibleToDefaults: (BOOL)windowVisible
/* Set its title and, for auxiliary terms, tentative size */
[context setDefaultTitle:termIdx];
- [context setMinimumWindowSize:termIdx];
+ [context constrainWindowSize:termIdx];
/*
* If this is the first term, and we support full screen (Mac OS X Lion