Flutter macOS Embedder
NSWindow(FlutterWindowSizing) Category Reference

Instance Methods

(void) - flutterSetContentSize:
 
(void) - flutterSetConstraints:
 

Detailed Description

Definition at line 40 of file FlutterWindowController.mm.

Method Documentation

◆ flutterSetConstraints:

- (void) flutterSetConstraints: (FlutterWindowConstraints)  constraints

Definition at line 32 of file FlutterWindowController.mm.

52  :(FlutterWindowConstraints)constraints {
53  NSSize size = [self frameRectForContentRect:self.frame].size;
54  NSSize originalSize = size;
55  [self setContentMinSize:NSMakeSize(constraints.min_width, constraints.min_height)];
56  size.width = std::max(size.width, constraints.min_width);
57  size.height = std::max(size.height, constraints.min_height);
58  if (constraints.max_width > 0 && constraints.max_height > 0) {
59  [self setContentMaxSize:NSMakeSize(constraints.max_width, constraints.max_height)];
60  size.width = std::min(size.width, constraints.max_width);
61  size.height = std::min(size.height, constraints.max_height);
62  } else {
63  [self setContentMaxSize:NSMakeSize(CGFLOAT_MAX, CGFLOAT_MAX)];
64  }
65  if (!NSEqualSizes(originalSize, size)) {
66  [self setContentSize:size];
67  }
68 }

◆ flutterSetContentSize:

- (void) flutterSetContentSize: (FlutterWindowSize)  contentSize

Definition at line 32 of file FlutterWindowController.mm.

48  :(FlutterWindowSize)contentSize {
49  [self setContentSize:NSMakeSize(contentSize.width, contentSize.height)];
50 }

The documentation for this category was generated from the following file: